5548 |
24 Jan 11 |
nicklas |
1 |
<%-- $Id$ |
5548 |
24 Jan 11 |
nicklas |
2 |
------------------------------------------------------------------ |
5548 |
24 Jan 11 |
nicklas |
Copyright (C) 2011 Nicklas Nordborg |
5548 |
24 Jan 11 |
nicklas |
4 |
|
5548 |
24 Jan 11 |
nicklas |
5 |
This file is part of BASE - BioArray Software Environment. |
5548 |
24 Jan 11 |
nicklas |
6 |
Available at http://base.thep.lu.se/ |
5548 |
24 Jan 11 |
nicklas |
7 |
|
5548 |
24 Jan 11 |
nicklas |
8 |
BASE is free software; you can redistribute it and/or |
5548 |
24 Jan 11 |
nicklas |
9 |
modify it under the terms of the GNU General Public License |
5548 |
24 Jan 11 |
nicklas |
10 |
as published by the Free Software Foundation; either version 3 |
5548 |
24 Jan 11 |
nicklas |
11 |
of the License, or (at your option) any later version. |
5548 |
24 Jan 11 |
nicklas |
12 |
|
5548 |
24 Jan 11 |
nicklas |
13 |
BASE is distributed in the hope that it will be useful, |
5548 |
24 Jan 11 |
nicklas |
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
5548 |
24 Jan 11 |
nicklas |
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5548 |
24 Jan 11 |
nicklas |
16 |
GNU General Public License for more details. |
5548 |
24 Jan 11 |
nicklas |
17 |
|
5548 |
24 Jan 11 |
nicklas |
18 |
You should have received a copy of the GNU General Public License |
5548 |
24 Jan 11 |
nicklas |
19 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
5548 |
24 Jan 11 |
nicklas |
20 |
------------------------------------------------------------------ |
5548 |
24 Jan 11 |
nicklas |
21 |
|
5548 |
24 Jan 11 |
nicklas |
22 |
@author Nicklas |
5548 |
24 Jan 11 |
nicklas |
23 |
--%> |
5548 |
24 Jan 11 |
nicklas |
24 |
<%@ page pageEncoding="UTF-8" session="false" |
5548 |
24 Jan 11 |
nicklas |
25 |
import="net.sf.basedb.core.BioPlate" |
5548 |
24 Jan 11 |
nicklas |
26 |
import="net.sf.basedb.core.BioPlateEvent" |
5548 |
24 Jan 11 |
nicklas |
27 |
import="net.sf.basedb.core.BioPlateEventType" |
5548 |
24 Jan 11 |
nicklas |
28 |
import="net.sf.basedb.core.BioPlateType" |
5723 |
07 Sep 11 |
nicklas |
29 |
import="net.sf.basedb.core.BioWell" |
5548 |
24 Jan 11 |
nicklas |
30 |
import="net.sf.basedb.core.PlateGeometry" |
5548 |
24 Jan 11 |
nicklas |
31 |
import="net.sf.basedb.core.MeasuredBioMaterial" |
5548 |
24 Jan 11 |
nicklas |
32 |
import="net.sf.basedb.core.Hardware" |
6997 |
03 Nov 15 |
nicklas |
33 |
import="net.sf.basedb.core.Kit" |
5548 |
24 Jan 11 |
nicklas |
34 |
import="net.sf.basedb.core.Protocol" |
5641 |
25 May 11 |
nicklas |
35 |
import="net.sf.basedb.core.Tag" |
5723 |
07 Sep 11 |
nicklas |
36 |
import="net.sf.basedb.core.ItemSubtype" |
5548 |
24 Jan 11 |
nicklas |
37 |
import="net.sf.basedb.core.DbControl" |
5548 |
24 Jan 11 |
nicklas |
38 |
import="net.sf.basedb.core.Item" |
5548 |
24 Jan 11 |
nicklas |
39 |
import="net.sf.basedb.core.ItemContext" |
5548 |
24 Jan 11 |
nicklas |
40 |
import="net.sf.basedb.core.ItemQuery" |
5553 |
27 Jan 11 |
nicklas |
41 |
import="net.sf.basedb.core.Include" |
5548 |
24 Jan 11 |
nicklas |
42 |
import="net.sf.basedb.core.SessionControl" |
5548 |
24 Jan 11 |
nicklas |
43 |
import="net.sf.basedb.core.SystemItems" |
5723 |
07 Sep 11 |
nicklas |
44 |
import="net.sf.basedb.core.PermissionDeniedException" |
5548 |
24 Jan 11 |
nicklas |
45 |
import="net.sf.basedb.core.query.Restrictions" |
5553 |
27 Jan 11 |
nicklas |
46 |
import="net.sf.basedb.core.query.Orders" |
5548 |
24 Jan 11 |
nicklas |
47 |
import="net.sf.basedb.core.query.Hql" |
5548 |
24 Jan 11 |
nicklas |
48 |
import="net.sf.basedb.util.Values" |
5548 |
24 Jan 11 |
nicklas |
49 |
import="net.sf.basedb.util.formatter.Formatter" |
5548 |
24 Jan 11 |
nicklas |
50 |
import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
5548 |
24 Jan 11 |
nicklas |
51 |
import="net.sf.basedb.clients.web.formatter.FormatterSettings" |
5548 |
24 Jan 11 |
nicklas |
52 |
import="net.sf.basedb.clients.web.Base" |
5548 |
24 Jan 11 |
nicklas |
53 |
import="net.sf.basedb.clients.web.util.HTML" |
5548 |
24 Jan 11 |
nicklas |
54 |
import="java.util.List" |
5548 |
24 Jan 11 |
nicklas |
55 |
import="java.util.Date" |
5548 |
24 Jan 11 |
nicklas |
56 |
import="java.util.Collections" |
5548 |
24 Jan 11 |
nicklas |
57 |
%> |
5548 |
24 Jan 11 |
nicklas |
58 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
5548 |
24 Jan 11 |
nicklas |
59 |
<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
5548 |
24 Jan 11 |
nicklas |
60 |
<% |
5548 |
24 Jan 11 |
nicklas |
61 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
5548 |
24 Jan 11 |
nicklas |
62 |
final String ID = sc.getId(); |
5548 |
24 Jan 11 |
nicklas |
63 |
final float scale = Base.getScale(sc); |
5548 |
24 Jan 11 |
nicklas |
64 |
final int sourcePlateId = Values.getInt(request.getParameter("sourceplate_id")); |
5548 |
24 Jan 11 |
nicklas |
65 |
final ItemContext cc = sc.getCurrentContext(Item.BIOPLATEEVENT, BioPlateEventType.CREATE_BIOMATERIAL); |
7954 |
12 May 21 |
nicklas |
66 |
final DbControl dc = sc.newDbControl(":Create child plate wizard step 1"); |
5548 |
24 Jan 11 |
nicklas |
67 |
try |
5548 |
24 Jan 11 |
nicklas |
68 |
{ |
5548 |
24 Jan 11 |
nicklas |
69 |
BioPlate sourcePlate = BioPlate.getById(dc, sourcePlateId); |
5548 |
24 Jan 11 |
nicklas |
70 |
BioPlateType sourceType = sourcePlate.getBioPlateType(); |
5548 |
24 Jan 11 |
nicklas |
71 |
Item sourceBioMaterialType = sourceType.getBioMaterialType(); |
5548 |
24 Jan 11 |
nicklas |
72 |
PlateGeometry sourceGeometry = sourcePlate.getPlateGeometry(); |
5548 |
24 Jan 11 |
nicklas |
73 |
Hardware sourceFreezer = sourcePlate.getFreezer(); |
5548 |
24 Jan 11 |
nicklas |
74 |
|
5548 |
24 Jan 11 |
nicklas |
75 |
// Load recently used items |
7605 |
26 Feb 19 |
nicklas |
76 |
List<Hardware> recentHardware = cc.getRecent(dc, Item.HARDWARE, sourceBioMaterialType.name()); |
7605 |
26 Feb 19 |
nicklas |
77 |
List<Protocol> recentProtocols = cc.getRecent(dc, Item.PROTOCOL, sourceBioMaterialType.name()); |
7605 |
26 Feb 19 |
nicklas |
78 |
List<Kit> recentKits = cc.getRecent(dc, Item.KIT, sourceBioMaterialType.name()); |
7605 |
26 Feb 19 |
nicklas |
79 |
List<PlateGeometry> recentGeometry = cc.getRecent(dc, Item.PLATEGEOMETRY, sourceBioMaterialType.name()); |
7605 |
26 Feb 19 |
nicklas |
80 |
List<BioPlateType> recentPlateTypes = cc.getRecent(dc, Item.BIOPLATETYPE, sourceBioMaterialType.name()); |
7605 |
26 Feb 19 |
nicklas |
81 |
List<Hardware> recentFreezers = cc.getRecent(dc, Item.HARDWARE, "freezer"); |
5723 |
07 Sep 11 |
nicklas |
82 |
|
5723 |
07 Sep 11 |
nicklas |
83 |
// Load subtypes |
5723 |
07 Sep 11 |
nicklas |
84 |
final List<ItemSubtype> sampleSubtypes = sourceBioMaterialType == Item.SAMPLE ? |
5723 |
07 Sep 11 |
nicklas |
85 |
Base.getSubtypesQuery(Item.SAMPLE).list(dc) : null; |
5723 |
07 Sep 11 |
nicklas |
86 |
final List<ItemSubtype> extractSubtypes = Base.getSubtypesQuery(Item.EXTRACT).list(dc); |
5723 |
07 Sep 11 |
nicklas |
87 |
final List<ItemSubtype> bioAssaySubtypes = sourceBioMaterialType == Item.EXTRACT ? |
5723 |
07 Sep 11 |
nicklas |
88 |
Base.getSubtypesQuery(Item.PHYSICALBIOASSAY).list(dc) : null; |
5723 |
07 Sep 11 |
nicklas |
89 |
// Find a common itemsubtype (if any) |
5723 |
07 Sep 11 |
nicklas |
90 |
ItemSubtype commonSubtype = null; |
5723 |
07 Sep 11 |
nicklas |
91 |
boolean first = true; |
5723 |
07 Sep 11 |
nicklas |
92 |
for (BioWell well : sourcePlate.getBioWells().list(dc)) |
5723 |
07 Sep 11 |
nicklas |
93 |
{ |
5723 |
07 Sep 11 |
nicklas |
94 |
try |
5723 |
07 Sep 11 |
nicklas |
95 |
{ |
5723 |
07 Sep 11 |
nicklas |
96 |
if (!well.isEmpty()) |
5723 |
07 Sep 11 |
nicklas |
97 |
{ |
5723 |
07 Sep 11 |
nicklas |
98 |
ItemSubtype subtype = well.getBioMaterial().getItemSubtype(); |
5723 |
07 Sep 11 |
nicklas |
99 |
if (first) |
5723 |
07 Sep 11 |
nicklas |
100 |
{ |
5723 |
07 Sep 11 |
nicklas |
101 |
commonSubtype = subtype; |
5723 |
07 Sep 11 |
nicklas |
102 |
first = false; |
5723 |
07 Sep 11 |
nicklas |
103 |
} |
5723 |
07 Sep 11 |
nicklas |
104 |
else |
5723 |
07 Sep 11 |
nicklas |
105 |
{ |
5723 |
07 Sep 11 |
nicklas |
106 |
if (subtype == null || !subtype.equals(commonSubtype)) |
5723 |
07 Sep 11 |
nicklas |
107 |
{ |
5723 |
07 Sep 11 |
nicklas |
108 |
commonSubtype = null; |
5723 |
07 Sep 11 |
nicklas |
109 |
break; |
5723 |
07 Sep 11 |
nicklas |
110 |
} |
5723 |
07 Sep 11 |
nicklas |
111 |
} |
5723 |
07 Sep 11 |
nicklas |
112 |
} |
5723 |
07 Sep 11 |
nicklas |
113 |
} |
5723 |
07 Sep 11 |
nicklas |
114 |
catch (PermissionDeniedException ex) |
5723 |
07 Sep 11 |
nicklas |
115 |
{} |
5723 |
07 Sep 11 |
nicklas |
116 |
} |
5548 |
24 Jan 11 |
nicklas |
117 |
final Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); |
5548 |
24 Jan 11 |
nicklas |
118 |
final String dateFormat = FormatterSettings.getDateFormat(sc); |
5548 |
24 Jan 11 |
nicklas |
119 |
final String jsDateFormat = HTML.javaScriptEncode(dateFormat); |
5548 |
24 Jan 11 |
nicklas |
120 |
final String htmlDateFormat = HTML.encodeTags(dateFormat); |
5548 |
24 Jan 11 |
nicklas |
121 |
%> |
6397 |
24 Jan 14 |
nicklas |
122 |
<base:page type="popup" title="Create child bioplate - step 1/2" id="step-1"> |
6397 |
24 Jan 14 |
nicklas |
123 |
<base:head scripts="subtypes.js,~wizards.js,~create_child_bioplate.js" /> |
6397 |
24 Jan 14 |
nicklas |
124 |
<base:body> |
6397 |
24 Jan 14 |
nicklas |
125 |
<h1>Create child bioplate - step 1/2 <base:help helpid="bioplateevent.create-child-1" /></h1> |
5548 |
24 Jan 11 |
nicklas |
126 |
|
6397 |
24 Jan 14 |
nicklas |
127 |
<div id="page-data" class="datacontainer" |
6397 |
24 Jan 14 |
nicklas |
128 |
data-freezer-id="<%=SystemItems.getId(Hardware.FREEZER)%>" |
6397 |
24 Jan 14 |
nicklas |
129 |
data-SAMPLE="<%=Item.SAMPLE.getValue()%>" |
6397 |
24 Jan 14 |
nicklas |
130 |
data-EXTRACT="<%=Item.EXTRACT.getValue()%>" |
6397 |
24 Jan 14 |
nicklas |
131 |
></div> |
5723 |
07 Sep 11 |
nicklas |
132 |
|
5928 |
17 Jan 12 |
nicklas |
133 |
<form name="main" action="create_child_bioplate_step2.jsp" method="post"> |
5928 |
17 Jan 12 |
nicklas |
134 |
<input type="hidden" name="ID" value="<%=ID%>"> |
5928 |
17 Jan 12 |
nicklas |
135 |
<input type="hidden" name="sourceplate_id" value="<%=sourcePlateId%>"> |
5928 |
17 Jan 12 |
nicklas |
136 |
|
5928 |
17 Jan 12 |
nicklas |
137 |
<div class="content bottomborder"> |
5928 |
17 Jan 12 |
nicklas |
138 |
<table class="fullform input100"> |
5928 |
17 Jan 12 |
nicklas |
139 |
<tbody class="sectionheader"> |
5548 |
24 Jan 11 |
nicklas |
140 |
<tr> |
5928 |
17 Jan 12 |
nicklas |
141 |
<th colspan="3">Event</th> |
5928 |
17 Jan 12 |
nicklas |
142 |
</tr> |
5928 |
17 Jan 12 |
nicklas |
143 |
</tbody> |
5928 |
17 Jan 12 |
nicklas |
144 |
<tbody> |
5928 |
17 Jan 12 |
nicklas |
145 |
<tr> |
5928 |
17 Jan 12 |
nicklas |
146 |
<th>Event name</th> |
6217 |
14 Dec 12 |
nicklas |
147 |
<td><input class="text required" type="text" name="event_name" |
5548 |
24 Jan 11 |
nicklas |
148 |
value="Create child plate" |
5928 |
17 Jan 12 |
nicklas |
149 |
maxlength="<%=BioPlateEvent.MAX_NAME_LENGTH%>"> |
5928 |
17 Jan 12 |
nicklas |
150 |
</td> |
5928 |
17 Jan 12 |
nicklas |
151 |
<td rowspan="4"> |
5928 |
17 Jan 12 |
nicklas |
152 |
<table style="width: 100%;"> |
5928 |
17 Jan 12 |
nicklas |
153 |
<tr> |
5928 |
17 Jan 12 |
nicklas |
154 |
<td> |
5928 |
17 Jan 12 |
nicklas |
155 |
<b>Description</b><br> |
6217 |
14 Dec 12 |
nicklas |
156 |
<textarea class="text" rows="4" name="event_description" id="event_description" |
5928 |
17 Jan 12 |
nicklas |
157 |
></textarea> |
5928 |
17 Jan 12 |
nicklas |
158 |
</td> |
5928 |
17 Jan 12 |
nicklas |
159 |
<td style="width: 20px;"> |
6215 |
13 Dec 12 |
nicklas |
160 |
<base:zoom textarea="event_description" title="Event description" /> |
5928 |
17 Jan 12 |
nicklas |
161 |
</td> |
5928 |
17 Jan 12 |
nicklas |
162 |
</tr> |
5928 |
17 Jan 12 |
nicklas |
163 |
</table> |
5928 |
17 Jan 12 |
nicklas |
164 |
</td> |
5548 |
24 Jan 11 |
nicklas |
165 |
</tr> |
5548 |
24 Jan 11 |
nicklas |
166 |
<tr> |
5928 |
17 Jan 12 |
nicklas |
167 |
<th>Event date</th> |
5548 |
24 Jan 11 |
nicklas |
168 |
<td> |
5928 |
17 Jan 12 |
nicklas |
169 |
<table> |
5548 |
24 Jan 11 |
nicklas |
170 |
<tr> |
5548 |
24 Jan 11 |
nicklas |
171 |
<td> |
6217 |
14 Dec 12 |
nicklas |
172 |
<input class="text" type="text" name="event_date" id="event_date" style="width: 15em;" |
5548 |
24 Jan 11 |
nicklas |
173 |
value="<%=HTML.encodeTags(dateFormatter.format(new Date()))%>" |
5928 |
17 Jan 12 |
nicklas |
174 |
maxlength="20" title="Enter date in format: <%=htmlDateFormat%>"> |
5548 |
24 Jan 11 |
nicklas |
175 |
</td> |
5548 |
24 Jan 11 |
nicklas |
176 |
<td> |
6216 |
14 Dec 12 |
nicklas |
177 |
<base:calendar textarea="event_date" title="Event date" /> |
5548 |
24 Jan 11 |
nicklas |
178 |
</td> |
5548 |
24 Jan 11 |
nicklas |
179 |
</tr> |
5548 |
24 Jan 11 |
nicklas |
180 |
</table> |
5548 |
24 Jan 11 |
nicklas |
181 |
</td> |
5548 |
24 Jan 11 |
nicklas |
182 |
</tr> |
5548 |
24 Jan 11 |
nicklas |
183 |
<tr> |
5928 |
17 Jan 12 |
nicklas |
184 |
<th>Protocol</th> |
5548 |
24 Jan 11 |
nicklas |
185 |
<td> |
5548 |
24 Jan 11 |
nicklas |
186 |
<base:select |
5548 |
24 Jan 11 |
nicklas |
187 |
id="protocol_id" |
5548 |
24 Jan 11 |
nicklas |
188 |
clazz="selectionlist" |
5548 |
24 Jan 11 |
nicklas |
189 |
required="false" |
5548 |
24 Jan 11 |
nicklas |
190 |
current="<%=null%>" |
5548 |
24 Jan 11 |
nicklas |
191 |
recent="<%=recentProtocols%>" |
5548 |
24 Jan 11 |
nicklas |
192 |
/> |
5548 |
24 Jan 11 |
nicklas |
193 |
</td> |
5548 |
24 Jan 11 |
nicklas |
194 |
</tr> |
5548 |
24 Jan 11 |
nicklas |
195 |
<tr> |
6997 |
03 Nov 15 |
nicklas |
196 |
<th>Kit</th> |
6997 |
03 Nov 15 |
nicklas |
197 |
<td> |
6997 |
03 Nov 15 |
nicklas |
198 |
<base:select |
6997 |
03 Nov 15 |
nicklas |
199 |
id="kit_id" |
6997 |
03 Nov 15 |
nicklas |
200 |
clazz="selectionlist" |
6997 |
03 Nov 15 |
nicklas |
201 |
required="false" |
6997 |
03 Nov 15 |
nicklas |
202 |
current="<%=null%>" |
6997 |
03 Nov 15 |
nicklas |
203 |
recent="<%=recentKits%>" |
6997 |
03 Nov 15 |
nicklas |
204 |
/> |
6997 |
03 Nov 15 |
nicklas |
205 |
</td> |
6997 |
03 Nov 15 |
nicklas |
206 |
</tr> |
6997 |
03 Nov 15 |
nicklas |
207 |
<tr> |
5928 |
17 Jan 12 |
nicklas |
208 |
<th>Hardware</th> |
5548 |
24 Jan 11 |
nicklas |
209 |
<td> |
5548 |
24 Jan 11 |
nicklas |
210 |
<base:select |
5548 |
24 Jan 11 |
nicklas |
211 |
id="hardware_id" |
5548 |
24 Jan 11 |
nicklas |
212 |
clazz="selectionlist" |
5548 |
24 Jan 11 |
nicklas |
213 |
required="false" |
5548 |
24 Jan 11 |
nicklas |
214 |
current="<%=null%>" |
5548 |
24 Jan 11 |
nicklas |
215 |
recent="<%=recentHardware%>" |
5548 |
24 Jan 11 |
nicklas |
216 |
/> |
5548 |
24 Jan 11 |
nicklas |
217 |
</td> |
5548 |
24 Jan 11 |
nicklas |
218 |
</tr> |
5928 |
17 Jan 12 |
nicklas |
219 |
</tbody> |
5928 |
17 Jan 12 |
nicklas |
220 |
|
5928 |
17 Jan 12 |
nicklas |
221 |
<tbody class="sectionheader"> |
5553 |
27 Jan 11 |
nicklas |
222 |
<tr> |
5928 |
17 Jan 12 |
nicklas |
223 |
<th colspan="3">Child biomaterial</th> |
5928 |
17 Jan 12 |
nicklas |
224 |
</tr> |
5928 |
17 Jan 12 |
nicklas |
225 |
</tbody> |
5928 |
17 Jan 12 |
nicklas |
226 |
<tbody> |
5928 |
17 Jan 12 |
nicklas |
227 |
<tr> |
5928 |
17 Jan 12 |
nicklas |
228 |
<th>Type</th> |
5553 |
27 Jan 11 |
nicklas |
229 |
<td> |
6397 |
24 Jan 14 |
nicklas |
230 |
<select name="child_biomaterial_type" class="required selectionlist" id="child_biomaterial_type"> |
5553 |
27 Jan 11 |
nicklas |
231 |
<% |
5553 |
27 Jan 11 |
nicklas |
232 |
if (sourceBioMaterialType == Item.SAMPLE) |
5553 |
27 Jan 11 |
nicklas |
233 |
{ |
5553 |
27 Jan 11 |
nicklas |
234 |
%> |
5553 |
27 Jan 11 |
nicklas |
235 |
<option value="SAMPLE">Sample → Sample |
5553 |
27 Jan 11 |
nicklas |
236 |
<option value="EXTRACT" selected>Sample → Extract |
5553 |
27 Jan 11 |
nicklas |
237 |
<% |
5553 |
27 Jan 11 |
nicklas |
238 |
} |
5553 |
27 Jan 11 |
nicklas |
239 |
else if (sourceBioMaterialType == Item.EXTRACT) |
5553 |
27 Jan 11 |
nicklas |
240 |
{ |
5553 |
27 Jan 11 |
nicklas |
241 |
%> |
5553 |
27 Jan 11 |
nicklas |
242 |
<option value="EXTRACT">Extract → Extract |
5642 |
26 May 11 |
nicklas |
243 |
<option value="PHYSICALBIOASSAY" selected>Extract → Physical bioassay |
5553 |
27 Jan 11 |
nicklas |
244 |
<% |
5553 |
27 Jan 11 |
nicklas |
245 |
} |
5553 |
27 Jan 11 |
nicklas |
246 |
%> |
5553 |
27 Jan 11 |
nicklas |
247 |
</select> |
5553 |
27 Jan 11 |
nicklas |
248 |
</td> |
6145 |
21 Sep 12 |
nicklas |
249 |
<td rowspan="7"> |
5928 |
17 Jan 12 |
nicklas |
250 |
<table style="width: 100%;"> |
5928 |
17 Jan 12 |
nicklas |
251 |
<tr> |
5928 |
17 Jan 12 |
nicklas |
252 |
<td> |
5928 |
17 Jan 12 |
nicklas |
253 |
<b>Description</b><br> |
6217 |
14 Dec 12 |
nicklas |
254 |
<textarea class="text" rows="4" name="child_description" id="child_description"></textarea> |
5928 |
17 Jan 12 |
nicklas |
255 |
</td> |
5928 |
17 Jan 12 |
nicklas |
256 |
<td style="width: 20px;"> |
6215 |
13 Dec 12 |
nicklas |
257 |
<base:zoom textarea="child_description" title="Biomaterial description" /> |
5928 |
17 Jan 12 |
nicklas |
258 |
</td> |
5928 |
17 Jan 12 |
nicklas |
259 |
</tr> |
5928 |
17 Jan 12 |
nicklas |
260 |
</table> |
5928 |
17 Jan 12 |
nicklas |
261 |
</td> |
5553 |
27 Jan 11 |
nicklas |
262 |
</tr> |
6145 |
21 Sep 12 |
nicklas |
263 |
<tr id="sampleSubtypesDiv" style="display: none;"> |
6145 |
21 Sep 12 |
nicklas |
264 |
<th>Subtype</th> |
6145 |
21 Sep 12 |
nicklas |
265 |
<td> |
6297 |
14 Jun 13 |
nicklas |
266 |
<select name="SAMPLE_subtype_id" id="SAMPLE_subtype_id" class="selectionlist"> |
6145 |
21 Sep 12 |
nicklas |
267 |
<option value="0">- none - |
6145 |
21 Sep 12 |
nicklas |
268 |
<% |
6145 |
21 Sep 12 |
nicklas |
269 |
if (sampleSubtypes != null) |
6145 |
21 Sep 12 |
nicklas |
270 |
{ |
5723 |
07 Sep 11 |
nicklas |
271 |
int currentSubtypeId = 0; |
5723 |
07 Sep 11 |
nicklas |
272 |
if (commonSubtype != null) |
5553 |
27 Jan 11 |
nicklas |
273 |
{ |
5723 |
07 Sep 11 |
nicklas |
274 |
List<ItemSubtype> relatedToParent = ItemSubtype.getParentSubtypes(dc, commonSubtype, Item.SAMPLE); |
5723 |
07 Sep 11 |
nicklas |
275 |
if (relatedToParent.size() > 0) currentSubtypeId = relatedToParent.get(0).getId(); |
5723 |
07 Sep 11 |
nicklas |
276 |
} |
5723 |
07 Sep 11 |
nicklas |
277 |
for (ItemSubtype subtype : sampleSubtypes) |
5723 |
07 Sep 11 |
nicklas |
278 |
{ |
5723 |
07 Sep 11 |
nicklas |
279 |
int id = subtype.getId(); |
5553 |
27 Jan 11 |
nicklas |
280 |
%> |
5723 |
07 Sep 11 |
nicklas |
281 |
<option value="<%=id%>" |
5723 |
07 Sep 11 |
nicklas |
282 |
<%=id == currentSubtypeId ? "selected" : ""%> |
5723 |
07 Sep 11 |
nicklas |
283 |
title="<%=HTML.encodeTags(subtype.getDescription()) %>" |
5723 |
07 Sep 11 |
nicklas |
284 |
><%=HTML.encodeTags(subtype.getName())%> |
5553 |
27 Jan 11 |
nicklas |
285 |
<% |
5553 |
27 Jan 11 |
nicklas |
286 |
} |
6145 |
21 Sep 12 |
nicklas |
287 |
} |
6145 |
21 Sep 12 |
nicklas |
288 |
%> |
6145 |
21 Sep 12 |
nicklas |
289 |
</select> |
6145 |
21 Sep 12 |
nicklas |
290 |
</td> |
6145 |
21 Sep 12 |
nicklas |
291 |
</tr> |
6145 |
21 Sep 12 |
nicklas |
292 |
<tr id="extractSubtypesDiv" style="display: none;"> |
6145 |
21 Sep 12 |
nicklas |
293 |
<th>Subtype</th> |
6145 |
21 Sep 12 |
nicklas |
294 |
<td> |
6297 |
14 Jun 13 |
nicklas |
295 |
<select name="EXTRACT_subtype_id" id="EXTRACT_subtype_id" class="selectionlist"> |
6145 |
21 Sep 12 |
nicklas |
296 |
<option value="0">- none - |
6145 |
21 Sep 12 |
nicklas |
297 |
<% |
6145 |
21 Sep 12 |
nicklas |
298 |
if (extractSubtypes != null) |
6145 |
21 Sep 12 |
nicklas |
299 |
{ |
5723 |
07 Sep 11 |
nicklas |
300 |
int currentSubtypeId = 0; |
5723 |
07 Sep 11 |
nicklas |
301 |
if (commonSubtype != null) |
5723 |
07 Sep 11 |
nicklas |
302 |
{ |
5723 |
07 Sep 11 |
nicklas |
303 |
List<ItemSubtype> relatedToParent = ItemSubtype.getParentSubtypes(dc, commonSubtype, Item.EXTRACT); |
5723 |
07 Sep 11 |
nicklas |
304 |
if (relatedToParent.size() > 0) currentSubtypeId = relatedToParent.get(0).getId(); |
5723 |
07 Sep 11 |
nicklas |
305 |
} |
5723 |
07 Sep 11 |
nicklas |
306 |
for (ItemSubtype subtype : extractSubtypes) |
5723 |
07 Sep 11 |
nicklas |
307 |
{ |
5723 |
07 Sep 11 |
nicklas |
308 |
int id = subtype.getId(); |
5723 |
07 Sep 11 |
nicklas |
309 |
%> |
5723 |
07 Sep 11 |
nicklas |
310 |
<option value="<%=id%>" |
5723 |
07 Sep 11 |
nicklas |
311 |
<%=id == currentSubtypeId ? "selected" : ""%> |
5723 |
07 Sep 11 |
nicklas |
312 |
title="<%=HTML.encodeTags(subtype.getDescription()) %>" |
5723 |
07 Sep 11 |
nicklas |
313 |
><%=HTML.encodeTags(subtype.getName())%> |
5723 |
07 Sep 11 |
nicklas |
314 |
<% |
5723 |
07 Sep 11 |
nicklas |
315 |
} |
6145 |
21 Sep 12 |
nicklas |
316 |
} |
6145 |
21 Sep 12 |
nicklas |
317 |
%> |
6145 |
21 Sep 12 |
nicklas |
318 |
</select> |
6145 |
21 Sep 12 |
nicklas |
319 |
</td> |
6145 |
21 Sep 12 |
nicklas |
320 |
</tr> |
6145 |
21 Sep 12 |
nicklas |
321 |
<tr id="bioAssaySubtypesDiv" style="display: none;"> |
6145 |
21 Sep 12 |
nicklas |
322 |
<th>Subtype</th> |
6145 |
21 Sep 12 |
nicklas |
323 |
<td> |
6297 |
14 Jun 13 |
nicklas |
324 |
<select name="PHYSICALBIOASSAY_subtype_id" id="PHYSICALBIOASSAY_subtype_id" class="selectionlist"> |
6145 |
21 Sep 12 |
nicklas |
325 |
<option value="0">- none - |
6145 |
21 Sep 12 |
nicklas |
326 |
<% |
6145 |
21 Sep 12 |
nicklas |
327 |
if (bioAssaySubtypes != null) |
6145 |
21 Sep 12 |
nicklas |
328 |
{ |
5723 |
07 Sep 11 |
nicklas |
329 |
int currentSubtypeId = 0; |
5723 |
07 Sep 11 |
nicklas |
330 |
if (commonSubtype != null) |
5723 |
07 Sep 11 |
nicklas |
331 |
{ |
5723 |
07 Sep 11 |
nicklas |
332 |
List<ItemSubtype> relatedToParent = ItemSubtype.getParentSubtypes(dc, commonSubtype, Item.PHYSICALBIOASSAY); |
5723 |
07 Sep 11 |
nicklas |
333 |
if (relatedToParent.size() > 0) currentSubtypeId = relatedToParent.get(0).getId(); |
5723 |
07 Sep 11 |
nicklas |
334 |
} |
5723 |
07 Sep 11 |
nicklas |
335 |
for (ItemSubtype subtype : bioAssaySubtypes) |
5723 |
07 Sep 11 |
nicklas |
336 |
{ |
5723 |
07 Sep 11 |
nicklas |
337 |
int id = subtype.getId(); |
5723 |
07 Sep 11 |
nicklas |
338 |
%> |
5723 |
07 Sep 11 |
nicklas |
339 |
<option value="<%=id%>" |
5723 |
07 Sep 11 |
nicklas |
340 |
<%=id == currentSubtypeId ? "selected" : ""%> |
5723 |
07 Sep 11 |
nicklas |
341 |
title="<%=HTML.encodeTags(subtype.getDescription()) %>" |
5723 |
07 Sep 11 |
nicklas |
342 |
><%=HTML.encodeTags(subtype.getName())%> |
5723 |
07 Sep 11 |
nicklas |
343 |
<% |
5723 |
07 Sep 11 |
nicklas |
344 |
} |
6145 |
21 Sep 12 |
nicklas |
345 |
} |
6145 |
21 Sep 12 |
nicklas |
346 |
%> |
6145 |
21 Sep 12 |
nicklas |
347 |
</select> |
6145 |
21 Sep 12 |
nicklas |
348 |
</td> |
6145 |
21 Sep 12 |
nicklas |
349 |
</tr> |
5723 |
07 Sep 11 |
nicklas |
350 |
<tr id="tagDiv" style="display: none;"> |
5928 |
17 Jan 12 |
nicklas |
351 |
<th>Tag</th> |
5723 |
07 Sep 11 |
nicklas |
352 |
<td> |
5723 |
07 Sep 11 |
nicklas |
353 |
<base:select |
5723 |
07 Sep 11 |
nicklas |
354 |
id="tag_id" |
5723 |
07 Sep 11 |
nicklas |
355 |
clazz="selectionlist" |
5723 |
07 Sep 11 |
nicklas |
356 |
required="false" |
5723 |
07 Sep 11 |
nicklas |
357 |
unselectedtext="<%=sourceBioMaterialType == Item.SAMPLE ? "- none -" : "- same as parent -" %>" |
5723 |
07 Sep 11 |
nicklas |
358 |
current="<%=null%>" |
5723 |
07 Sep 11 |
nicklas |
359 |
/> |
5723 |
07 Sep 11 |
nicklas |
360 |
</td> |
5723 |
07 Sep 11 |
nicklas |
361 |
</tr> |
5559 |
31 Jan 11 |
nicklas |
362 |
<tr id="originalQuantityDiv"> |
5928 |
17 Jan 12 |
nicklas |
363 |
<th>Original quantity</th> |
6397 |
24 Jan 14 |
nicklas |
364 |
<td><input class="text" type="text" name="original_quantity" id="original_quantity" style="width: 15em;" |
6397 |
24 Jan 14 |
nicklas |
365 |
maxlength="10"> (µg)</td> |
5553 |
27 Jan 11 |
nicklas |
366 |
</tr> |
5553 |
27 Jan 11 |
nicklas |
367 |
<tr> |
5928 |
17 Jan 12 |
nicklas |
368 |
<th>Used from parent</th> |
6397 |
24 Jan 14 |
nicklas |
369 |
<td><input class="text" type="text" name="used_quantity" id="used_quantity" style="width: 15em;" |
6397 |
24 Jan 14 |
nicklas |
370 |
maxlength="10"> (µg)</td> |
5553 |
27 Jan 11 |
nicklas |
371 |
</tr> |
5928 |
17 Jan 12 |
nicklas |
372 |
</tbody> |
5928 |
17 Jan 12 |
nicklas |
373 |
<tbody class="sectionheader"> |
5548 |
24 Jan 11 |
nicklas |
374 |
<tr> |
5928 |
17 Jan 12 |
nicklas |
375 |
<th colspan="3">Child plates</th> |
5928 |
17 Jan 12 |
nicklas |
376 |
</tr> |
5928 |
17 Jan 12 |
nicklas |
377 |
</tbody> |
5928 |
17 Jan 12 |
nicklas |
378 |
<tbody> |
5928 |
17 Jan 12 |
nicklas |
379 |
<tr> |
5928 |
17 Jan 12 |
nicklas |
380 |
<th>No. of plates</th> |
6397 |
24 Jan 14 |
nicklas |
381 |
<td><input class="text required" type="text" name="number_of_plates" id="number_of_plates" |
6397 |
24 Jan 14 |
nicklas |
382 |
value="1" |
6397 |
24 Jan 14 |
nicklas |
383 |
maxlength="2" style="width: 15em;"></td> |
6145 |
21 Sep 12 |
nicklas |
384 |
<td rowspan="6"> |
5928 |
17 Jan 12 |
nicklas |
385 |
<table style="width: 100%;"> |
5928 |
17 Jan 12 |
nicklas |
386 |
<tr> |
5928 |
17 Jan 12 |
nicklas |
387 |
<td> |
5928 |
17 Jan 12 |
nicklas |
388 |
<b>Description</b><br> |
6217 |
14 Dec 12 |
nicklas |
389 |
<textarea class="text" rows="4" name="plate_description" id="plate_description"></textarea> |
5928 |
17 Jan 12 |
nicklas |
390 |
</td> |
5928 |
17 Jan 12 |
nicklas |
391 |
<td style="width: 20px;"> |
6215 |
13 Dec 12 |
nicklas |
392 |
<base:zoom textarea="plate_description" title="Plate description" /> |
5928 |
17 Jan 12 |
nicklas |
393 |
</td> |
5928 |
17 Jan 12 |
nicklas |
394 |
</tr> |
5928 |
17 Jan 12 |
nicklas |
395 |
</table> |
5928 |
17 Jan 12 |
nicklas |
396 |
</td> |
5548 |
24 Jan 11 |
nicklas |
397 |
</tr> |
5548 |
24 Jan 11 |
nicklas |
398 |
<tr> |
5928 |
17 Jan 12 |
nicklas |
399 |
<th>Name prefix</th> |
6217 |
14 Dec 12 |
nicklas |
400 |
<td><input class="text required" type="text" name="plate_name_prefix" |
5548 |
24 Jan 11 |
nicklas |
401 |
value="New plate." |
5928 |
17 Jan 12 |
nicklas |
402 |
maxlength="<%=BioPlate.MAX_NAME_LENGTH%>"></td> |
5548 |
24 Jan 11 |
nicklas |
403 |
</tr> |
5561 |
02 Feb 11 |
nicklas |
404 |
<tr id="geometryDiv"> |
5928 |
17 Jan 12 |
nicklas |
405 |
<th>Geometry</th> |
5548 |
24 Jan 11 |
nicklas |
406 |
<td> |
5548 |
24 Jan 11 |
nicklas |
407 |
<base:select |
5548 |
24 Jan 11 |
nicklas |
408 |
id="plategeometry_id" |
5548 |
24 Jan 11 |
nicklas |
409 |
clazz="selectionlist" |
5548 |
24 Jan 11 |
nicklas |
410 |
required="true" |
5548 |
24 Jan 11 |
nicklas |
411 |
current="<%=sourceGeometry%>" |
5548 |
24 Jan 11 |
nicklas |
412 |
recent="<%=recentGeometry%>" |
5548 |
24 Jan 11 |
nicklas |
413 |
newitem="true" |
5548 |
24 Jan 11 |
nicklas |
414 |
/> |
5548 |
24 Jan 11 |
nicklas |
415 |
</td> |
5548 |
24 Jan 11 |
nicklas |
416 |
</tr> |
5642 |
26 May 11 |
nicklas |
417 |
<tr id="sizeDiv" style="display: none;"> |
5928 |
17 Jan 12 |
nicklas |
418 |
<th>Size of bioassay</th> |
6397 |
24 Jan 14 |
nicklas |
419 |
<td><input class="text required" type="text" name="size" id="size" style="width: 15em;" |
5561 |
02 Feb 11 |
nicklas |
420 |
value="<%=sourceGeometry.getRows() %>" |
6397 |
24 Jan 14 |
nicklas |
421 |
maxlength="10"></td> |
5561 |
02 Feb 11 |
nicklas |
422 |
</tr> |
5559 |
31 Jan 11 |
nicklas |
423 |
<tr id="plateTypeDiv"> |
5928 |
17 Jan 12 |
nicklas |
424 |
<th>Plate type</th> |
5548 |
24 Jan 11 |
nicklas |
425 |
<td> |
5548 |
24 Jan 11 |
nicklas |
426 |
<base:select |
5548 |
24 Jan 11 |
nicklas |
427 |
id="bioplatetype_id" |
5548 |
24 Jan 11 |
nicklas |
428 |
clazz="selectionlist" |
5548 |
24 Jan 11 |
nicklas |
429 |
required="true" |
5548 |
24 Jan 11 |
nicklas |
430 |
current="<%=null%>" |
5548 |
24 Jan 11 |
nicklas |
431 |
recent="<%=recentPlateTypes%>" |
5548 |
24 Jan 11 |
nicklas |
432 |
newitem="true" |
5548 |
24 Jan 11 |
nicklas |
433 |
/> |
5548 |
24 Jan 11 |
nicklas |
434 |
</td> |
5548 |
24 Jan 11 |
nicklas |
435 |
</tr> |
5559 |
31 Jan 11 |
nicklas |
436 |
<tr id="freezerDiv"> |
6056 |
12 Jun 12 |
nicklas |
437 |
<th>Storage location</th> |
5548 |
24 Jan 11 |
nicklas |
438 |
<td> |
5548 |
24 Jan 11 |
nicklas |
439 |
<base:select |
5548 |
24 Jan 11 |
nicklas |
440 |
id="freezer_id" |
5548 |
24 Jan 11 |
nicklas |
441 |
clazz="selectionlist" |
5548 |
24 Jan 11 |
nicklas |
442 |
required="false" |
5548 |
24 Jan 11 |
nicklas |
443 |
current="<%=sourceFreezer%>" |
5548 |
24 Jan 11 |
nicklas |
444 |
recent="<%=recentFreezers%>" |
5548 |
24 Jan 11 |
nicklas |
445 |
newitem="true" |
5548 |
24 Jan 11 |
nicklas |
446 |
/> |
5548 |
24 Jan 11 |
nicklas |
447 |
</td> |
5548 |
24 Jan 11 |
nicklas |
448 |
</tr> |
5928 |
17 Jan 12 |
nicklas |
449 |
</tbody> |
5928 |
17 Jan 12 |
nicklas |
450 |
<tr class="dynamic"> |
5928 |
17 Jan 12 |
nicklas |
451 |
<th></th> |
5928 |
17 Jan 12 |
nicklas |
452 |
<td colspan="2"></td> |
5928 |
17 Jan 12 |
nicklas |
453 |
</tr> |
5928 |
17 Jan 12 |
nicklas |
454 |
</table> |
5548 |
24 Jan 11 |
nicklas |
455 |
</div> |
5548 |
24 Jan 11 |
nicklas |
456 |
</form> |
5548 |
24 Jan 11 |
nicklas |
457 |
|
5928 |
17 Jan 12 |
nicklas |
458 |
<base:buttongroup subclass="dialogbuttons"> |
6397 |
24 Jan 14 |
nicklas |
459 |
<base:button id="btnNext" title="Next" /> |
6397 |
24 Jan 14 |
nicklas |
460 |
<base:button id="close" title="Cancel" /> |
5928 |
17 Jan 12 |
nicklas |
461 |
</base:buttongroup> |
5548 |
24 Jan 11 |
nicklas |
462 |
|
5548 |
24 Jan 11 |
nicklas |
463 |
</base:body> |
5548 |
24 Jan 11 |
nicklas |
464 |
</base:page> |
5548 |
24 Jan 11 |
nicklas |
465 |
<% |
5548 |
24 Jan 11 |
nicklas |
466 |
} |
5548 |
24 Jan 11 |
nicklas |
467 |
finally |
5548 |
24 Jan 11 |
nicklas |
468 |
{ |
5548 |
24 Jan 11 |
nicklas |
469 |
if (dc != null) dc.close(); |
5548 |
24 Jan 11 |
nicklas |
470 |
} |
5548 |
24 Jan 11 |
nicklas |
471 |
%> |