7801 |
30 Apr 20 |
nicklas |
1 |
<%-- $Id$ |
7801 |
30 Apr 20 |
nicklas |
2 |
------------------------------------------------------------------ |
7801 |
30 Apr 20 |
nicklas |
Copyright (C) 2015 Nicklas Nordborg |
7801 |
30 Apr 20 |
nicklas |
4 |
|
7801 |
30 Apr 20 |
nicklas |
5 |
This file is part of BASE - BioArray Software Environment. |
7801 |
30 Apr 20 |
nicklas |
6 |
Available at http://base.thep.lu.se/ |
7801 |
30 Apr 20 |
nicklas |
7 |
|
7801 |
30 Apr 20 |
nicklas |
8 |
BASE is free software; you can redistribute it and/or |
7801 |
30 Apr 20 |
nicklas |
9 |
modify it under the terms of the GNU General Public License |
7801 |
30 Apr 20 |
nicklas |
10 |
as published by the Free Software Foundation; either version 3 |
7801 |
30 Apr 20 |
nicklas |
11 |
of the License, or (at your option) any later version. |
7801 |
30 Apr 20 |
nicklas |
12 |
|
7801 |
30 Apr 20 |
nicklas |
13 |
BASE is distributed in the hope that it will be useful, |
7801 |
30 Apr 20 |
nicklas |
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
7801 |
30 Apr 20 |
nicklas |
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
7801 |
30 Apr 20 |
nicklas |
16 |
GNU General Public License for more details. |
7801 |
30 Apr 20 |
nicklas |
17 |
|
7801 |
30 Apr 20 |
nicklas |
18 |
You should have received a copy of the GNU General Public License |
7801 |
30 Apr 20 |
nicklas |
19 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
7801 |
30 Apr 20 |
nicklas |
20 |
------------------------------------------------------------------ |
7801 |
30 Apr 20 |
nicklas |
21 |
|
7801 |
30 Apr 20 |
nicklas |
22 |
@author Nicklas |
7801 |
30 Apr 20 |
nicklas |
23 |
--%> |
7801 |
30 Apr 20 |
nicklas |
24 |
<%@ page pageEncoding="UTF-8" session="false" |
7801 |
30 Apr 20 |
nicklas |
25 |
import="net.sf.basedb.core.SessionControl" |
7801 |
30 Apr 20 |
nicklas |
26 |
import="net.sf.basedb.core.DbControl" |
7801 |
30 Apr 20 |
nicklas |
27 |
import="net.sf.basedb.core.Item" |
7801 |
30 Apr 20 |
nicklas |
28 |
import="net.sf.basedb.core.ItemContext" |
7801 |
30 Apr 20 |
nicklas |
29 |
import="net.sf.basedb.core.Permission" |
7801 |
30 Apr 20 |
nicklas |
30 |
import="net.sf.basedb.core.ItemList" |
7801 |
30 Apr 20 |
nicklas |
31 |
import="net.sf.basedb.clients.web.Base" |
7801 |
30 Apr 20 |
nicklas |
32 |
import="net.sf.basedb.clients.web.util.HTML" |
7801 |
30 Apr 20 |
nicklas |
33 |
import="net.sf.basedb.util.Values" |
7801 |
30 Apr 20 |
nicklas |
34 |
import="java.util.List" |
7801 |
30 Apr 20 |
nicklas |
35 |
%> |
7801 |
30 Apr 20 |
nicklas |
36 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
7801 |
30 Apr 20 |
nicklas |
37 |
<% |
7801 |
30 Apr 20 |
nicklas |
38 |
final Item itemType = Item.ITEMLIST; |
7801 |
30 Apr 20 |
nicklas |
39 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
7801 |
30 Apr 20 |
nicklas |
40 |
final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
7801 |
30 Apr 20 |
nicklas |
41 |
final String ID = sc.getId(); |
7801 |
30 Apr 20 |
nicklas |
42 |
final float scale = Base.getScale(sc); |
7954 |
12 May 21 |
nicklas |
43 |
final DbControl dc = sc.newDbControl(":Add members to item list"); |
7801 |
30 Apr 20 |
nicklas |
44 |
try |
7801 |
30 Apr 20 |
nicklas |
45 |
{ |
7801 |
30 Apr 20 |
nicklas |
46 |
Item memberType = Item.valueOf(request.getParameter("memberType")); |
7801 |
30 Apr 20 |
nicklas |
47 |
String formId = Values.getStringOrNull(request.getParameter("formId")); |
7801 |
30 Apr 20 |
nicklas |
48 |
String subContext = Values.getString(request.getParameter("subContext"), ""); |
7801 |
30 Apr 20 |
nicklas |
49 |
|
7801 |
30 Apr 20 |
nicklas |
50 |
ItemContext memberContext = sc.getCurrentContext(memberType, subContext); |
7803 |
04 May 20 |
nicklas |
51 |
List<ItemList> recentLists = memberContext.getRecent(dc, Item.ITEMLIST, "AddMembers"); |
7801 |
30 Apr 20 |
nicklas |
52 |
%> |
7801 |
30 Apr 20 |
nicklas |
53 |
<base:page type="popup" title="Add items to existing list"> |
7803 |
04 May 20 |
nicklas |
54 |
<base:head scripts="~add_items.js,linkitems-2.js"> |
7801 |
30 Apr 20 |
nicklas |
55 |
</base:head> |
7801 |
30 Apr 20 |
nicklas |
56 |
<base:body> |
7801 |
30 Apr 20 |
nicklas |
57 |
<h1>Add items to existing list</h1> |
7801 |
30 Apr 20 |
nicklas |
58 |
<form action="index.jsp?ID=<%=ID%>" method="post" name="additems"> |
7801 |
30 Apr 20 |
nicklas |
59 |
<input type="hidden" name="cmd" value="AddMembers"> |
7801 |
30 Apr 20 |
nicklas |
60 |
<% |
7801 |
30 Apr 20 |
nicklas |
61 |
if (subContext != null) |
7801 |
30 Apr 20 |
nicklas |
62 |
{ |
7801 |
30 Apr 20 |
nicklas |
63 |
%> |
7801 |
30 Apr 20 |
nicklas |
64 |
<input type="hidden" name="subContext" value="<%=subContext%>"> |
7801 |
30 Apr 20 |
nicklas |
65 |
<% |
7801 |
30 Apr 20 |
nicklas |
66 |
} |
7801 |
30 Apr 20 |
nicklas |
67 |
%> |
7803 |
04 May 20 |
nicklas |
68 |
<div id="page-data" class="datacontainer" |
7803 |
04 May 20 |
nicklas |
69 |
data-member-type="<%=memberType.getValue()%>" |
7803 |
04 May 20 |
nicklas |
70 |
></div> |
7803 |
04 May 20 |
nicklas |
71 |
|
7801 |
30 Apr 20 |
nicklas |
72 |
<div class="content bottomborder"> |
7801 |
30 Apr 20 |
nicklas |
73 |
<table class="fullform input100"> |
7801 |
30 Apr 20 |
nicklas |
74 |
<tr> |
7801 |
30 Apr 20 |
nicklas |
75 |
<th>Which list?</th> |
7801 |
30 Apr 20 |
nicklas |
76 |
<td> |
7803 |
04 May 20 |
nicklas |
77 |
<base:select |
7803 |
04 May 20 |
nicklas |
78 |
id="item_id" |
7803 |
04 May 20 |
nicklas |
79 |
clazz="selectionlist" |
7803 |
04 May 20 |
nicklas |
80 |
required="true" |
7803 |
04 May 20 |
nicklas |
81 |
current="<%=null%>" |
7803 |
04 May 20 |
nicklas |
82 |
recent="<%=recentLists%>" |
7803 |
04 May 20 |
nicklas |
83 |
/> |
7801 |
30 Apr 20 |
nicklas |
84 |
</td> |
7801 |
30 Apr 20 |
nicklas |
85 |
<td></td> |
7801 |
30 Apr 20 |
nicklas |
86 |
</tr> |
7801 |
30 Apr 20 |
nicklas |
87 |
<tr class="big"> |
7801 |
30 Apr 20 |
nicklas |
88 |
<th>Which items?</th> |
7801 |
30 Apr 20 |
nicklas |
89 |
<td> |
7801 |
30 Apr 20 |
nicklas |
90 |
<input type="radio" name="source" id="sourceSelected" value="selected" |
7801 |
30 Apr 20 |
nicklas |
91 |
data-parent-form="<%=formId%>" |
7801 |
30 Apr 20 |
nicklas |
92 |
><label for="sourceSelected" id="lblSelected">Selected items</label><br> |
7801 |
30 Apr 20 |
nicklas |
93 |
<input type="radio" name="source" id="sourcePage" value="page" |
7801 |
30 Apr 20 |
nicklas |
94 |
><label for="sourcePage">Current page</label><br> |
7801 |
30 Apr 20 |
nicklas |
95 |
<input type="radio" name="source" id="sourceAll" value="all" checked |
7801 |
30 Apr 20 |
nicklas |
96 |
><label for="sourceAll">All pages</label><br> |
7801 |
30 Apr 20 |
nicklas |
97 |
</td> |
7801 |
30 Apr 20 |
nicklas |
98 |
<td></td> |
7801 |
30 Apr 20 |
nicklas |
99 |
</tr> |
7801 |
30 Apr 20 |
nicklas |
100 |
</table> |
7801 |
30 Apr 20 |
nicklas |
101 |
</div> |
7801 |
30 Apr 20 |
nicklas |
102 |
</form> |
7801 |
30 Apr 20 |
nicklas |
103 |
|
7801 |
30 Apr 20 |
nicklas |
104 |
<base:buttongroup subclass="dialogbuttons"> |
7801 |
30 Apr 20 |
nicklas |
105 |
<base:button id="btnAdd" title="Add" /> |
7801 |
30 Apr 20 |
nicklas |
106 |
<base:button id="close" title="Cancel" /> |
7801 |
30 Apr 20 |
nicklas |
107 |
</base:buttongroup> |
7801 |
30 Apr 20 |
nicklas |
108 |
</base:body> |
7801 |
30 Apr 20 |
nicklas |
109 |
</base:page> |
7801 |
30 Apr 20 |
nicklas |
110 |
<% |
7801 |
30 Apr 20 |
nicklas |
111 |
} |
7801 |
30 Apr 20 |
nicklas |
112 |
finally |
7801 |
30 Apr 20 |
nicklas |
113 |
{ |
7801 |
30 Apr 20 |
nicklas |
114 |
if (dc != null) dc.close(); |
7801 |
30 Apr 20 |
nicklas |
115 |
} |
7801 |
30 Apr 20 |
nicklas |
116 |
%> |