951 |
18 Jul 05 |
nicklas |
1 |
<%-- $Id$ |
951 |
18 Jul 05 |
nicklas |
2 |
------------------------------------------------------------------ |
3675 |
16 Aug 07 |
jari |
Copyright (C) 2005 Nicklas Nordborg |
4889 |
06 Apr 09 |
nicklas |
Copyright (C) 2006 Johan Enell, Jari Häkkinen, Nicklas Nordborg, Martin Svensson |
951 |
18 Jul 05 |
nicklas |
5 |
|
2304 |
22 May 06 |
jari |
6 |
This file is part of BASE - BioArray Software Environment. |
2304 |
22 May 06 |
jari |
7 |
Available at http://base.thep.lu.se/ |
951 |
18 Jul 05 |
nicklas |
8 |
|
951 |
18 Jul 05 |
nicklas |
9 |
BASE is free software; you can redistribute it and/or |
951 |
18 Jul 05 |
nicklas |
10 |
modify it under the terms of the GNU General Public License |
4476 |
05 Sep 08 |
jari |
11 |
as published by the Free Software Foundation; either version 3 |
951 |
18 Jul 05 |
nicklas |
12 |
of the License, or (at your option) any later version. |
951 |
18 Jul 05 |
nicklas |
13 |
|
951 |
18 Jul 05 |
nicklas |
14 |
BASE is distributed in the hope that it will be useful, |
951 |
18 Jul 05 |
nicklas |
15 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
951 |
18 Jul 05 |
nicklas |
16 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
951 |
18 Jul 05 |
nicklas |
17 |
GNU General Public License for more details. |
951 |
18 Jul 05 |
nicklas |
18 |
|
951 |
18 Jul 05 |
nicklas |
19 |
You should have received a copy of the GNU General Public License |
4510 |
11 Sep 08 |
jari |
20 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
951 |
18 Jul 05 |
nicklas |
21 |
------------------------------------------------------------------ |
951 |
18 Jul 05 |
nicklas |
22 |
|
951 |
18 Jul 05 |
nicklas |
23 |
|
951 |
18 Jul 05 |
nicklas |
24 |
@author Nicklas |
951 |
18 Jul 05 |
nicklas |
25 |
@version 2.0 |
951 |
18 Jul 05 |
nicklas |
26 |
--%> |
5426 |
24 Sep 10 |
nicklas |
27 |
<%@ page pageEncoding="UTF-8" session="false" |
951 |
18 Jul 05 |
nicklas |
28 |
import="net.sf.basedb.core.SessionControl" |
951 |
18 Jul 05 |
nicklas |
29 |
import="net.sf.basedb.core.DbControl" |
951 |
18 Jul 05 |
nicklas |
30 |
import="net.sf.basedb.core.Item" |
5664 |
23 Jun 11 |
nicklas |
31 |
import="net.sf.basedb.core.Type" |
1872 |
31 Jan 06 |
nicklas |
32 |
import="net.sf.basedb.core.ItemContext" |
951 |
18 Jul 05 |
nicklas |
33 |
import="net.sf.basedb.core.SystemItems" |
951 |
18 Jul 05 |
nicklas |
34 |
import="net.sf.basedb.core.Permission" |
1872 |
31 Jan 06 |
nicklas |
35 |
import="net.sf.basedb.core.Sample" |
951 |
18 Jul 05 |
nicklas |
36 |
import="net.sf.basedb.core.Extract" |
5648 |
30 May 11 |
nicklas |
37 |
import="net.sf.basedb.core.ItemSubtype" |
5648 |
30 May 11 |
nicklas |
38 |
import="net.sf.basedb.core.Tag" |
951 |
18 Jul 05 |
nicklas |
39 |
import="net.sf.basedb.core.BioMaterialEvent" |
4730 |
15 Jan 09 |
martin |
40 |
import="net.sf.basedb.core.BioPlate" |
4730 |
15 Jan 09 |
martin |
41 |
import="net.sf.basedb.core.BioWell" |
6992 |
03 Nov 15 |
nicklas |
42 |
import="net.sf.basedb.core.Kit" |
951 |
18 Jul 05 |
nicklas |
43 |
import="net.sf.basedb.core.Protocol" |
2949 |
24 Nov 06 |
martin |
44 |
import="net.sf.basedb.core.Project" |
1872 |
31 Jan 06 |
nicklas |
45 |
import="net.sf.basedb.core.PermissionDeniedException" |
1872 |
31 Jan 06 |
nicklas |
46 |
import="net.sf.basedb.core.BaseException" |
1418 |
07 Oct 05 |
nicklas |
47 |
import="net.sf.basedb.core.ItemQuery" |
1872 |
31 Jan 06 |
nicklas |
48 |
import="net.sf.basedb.core.ItemResultList" |
1872 |
31 Jan 06 |
nicklas |
49 |
import="net.sf.basedb.core.Include" |
951 |
18 Jul 05 |
nicklas |
50 |
import="net.sf.basedb.core.query.Orders" |
1418 |
07 Oct 05 |
nicklas |
51 |
import="net.sf.basedb.core.query.Hql" |
5664 |
23 Jun 11 |
nicklas |
52 |
import="net.sf.basedb.core.query.Expressions" |
5664 |
23 Jun 11 |
nicklas |
53 |
import="net.sf.basedb.core.query.Restrictions" |
951 |
18 Jul 05 |
nicklas |
54 |
import="net.sf.basedb.clients.web.Base" |
951 |
18 Jul 05 |
nicklas |
55 |
import="net.sf.basedb.clients.web.util.HTML" |
2753 |
20 Oct 06 |
nicklas |
56 |
import="net.sf.basedb.util.Values" |
5687 |
09 Aug 11 |
nicklas |
57 |
import="net.sf.basedb.util.ListUtil" |
2942 |
22 Nov 06 |
nicklas |
58 |
import="net.sf.basedb.util.formatter.Formatter" |
4869 |
31 Mar 09 |
martin |
59 |
import="net.sf.basedb.util.formatter.WellCoordinateFormatter" |
2942 |
22 Nov 06 |
nicklas |
60 |
import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
4869 |
31 Mar 09 |
martin |
61 |
import="net.sf.basedb.clients.web.formatter.FormatterSettings" |
5492 |
16 Nov 10 |
nicklas |
62 |
import="net.sf.basedb.core.plugin.GuiContext" |
5492 |
16 Nov 10 |
nicklas |
63 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
5492 |
16 Nov 10 |
nicklas |
64 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
5492 |
16 Nov 10 |
nicklas |
65 |
import="net.sf.basedb.clients.web.extensions.edit.EditUtil" |
7604 |
25 Feb 19 |
nicklas |
66 |
import="net.sf.basedb.clients.web.extensions.tabcontrol.TabAction" |
5492 |
16 Nov 10 |
nicklas |
67 |
import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
6312 |
28 Aug 13 |
nicklas |
68 |
import="net.sf.basedb.util.json.JsonUtil" |
6312 |
28 Aug 13 |
nicklas |
69 |
import="net.sf.basedb.util.json.JsonConverter" |
6312 |
28 Aug 13 |
nicklas |
70 |
import="net.sf.basedb.util.json.NameableConverter" |
6312 |
28 Aug 13 |
nicklas |
71 |
import="org.json.simple.JSONObject" |
6312 |
28 Aug 13 |
nicklas |
72 |
import="org.json.simple.JSONArray" |
1872 |
31 Jan 06 |
nicklas |
73 |
import="java.util.List" |
1872 |
31 Jan 06 |
nicklas |
74 |
import="java.util.Set" |
1872 |
31 Jan 06 |
nicklas |
75 |
import="java.util.HashSet" |
1872 |
31 Jan 06 |
nicklas |
76 |
import="java.util.Date" |
5687 |
09 Aug 11 |
nicklas |
77 |
import="java.util.Collections" |
951 |
18 Jul 05 |
nicklas |
78 |
%> |
951 |
18 Jul 05 |
nicklas |
79 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
951 |
18 Jul 05 |
nicklas |
80 |
<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
6145 |
21 Sep 12 |
nicklas |
81 |
<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
951 |
18 Jul 05 |
nicklas |
82 |
<% |
951 |
18 Jul 05 |
nicklas |
83 |
final Item itemType = Item.EXTRACT; |
1872 |
31 Jan 06 |
nicklas |
84 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
1872 |
31 Jan 06 |
nicklas |
85 |
final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
1872 |
31 Jan 06 |
nicklas |
86 |
final int itemId = cc.getId(); |
951 |
18 Jul 05 |
nicklas |
87 |
final String ID = sc.getId(); |
951 |
18 Jul 05 |
nicklas |
88 |
final float scale = Base.getScale(sc); |
7954 |
12 May 21 |
nicklas |
89 |
final DbControl dc = sc.newDbControl(":Edit "+itemType); |
951 |
18 Jul 05 |
nicklas |
90 |
try |
951 |
18 Jul 05 |
nicklas |
91 |
{ |
951 |
18 Jul 05 |
nicklas |
92 |
String title = null; |
951 |
18 Jul 05 |
nicklas |
93 |
Extract extract = null; |
1872 |
31 Jan 06 |
nicklas |
94 |
BioMaterialEvent creationEvent = null; |
2942 |
22 Nov 06 |
nicklas |
95 |
Date eventDate = null; |
5664 |
23 Jun 11 |
nicklas |
96 |
Item parentType = null; |
5383 |
10 Aug 10 |
nicklas |
97 |
boolean lockEventProperties = false; |
4869 |
31 Mar 09 |
martin |
98 |
|
4869 |
31 Mar 09 |
martin |
99 |
WellCoordinateFormatter rowFormatter = new WellCoordinateFormatter(true); |
4869 |
31 Mar 09 |
martin |
100 |
WellCoordinateFormatter columnFormatter = new WellCoordinateFormatter(false); |
1872 |
31 Jan 06 |
nicklas |
101 |
|
5648 |
30 May 11 |
nicklas |
102 |
boolean readCurrentSubtype = true; |
5687 |
09 Aug 11 |
nicklas |
103 |
ItemSubtype currentSubtype = null; |
1872 |
31 Jan 06 |
nicklas |
104 |
boolean readCurrentProtocol = true; |
1872 |
31 Jan 06 |
nicklas |
105 |
Protocol currentProtocol = null; |
6992 |
03 Nov 15 |
nicklas |
106 |
boolean readCurrentKit = true; |
6992 |
03 Nov 15 |
nicklas |
107 |
Kit currentKit = null; |
5648 |
30 May 11 |
nicklas |
108 |
boolean readCurrentTag = true; |
5648 |
30 May 11 |
nicklas |
109 |
Tag currentTag = null; |
1872 |
31 Jan 06 |
nicklas |
110 |
boolean readCurrentSample = true; |
1872 |
31 Jan 06 |
nicklas |
111 |
Sample currentSample = null; |
1872 |
31 Jan 06 |
nicklas |
112 |
Float usedFromSample = null; |
2421 |
22 Jun 06 |
martin |
113 |
String name = null; |
1872 |
31 Jan 06 |
nicklas |
114 |
ItemQuery<Extract> extractsQuery = null; |
4730 |
15 Jan 09 |
martin |
115 |
boolean readCurrentBioWell = true; |
4730 |
15 Jan 09 |
martin |
116 |
BioWell currentBioWell = null; |
5262 |
08 Mar 10 |
nicklas |
117 |
boolean lockedWell = false; |
4730 |
15 Jan 09 |
martin |
118 |
boolean readCurrentBioPlate = true; |
4730 |
15 Jan 09 |
martin |
119 |
BioPlate currentBioPlate = null; |
1872 |
31 Jan 06 |
nicklas |
120 |
|
1872 |
31 Jan 06 |
nicklas |
121 |
if (itemId == 0) |
951 |
18 Jul 05 |
nicklas |
122 |
{ |
951 |
18 Jul 05 |
nicklas |
123 |
title = "Create extract"; |
1872 |
31 Jan 06 |
nicklas |
124 |
cc.removeObject("item"); |
1872 |
31 Jan 06 |
nicklas |
125 |
if (cc.getPropertyFilter("creationEvent.protocol.name") != null) |
1872 |
31 Jan 06 |
nicklas |
126 |
{ |
1872 |
31 Jan 06 |
nicklas |
127 |
currentProtocol = Base.getFirstMatching(dc, Protocol.getQuery(), "name", cc.getPropertyFilter("creationEvent.protocol.name")); |
1872 |
31 Jan 06 |
nicklas |
128 |
} |
6992 |
03 Nov 15 |
nicklas |
129 |
if (cc.getPropertyFilter("creationEvent.kit.name") != null) |
6992 |
03 Nov 15 |
nicklas |
130 |
{ |
6992 |
03 Nov 15 |
nicklas |
131 |
currentKit = Base.getFirstMatching(dc, Kit.getQuery(), "name", cc.getPropertyFilter("creationEvent.kit.name")); |
6992 |
03 Nov 15 |
nicklas |
132 |
} |
5648 |
30 May 11 |
nicklas |
133 |
if (cc.getPropertyFilter("tag.name") != null) |
5648 |
30 May 11 |
nicklas |
134 |
{ |
5648 |
30 May 11 |
nicklas |
135 |
currentTag = Base.getFirstMatching(dc, Tag.getQuery(), "name", cc.getPropertyFilter("tag.name")); |
5648 |
30 May 11 |
nicklas |
136 |
} |
5687 |
09 Aug 11 |
nicklas |
137 |
int currentSubtypeId = Values.getInt(request.getParameter("subtype_id")); |
5687 |
09 Aug 11 |
nicklas |
138 |
List<ItemSubtype> relatedToParent = Collections.emptyList(); |
2421 |
22 Jun 06 |
martin |
139 |
int sampleId = Values.getInt(request.getParameter("sample_id")); |
5664 |
23 Jun 11 |
nicklas |
140 |
int extractId = Values.getInt(request.getParameter("extract_id")); |
5687 |
09 Aug 11 |
nicklas |
141 |
|
2421 |
22 Jun 06 |
martin |
142 |
if (sampleId != 0) |
2421 |
22 Jun 06 |
martin |
143 |
{ |
2421 |
22 Jun 06 |
martin |
144 |
currentSample = Sample.getById(dc, sampleId); |
5664 |
23 Jun 11 |
nicklas |
145 |
parentType = Item.SAMPLE; |
2421 |
22 Jun 06 |
martin |
146 |
name = currentSample.getName() + ".e" + (currentSample.countExtracts() + 1); |
5687 |
09 Aug 11 |
nicklas |
147 |
if (currentSubtypeId == 0) |
5687 |
09 Aug 11 |
nicklas |
148 |
{ |
5687 |
09 Aug 11 |
nicklas |
149 |
relatedToParent = ItemSubtype.getParentSubtypes(dc, currentSample, Item.EXTRACT); |
5687 |
09 Aug 11 |
nicklas |
150 |
} |
2421 |
22 Jun 06 |
martin |
151 |
} |
5664 |
23 Jun 11 |
nicklas |
152 |
else if (extractId != 0) |
2472 |
31 Jul 06 |
martin |
153 |
{ |
5664 |
23 Jun 11 |
nicklas |
154 |
parentType = Item.EXTRACT; |
5664 |
23 Jun 11 |
nicklas |
155 |
Extract e = Extract.getById(dc, extractId); |
5664 |
23 Jun 11 |
nicklas |
156 |
name = e.getName() + ".e" + (e.countExtracts()+1); |
5664 |
23 Jun 11 |
nicklas |
157 |
extractsQuery = Extract.getQuery(); |
5664 |
23 Jun 11 |
nicklas |
158 |
extractsQuery.restrict(Restrictions.eq(Hql.property("id"), Expressions.integer(extractId))); |
5687 |
09 Aug 11 |
nicklas |
159 |
if (currentSubtypeId == 0) |
5687 |
09 Aug 11 |
nicklas |
160 |
{ |
5687 |
09 Aug 11 |
nicklas |
161 |
relatedToParent = ItemSubtype.getParentSubtypes(dc, e, Item.EXTRACT); |
5687 |
09 Aug 11 |
nicklas |
162 |
} |
5664 |
23 Jun 11 |
nicklas |
163 |
} |
5664 |
23 Jun 11 |
nicklas |
164 |
else if (Values.getBoolean(request.getParameter("pooled"))) |
5664 |
23 Jun 11 |
nicklas |
165 |
{ |
5664 |
23 Jun 11 |
nicklas |
166 |
parentType = Item.EXTRACT; |
2472 |
31 Jul 06 |
martin |
167 |
name = Values.getString(cc.getPropertyValue("name"), "New pooled extract"); |
5664 |
23 Jun 11 |
nicklas |
168 |
extractsQuery = Extract.getQuery(); |
5664 |
23 Jun 11 |
nicklas |
169 |
extractsQuery.restrict(Restrictions.in(Hql.property("id"), Expressions.parameter("selected"))); |
5664 |
23 Jun 11 |
nicklas |
170 |
extractsQuery.setParameter("selected", cc.getSelected(), Type.INT); |
2472 |
31 Jul 06 |
martin |
171 |
} |
2421 |
22 Jun 06 |
martin |
172 |
else |
2421 |
22 Jun 06 |
martin |
173 |
{ |
2421 |
22 Jun 06 |
martin |
174 |
name = Values.getString(cc.getPropertyValue("name"), "New extract"); |
2421 |
22 Jun 06 |
martin |
175 |
} |
5687 |
09 Aug 11 |
nicklas |
176 |
if (currentSubtypeId == 0) |
5687 |
09 Aug 11 |
nicklas |
177 |
{ |
5687 |
09 Aug 11 |
nicklas |
178 |
if (relatedToParent.size() > 0) |
5687 |
09 Aug 11 |
nicklas |
179 |
{ |
5687 |
09 Aug 11 |
nicklas |
180 |
// Find most recently used related subtype |
7605 |
26 Feb 19 |
nicklas |
181 |
List<ItemSubtype> recentSubtypes = cc.getRecent(dc, Item.ITEMSUBTYPE); |
5687 |
09 Aug 11 |
nicklas |
182 |
currentSubtype = ListUtil.findFirstCommon(recentSubtypes, relatedToParent, relatedToParent.get(0)); |
5687 |
09 Aug 11 |
nicklas |
183 |
} |
5687 |
09 Aug 11 |
nicklas |
184 |
else |
5687 |
09 Aug 11 |
nicklas |
185 |
{ |
5687 |
09 Aug 11 |
nicklas |
186 |
int recentSubtypeId = Values.getInt(cc.getRecent(Item.ITEMSUBTYPE.name(), 0)); |
5687 |
09 Aug 11 |
nicklas |
187 |
currentSubtypeId = Values.getInt(cc.getPropertyValue("itemSubtype"), recentSubtypeId); |
5687 |
09 Aug 11 |
nicklas |
188 |
if (currentSubtypeId > 0) currentSubtype = ItemSubtype.getById(dc, currentSubtypeId); |
5687 |
09 Aug 11 |
nicklas |
189 |
} |
5687 |
09 Aug 11 |
nicklas |
190 |
} |
7605 |
26 Feb 19 |
nicklas |
191 |
eventDate = cc.getPropertyObject("creationEvent.eventDate"); |
951 |
18 Jul 05 |
nicklas |
192 |
} |
951 |
18 Jul 05 |
nicklas |
193 |
else |
951 |
18 Jul 05 |
nicklas |
194 |
{ |
1872 |
31 Jan 06 |
nicklas |
195 |
extract = Extract.getById(dc, itemId); |
5648 |
30 May 11 |
nicklas |
196 |
extract.checkPermission(Permission.WRITE); |
5665 |
23 Jun 11 |
nicklas |
197 |
parentType = extract.getParentType(); |
1872 |
31 Jan 06 |
nicklas |
198 |
cc.setObject("item", extract); |
951 |
18 Jul 05 |
nicklas |
199 |
title = "Edit extract -- " + HTML.encodeTags(extract.getName()); |
951 |
18 Jul 05 |
nicklas |
200 |
|
1872 |
31 Jan 06 |
nicklas |
201 |
creationEvent = extract.getCreationEvent(); |
2942 |
22 Nov 06 |
nicklas |
202 |
eventDate = creationEvent.getEventDate(); |
2421 |
22 Jun 06 |
martin |
203 |
name = extract.getName(); |
5383 |
10 Aug 10 |
nicklas |
204 |
lockEventProperties = !creationEvent.hasPermission(Permission.WRITE); |
1872 |
31 Jan 06 |
nicklas |
205 |
|
1872 |
31 Jan 06 |
nicklas |
206 |
try |
1872 |
31 Jan 06 |
nicklas |
207 |
{ |
5687 |
09 Aug 11 |
nicklas |
208 |
currentSubtype = extract.getItemSubtype(); |
5648 |
30 May 11 |
nicklas |
209 |
} |
5648 |
30 May 11 |
nicklas |
210 |
catch (PermissionDeniedException ex) |
5648 |
30 May 11 |
nicklas |
211 |
{ |
5648 |
30 May 11 |
nicklas |
212 |
readCurrentSubtype = false; |
5648 |
30 May 11 |
nicklas |
213 |
} |
5648 |
30 May 11 |
nicklas |
214 |
|
5648 |
30 May 11 |
nicklas |
215 |
try |
5648 |
30 May 11 |
nicklas |
216 |
{ |
1872 |
31 Jan 06 |
nicklas |
217 |
currentProtocol = creationEvent.getProtocol(); |
1872 |
31 Jan 06 |
nicklas |
218 |
} |
1872 |
31 Jan 06 |
nicklas |
219 |
catch (PermissionDeniedException ex) |
1872 |
31 Jan 06 |
nicklas |
220 |
{ |
1872 |
31 Jan 06 |
nicklas |
221 |
readCurrentProtocol = false; |
1872 |
31 Jan 06 |
nicklas |
222 |
} |
6992 |
03 Nov 15 |
nicklas |
223 |
|
6992 |
03 Nov 15 |
nicklas |
224 |
try |
6992 |
03 Nov 15 |
nicklas |
225 |
{ |
6992 |
03 Nov 15 |
nicklas |
226 |
currentKit = creationEvent.getKit(); |
6992 |
03 Nov 15 |
nicklas |
227 |
} |
6992 |
03 Nov 15 |
nicklas |
228 |
catch (PermissionDeniedException ex) |
6992 |
03 Nov 15 |
nicklas |
229 |
{ |
6992 |
03 Nov 15 |
nicklas |
230 |
readCurrentKit = false; |
6992 |
03 Nov 15 |
nicklas |
231 |
} |
951 |
18 Jul 05 |
nicklas |
232 |
|
1872 |
31 Jan 06 |
nicklas |
233 |
try |
1872 |
31 Jan 06 |
nicklas |
234 |
{ |
5648 |
30 May 11 |
nicklas |
235 |
currentTag = extract.getTag(); |
5648 |
30 May 11 |
nicklas |
236 |
} |
5648 |
30 May 11 |
nicklas |
237 |
catch (PermissionDeniedException ex) |
5648 |
30 May 11 |
nicklas |
238 |
{ |
5648 |
30 May 11 |
nicklas |
239 |
readCurrentTag = false; |
5648 |
30 May 11 |
nicklas |
240 |
} |
5648 |
30 May 11 |
nicklas |
241 |
|
5648 |
30 May 11 |
nicklas |
242 |
try |
5648 |
30 May 11 |
nicklas |
243 |
{ |
5664 |
23 Jun 11 |
nicklas |
244 |
if (parentType == Item.SAMPLE) |
5664 |
23 Jun 11 |
nicklas |
245 |
{ |
5664 |
23 Jun 11 |
nicklas |
246 |
currentSample = (Sample)extract.getParent(); |
5664 |
23 Jun 11 |
nicklas |
247 |
if (currentSample != null) |
5664 |
23 Jun 11 |
nicklas |
248 |
{ |
5664 |
23 Jun 11 |
nicklas |
249 |
usedFromSample = creationEvent.getUsedQuantity(currentSample); |
5664 |
23 Jun 11 |
nicklas |
250 |
} |
5664 |
23 Jun 11 |
nicklas |
251 |
} |
1872 |
31 Jan 06 |
nicklas |
252 |
} |
1872 |
31 Jan 06 |
nicklas |
253 |
catch (PermissionDeniedException ex) |
1872 |
31 Jan 06 |
nicklas |
254 |
{ |
1872 |
31 Jan 06 |
nicklas |
255 |
readCurrentSample = false; |
1872 |
31 Jan 06 |
nicklas |
256 |
} |
4730 |
15 Jan 09 |
martin |
257 |
try |
4730 |
15 Jan 09 |
martin |
258 |
{ |
4730 |
15 Jan 09 |
martin |
259 |
currentBioWell = extract.getBioWell(); |
5459 |
29 Oct 10 |
nicklas |
260 |
lockedWell = extract.isLockedInWell(); |
5262 |
08 Mar 10 |
nicklas |
261 |
if (currentBioWell != null) |
5262 |
08 Mar 10 |
nicklas |
262 |
{ |
5262 |
08 Mar 10 |
nicklas |
263 |
currentBioPlate = currentBioWell.getPlate(); |
5262 |
08 Mar 10 |
nicklas |
264 |
} |
4730 |
15 Jan 09 |
martin |
265 |
} |
4730 |
15 Jan 09 |
martin |
266 |
catch (PermissionDeniedException ex) |
4730 |
15 Jan 09 |
martin |
267 |
{ |
4730 |
15 Jan 09 |
martin |
268 |
readCurrentBioWell = false; |
4730 |
15 Jan 09 |
martin |
269 |
readCurrentBioPlate = false; |
4730 |
15 Jan 09 |
martin |
270 |
} |
1872 |
31 Jan 06 |
nicklas |
271 |
|
1872 |
31 Jan 06 |
nicklas |
272 |
// Query to retrieve pooled extracts |
5664 |
23 Jun 11 |
nicklas |
273 |
if (parentType == Item.EXTRACT) |
5664 |
23 Jun 11 |
nicklas |
274 |
{ |
7605 |
26 Feb 19 |
nicklas |
275 |
extractsQuery = creationEvent.getSources(); |
5664 |
23 Jun 11 |
nicklas |
276 |
} |
951 |
18 Jul 05 |
nicklas |
277 |
} |
5648 |
30 May 11 |
nicklas |
278 |
|
5687 |
09 Aug 11 |
nicklas |
279 |
// Default items |
5687 |
09 Aug 11 |
nicklas |
280 |
int activeProjectId = sc.getActiveProjectId(); |
5687 |
09 Aug 11 |
nicklas |
281 |
List<Protocol> defaultProtocols = null; |
5687 |
09 Aug 11 |
nicklas |
282 |
if (activeProjectId > 0) |
5687 |
09 Aug 11 |
nicklas |
283 |
{ |
5687 |
09 Aug 11 |
nicklas |
284 |
Project activeProject = Project.getById(dc, activeProjectId); |
5687 |
09 Aug 11 |
nicklas |
285 |
ItemSubtype protocolSubtype = currentSubtype == null ? null : currentSubtype.getRelatedSubtype(Item.PROTOCOL); |
5687 |
09 Aug 11 |
nicklas |
286 |
if (protocolSubtype == null) protocolSubtype = ItemSubtype.getById(dc, SystemItems.getId(Protocol.EXTRACTION)); |
7605 |
26 Feb 19 |
nicklas |
287 |
defaultProtocols = activeProject.findDefaultItems(dc, protocolSubtype, false); |
5687 |
09 Aug 11 |
nicklas |
288 |
} |
5687 |
09 Aug 11 |
nicklas |
289 |
|
5687 |
09 Aug 11 |
nicklas |
290 |
// Load recently used items |
7605 |
26 Feb 19 |
nicklas |
291 |
List<Kit> recentKits = cc.getRecent(dc, Item.KIT, currentSubtype); |
7605 |
26 Feb 19 |
nicklas |
292 |
List<Protocol> recentProtocols = cc.getRecent(dc, Item.PROTOCOL, currentSubtype); |
7605 |
26 Feb 19 |
nicklas |
293 |
List<Sample> recentSamples = cc.getRecent(dc, Item.SAMPLE); |
7605 |
26 Feb 19 |
nicklas |
294 |
List<BioPlate> recentBioPlates = cc.getRecent(dc, Item.BIOPLATE, currentSubtype); |
7605 |
26 Feb 19 |
nicklas |
295 |
List<Tag> recentTags = cc.getRecent(dc, Item.TAG, currentSubtype); |
5687 |
09 Aug 11 |
nicklas |
296 |
|
5648 |
30 May 11 |
nicklas |
297 |
// Query to retrieve item types |
5648 |
30 May 11 |
nicklas |
298 |
final ItemQuery<ItemSubtype> subtypesQuery = Base.getSubtypesQuery(itemType); |
5648 |
30 May 11 |
nicklas |
299 |
subtypesQuery.include(Include.ALL); |
5648 |
30 May 11 |
nicklas |
300 |
|
6312 |
28 Aug 13 |
nicklas |
301 |
JSONObject jsonBioWell = null; |
6312 |
28 Aug 13 |
nicklas |
302 |
if (currentBioWell != null) |
6312 |
28 Aug 13 |
nicklas |
303 |
{ |
6312 |
28 Aug 13 |
nicklas |
304 |
jsonBioWell = new JSONObject(); |
6312 |
28 Aug 13 |
nicklas |
305 |
jsonBioWell.put("id", currentBioWell.getId()); |
6312 |
28 Aug 13 |
nicklas |
306 |
jsonBioWell.put("location", currentBioWell.getCoordinate()); |
6312 |
28 Aug 13 |
nicklas |
307 |
} |
6312 |
28 Aug 13 |
nicklas |
308 |
|
6312 |
28 Aug 13 |
nicklas |
309 |
JSONObject jsonExtracts = new JSONObject(); |
6413 |
05 Feb 14 |
nicklas |
310 |
jsonExtracts.put("itemType", "EXTRACT"); |
6312 |
28 Aug 13 |
nicklas |
311 |
if (extractsQuery != null) |
6312 |
28 Aug 13 |
nicklas |
312 |
{ |
7096 |
07 Mar 16 |
nicklas |
313 |
extractsQuery.setIncludes(Include.ALL); |
7096 |
07 Mar 16 |
nicklas |
314 |
extractsQuery.order(Orders.asc(Hql.property("name"))); |
6312 |
28 Aug 13 |
nicklas |
315 |
final BioMaterialEvent event = creationEvent; |
6312 |
28 Aug 13 |
nicklas |
316 |
jsonExtracts.put("items", JsonUtil.toArray(extractsQuery.iterate(dc), new NameableConverter<Extract>() |
6312 |
28 Aug 13 |
nicklas |
317 |
{ |
6312 |
28 Aug 13 |
nicklas |
318 |
protected void setMore(JSONObject json, Extract e) |
6312 |
28 Aug 13 |
nicklas |
319 |
{ |
6312 |
28 Aug 13 |
nicklas |
320 |
Float usedQuantity = event == null ? null : event.getUsedQuantity(e); |
6312 |
28 Aug 13 |
nicklas |
321 |
json.put("name", e.getName() + (usedQuantity == null ? " [-]" : " [" + usedQuantity + " µg]")); |
6312 |
28 Aug 13 |
nicklas |
322 |
json.put("value", usedQuantity); |
6312 |
28 Aug 13 |
nicklas |
323 |
} |
6312 |
28 Aug 13 |
nicklas |
324 |
})); |
6312 |
28 Aug 13 |
nicklas |
325 |
} |
6217 |
14 Dec 12 |
nicklas |
326 |
|
2942 |
22 Nov 06 |
nicklas |
327 |
Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); |
2942 |
22 Nov 06 |
nicklas |
328 |
String dateFormat = FormatterSettings.getDateFormat(sc); |
2942 |
22 Nov 06 |
nicklas |
329 |
String jsDateFormat = HTML.javaScriptEncode(dateFormat); |
2942 |
22 Nov 06 |
nicklas |
330 |
String htmlDateFormat = HTML.encodeTags(dateFormat); |
5492 |
16 Nov 10 |
nicklas |
331 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(itemType), extract); |
7604 |
25 Feb 19 |
nicklas |
332 |
ExtensionsInvoker<TabAction> invoker = EditUtil.useEditExtensions(jspContext); |
951 |
18 Jul 05 |
nicklas |
333 |
%> |
6312 |
28 Aug 13 |
nicklas |
334 |
<base:page type="popup" title="<%=title%>" id="edit-page"> |
6312 |
28 Aug 13 |
nicklas |
335 |
<base:head scripts="tabcontrol-2.js,linkitems-2.js,subtypes.js,~extracts.js" styles="tabcontrol.css"> |
5492 |
16 Nov 10 |
nicklas |
336 |
<ext:scripts context="<%=jspContext%>" /> |
5492 |
16 Nov 10 |
nicklas |
337 |
<ext:stylesheets context="<%=jspContext%>" /> |
6312 |
28 Aug 13 |
nicklas |
338 |
</base:head> |
6312 |
28 Aug 13 |
nicklas |
339 |
<base:body> |
6312 |
28 Aug 13 |
nicklas |
340 |
<h1><%=title%> <base:help tabcontrol="settings" /></h1> |
6312 |
28 Aug 13 |
nicklas |
341 |
<form action="index.jsp?ID=<%=ID%>" method="post" name="extract"> |
6312 |
28 Aug 13 |
nicklas |
342 |
<input type="hidden" name="cmd" value="UpdateItem"> |
951 |
18 Jul 05 |
nicklas |
343 |
|
6312 |
28 Aug 13 |
nicklas |
344 |
<div id="page-data" class="datacontainer" |
6312 |
28 Aug 13 |
nicklas |
345 |
data-extraction-protocoltype-id="<%=SystemItems.getId(Protocol.EXTRACTION)%>" |
6992 |
03 Nov 15 |
nicklas |
346 |
data-extraction-kittype-id="<%=SystemItems.getId(Kit.EXTRACTION) %>" |
6413 |
05 Feb 14 |
nicklas |
347 |
data-extract-type="<%=Item.EXTRACT.getValue()%>" |
4730 |
15 Jan 09 |
martin |
348 |
<% |
6312 |
28 Aug 13 |
nicklas |
349 |
if (jsonBioWell != null) |
4730 |
15 Jan 09 |
martin |
350 |
{ |
4730 |
15 Jan 09 |
martin |
351 |
%> |
6312 |
28 Aug 13 |
nicklas |
352 |
data-biowell="<%=HTML.encodeTags(jsonBioWell.toJSONString()) %>" |
951 |
18 Jul 05 |
nicklas |
353 |
<% |
951 |
18 Jul 05 |
nicklas |
354 |
} |
951 |
18 Jul 05 |
nicklas |
355 |
%> |
6312 |
28 Aug 13 |
nicklas |
356 |
></div> |
1872 |
31 Jan 06 |
nicklas |
357 |
|
5913 |
15 Dec 11 |
nicklas |
358 |
<t:tabcontrol id="settings" |
5913 |
15 Dec 11 |
nicklas |
359 |
subclass="content dialogtabcontrol" |
6312 |
28 Aug 13 |
nicklas |
360 |
position="bottom" remember="<%=extract != null%>" |
5492 |
16 Nov 10 |
nicklas |
361 |
extensions="<%=invoker%>"> |
6312 |
28 Aug 13 |
nicklas |
362 |
<t:tab id="info" title="Extract" helpid="extract.edit"> |
5913 |
15 Dec 11 |
nicklas |
363 |
<table class="fullform input100"> |
951 |
18 Jul 05 |
nicklas |
364 |
<tr> |
5913 |
15 Dec 11 |
nicklas |
365 |
<th>Name</th> |
6312 |
28 Aug 13 |
nicklas |
366 |
<td><input class="text required auto-init" |
6312 |
28 Aug 13 |
nicklas |
367 |
data-auto-init="<%=extract == null ? "focus-select" : "focus" %>" type="text" name="name" |
2421 |
22 Jun 06 |
martin |
368 |
value="<%=HTML.encodeTags(name)%>" |
5913 |
15 Dec 11 |
nicklas |
369 |
maxlength="<%=Extract.MAX_NAME_LENGTH%>"></td> |
5913 |
15 Dec 11 |
nicklas |
370 |
<td></td> |
951 |
18 Jul 05 |
nicklas |
371 |
</tr> |
5905 |
12 Dec 11 |
nicklas |
372 |
<tr > |
5913 |
15 Dec 11 |
nicklas |
373 |
<th>Type</th> |
5913 |
15 Dec 11 |
nicklas |
374 |
<td> |
6297 |
14 Jun 13 |
nicklas |
375 |
<select name="subtype_id" id="subtype_id" |
6312 |
28 Aug 13 |
nicklas |
376 |
<%=!readCurrentSubtype ? "disabled readonly class=\"disabled selectionlist\"" : "class=\"selectionlist\""%>> |
5648 |
30 May 11 |
nicklas |
377 |
<% |
5648 |
30 May 11 |
nicklas |
378 |
if (!readCurrentSubtype) |
5648 |
30 May 11 |
nicklas |
379 |
{ |
5648 |
30 May 11 |
nicklas |
380 |
%> |
5648 |
30 May 11 |
nicklas |
381 |
<option value="-1">- denied - |
5648 |
30 May 11 |
nicklas |
382 |
<% |
5648 |
30 May 11 |
nicklas |
383 |
} |
5648 |
30 May 11 |
nicklas |
384 |
else |
5648 |
30 May 11 |
nicklas |
385 |
{ |
5648 |
30 May 11 |
nicklas |
386 |
%> |
5648 |
30 May 11 |
nicklas |
387 |
<option value="0">-none- |
5648 |
30 May 11 |
nicklas |
388 |
<% |
5687 |
09 Aug 11 |
nicklas |
389 |
int currentSubtypeId = currentSubtype == null ? 0 : currentSubtype.getId(); |
5648 |
30 May 11 |
nicklas |
390 |
for (ItemSubtype subtype : subtypesQuery.list(dc)) |
5648 |
30 May 11 |
nicklas |
391 |
{ |
5648 |
30 May 11 |
nicklas |
392 |
int id = subtype.getId(); |
5648 |
30 May 11 |
nicklas |
393 |
if (id != currentSubtypeId && subtype.isRemoved()) continue; |
5648 |
30 May 11 |
nicklas |
394 |
%> |
5648 |
30 May 11 |
nicklas |
395 |
<option value="<%=id == currentSubtypeId && extract != null ? -id : id%>" |
5648 |
30 May 11 |
nicklas |
396 |
<%=id == currentSubtypeId ? "selected" : ""%> |
5648 |
30 May 11 |
nicklas |
397 |
title="<%=HTML.encodeTags(subtype.getDescription()) %>" |
5648 |
30 May 11 |
nicklas |
398 |
><%=HTML.encodeTags(subtype.getName())%> |
5648 |
30 May 11 |
nicklas |
399 |
<% |
5648 |
30 May 11 |
nicklas |
400 |
} |
5648 |
30 May 11 |
nicklas |
401 |
} |
5648 |
30 May 11 |
nicklas |
402 |
%> |
5648 |
30 May 11 |
nicklas |
403 |
</select> |
5648 |
30 May 11 |
nicklas |
404 |
</td> |
5913 |
15 Dec 11 |
nicklas |
405 |
<td></td> |
5648 |
30 May 11 |
nicklas |
406 |
</tr> |
951 |
18 Jul 05 |
nicklas |
407 |
<tr> |
5913 |
15 Dec 11 |
nicklas |
408 |
<th>Tag</th> |
5648 |
30 May 11 |
nicklas |
409 |
<td> |
5648 |
30 May 11 |
nicklas |
410 |
<base:select |
5648 |
30 May 11 |
nicklas |
411 |
id="tag_id" |
5648 |
30 May 11 |
nicklas |
412 |
clazz="selectionlist" |
5648 |
30 May 11 |
nicklas |
413 |
required="false" |
5648 |
30 May 11 |
nicklas |
414 |
current="<%=currentTag%>" |
5648 |
30 May 11 |
nicklas |
415 |
denied="<%=!readCurrentTag%>" |
5648 |
30 May 11 |
nicklas |
416 |
recent="<%=recentTags%>" |
5648 |
30 May 11 |
nicklas |
417 |
newitem="<%=extract == null%>" |
5648 |
30 May 11 |
nicklas |
418 |
/> |
5648 |
30 May 11 |
nicklas |
419 |
</td> |
5913 |
15 Dec 11 |
nicklas |
420 |
<td></td> |
5648 |
30 May 11 |
nicklas |
421 |
</tr> |
5648 |
30 May 11 |
nicklas |
422 |
<tr> |
5913 |
15 Dec 11 |
nicklas |
423 |
<th>External ID</th> |
6217 |
14 Dec 12 |
nicklas |
424 |
<td><input class="text" type="text" name="external_id" |
1872 |
31 Jan 06 |
nicklas |
425 |
value="<%=HTML.encodeTags(extract == null ? Values.getString(cc.getPropertyValue("externalId"), "") : extract.getExternalId())%>" |
5913 |
15 Dec 11 |
nicklas |
426 |
maxlength="<%=Extract.MAX_EXTERNAL_ID_LENGTH%>"></td> |
5913 |
15 Dec 11 |
nicklas |
427 |
<td></td> |
951 |
18 Jul 05 |
nicklas |
428 |
</tr> |
951 |
18 Jul 05 |
nicklas |
429 |
<tr> |
5913 |
15 Dec 11 |
nicklas |
430 |
<th>Original quantity</th> |
6312 |
28 Aug 13 |
nicklas |
431 |
<td><input class="text" type="text" name="original_quantity" id="original_quantity" style="width: 15em;" |
5913 |
15 Dec 11 |
nicklas |
432 |
value="<%=Values.formatNumber(extract == null ? Values.getFloat(cc.getPropertyValue("originalQuantity"), null): extract.getOriginalQuantity(), -1)%>" |
6312 |
28 Aug 13 |
nicklas |
433 |
maxlength="10"> (µg)</td> |
5913 |
15 Dec 11 |
nicklas |
434 |
<td></td> |
951 |
18 Jul 05 |
nicklas |
435 |
</tr> |
951 |
18 Jul 05 |
nicklas |
436 |
<tr> |
5913 |
15 Dec 11 |
nicklas |
437 |
<th>Created</th> |
951 |
18 Jul 05 |
nicklas |
438 |
<td> |
5913 |
15 Dec 11 |
nicklas |
439 |
<table> |
951 |
18 Jul 05 |
nicklas |
440 |
<tr> |
951 |
18 Jul 05 |
nicklas |
441 |
<td> |
6217 |
14 Dec 12 |
nicklas |
442 |
<input class="text" style="width: 15em;" type="text" name="event_date" id="event_date" |
6216 |
14 Dec 12 |
nicklas |
443 |
<%=lockEventProperties ? "disabled" : ""%> |
4232 |
17 Apr 08 |
nicklas |
444 |
value="<%=HTML.encodeTags(dateFormatter.format(eventDate))%>" |
5913 |
15 Dec 11 |
nicklas |
445 |
maxlength="20" title="Enter date in format: <%=htmlDateFormat%>"> |
951 |
18 Jul 05 |
nicklas |
446 |
</td> |
951 |
18 Jul 05 |
nicklas |
447 |
<td> |
6216 |
14 Dec 12 |
nicklas |
448 |
<base:calendar textarea="event_date" title="Created" |
6216 |
14 Dec 12 |
nicklas |
449 |
disabled="<%=lockEventProperties%>" |
6216 |
14 Dec 12 |
nicklas |
450 |
/> |
951 |
18 Jul 05 |
nicklas |
451 |
</td> |
951 |
18 Jul 05 |
nicklas |
452 |
</tr> |
951 |
18 Jul 05 |
nicklas |
453 |
</table> |
951 |
18 Jul 05 |
nicklas |
454 |
</td> |
5913 |
15 Dec 11 |
nicklas |
455 |
<td></td> |
951 |
18 Jul 05 |
nicklas |
456 |
</tr> |
951 |
18 Jul 05 |
nicklas |
457 |
<tr> |
5913 |
15 Dec 11 |
nicklas |
458 |
<th>Registered</th> |
2942 |
22 Nov 06 |
nicklas |
459 |
<td><%=dateFormatter.format(creationEvent == null ? new Date() : creationEvent.getEntryDate())%></td> |
5913 |
15 Dec 11 |
nicklas |
460 |
<td></td> |
951 |
18 Jul 05 |
nicklas |
461 |
</tr> |
951 |
18 Jul 05 |
nicklas |
462 |
<tr> |
5913 |
15 Dec 11 |
nicklas |
463 |
<th>Protocol</th> |
951 |
18 Jul 05 |
nicklas |
464 |
<td> |
2597 |
25 Aug 06 |
nicklas |
465 |
<base:select |
2597 |
25 Aug 06 |
nicklas |
466 |
id="protocol_id" |
2597 |
25 Aug 06 |
nicklas |
467 |
clazz="selectionlist" |
2597 |
25 Aug 06 |
nicklas |
468 |
required="false" |
2597 |
25 Aug 06 |
nicklas |
469 |
current="<%=currentProtocol%>" |
2597 |
25 Aug 06 |
nicklas |
470 |
denied="<%=!readCurrentProtocol%>" |
2597 |
25 Aug 06 |
nicklas |
471 |
recent="<%=recentProtocols%>" |
5687 |
09 Aug 11 |
nicklas |
472 |
defaultitems="<%=defaultProtocols%>" |
2597 |
25 Aug 06 |
nicklas |
473 |
newitem="<%=extract == null%>" |
5383 |
10 Aug 10 |
nicklas |
474 |
disabled="<%=lockEventProperties%>" |
2597 |
25 Aug 06 |
nicklas |
475 |
/> |
951 |
18 Jul 05 |
nicklas |
476 |
</td> |
5913 |
15 Dec 11 |
nicklas |
477 |
<td></td> |
951 |
18 Jul 05 |
nicklas |
478 |
</tr> |
4730 |
15 Jan 09 |
martin |
479 |
<tr> |
6992 |
03 Nov 15 |
nicklas |
480 |
<th>Kit</th> |
6992 |
03 Nov 15 |
nicklas |
481 |
<td> |
6992 |
03 Nov 15 |
nicklas |
482 |
<base:select |
6992 |
03 Nov 15 |
nicklas |
483 |
id="kit_id" |
6992 |
03 Nov 15 |
nicklas |
484 |
clazz="selectionlist" |
6992 |
03 Nov 15 |
nicklas |
485 |
required="false" |
6992 |
03 Nov 15 |
nicklas |
486 |
current="<%=currentKit%>" |
6992 |
03 Nov 15 |
nicklas |
487 |
denied="<%=!readCurrentKit%>" |
6992 |
03 Nov 15 |
nicklas |
488 |
recent="<%=recentKits%>" |
6992 |
03 Nov 15 |
nicklas |
489 |
newitem="<%=extract == null%>" |
6992 |
03 Nov 15 |
nicklas |
490 |
disabled="<%=lockEventProperties%>" |
6992 |
03 Nov 15 |
nicklas |
491 |
/> |
6992 |
03 Nov 15 |
nicklas |
492 |
</td> |
6992 |
03 Nov 15 |
nicklas |
493 |
<td></td> |
6992 |
03 Nov 15 |
nicklas |
494 |
</tr> |
6992 |
03 Nov 15 |
nicklas |
495 |
<tr> |
5913 |
15 Dec 11 |
nicklas |
496 |
<th>Bioplate</th> |
4730 |
15 Jan 09 |
martin |
497 |
<td> |
4730 |
15 Jan 09 |
martin |
498 |
<base:select |
4730 |
15 Jan 09 |
martin |
499 |
id="bioplate_id" |
4730 |
15 Jan 09 |
martin |
500 |
clazz="selectionlist" |
4730 |
15 Jan 09 |
martin |
501 |
required="false" |
4730 |
15 Jan 09 |
martin |
502 |
current="<%=currentBioPlate%>" |
4730 |
15 Jan 09 |
martin |
503 |
denied="<%=!readCurrentBioPlate%>" |
4730 |
15 Jan 09 |
martin |
504 |
recent="<%=recentBioPlates%>" |
4730 |
15 Jan 09 |
martin |
505 |
newitem="<%=extract == null%>" |
5262 |
08 Mar 10 |
nicklas |
506 |
disabled="<%=lockedWell%>" |
4730 |
15 Jan 09 |
martin |
507 |
/> |
4730 |
15 Jan 09 |
martin |
508 |
</td> |
5913 |
15 Dec 11 |
nicklas |
509 |
<td></td> |
4730 |
15 Jan 09 |
martin |
510 |
</tr> |
4730 |
15 Jan 09 |
martin |
511 |
<tr> |
5913 |
15 Dec 11 |
nicklas |
512 |
<th class="subprompt">- well</th> |
4730 |
15 Jan 09 |
martin |
513 |
<td> |
4730 |
15 Jan 09 |
martin |
514 |
<base:select |
4730 |
15 Jan 09 |
martin |
515 |
id="biowell_id" |
4730 |
15 Jan 09 |
martin |
516 |
clazz="selectionlist" |
4730 |
15 Jan 09 |
martin |
517 |
required="false" |
4730 |
15 Jan 09 |
martin |
518 |
current="<%=null %>" |
4730 |
15 Jan 09 |
martin |
519 |
denied="<%=!readCurrentBioWell%>" |
4730 |
15 Jan 09 |
martin |
520 |
newitem="<%=extract == null%>" |
5262 |
08 Mar 10 |
nicklas |
521 |
disabled="<%=lockedWell%>" |
4730 |
15 Jan 09 |
martin |
522 |
/> |
4730 |
15 Jan 09 |
martin |
523 |
</td> |
5913 |
15 Dec 11 |
nicklas |
524 |
<td></td> |
4730 |
15 Jan 09 |
martin |
525 |
</tr> |
5913 |
15 Dec 11 |
nicklas |
526 |
<tr class="dynamic"> |
5913 |
15 Dec 11 |
nicklas |
527 |
<th>Description</th> |
5913 |
15 Dec 11 |
nicklas |
528 |
<td> |
6217 |
14 Dec 12 |
nicklas |
529 |
<textarea class="text" rows="6" name="description" id="description" |
1872 |
31 Jan 06 |
nicklas |
530 |
><%=HTML.encodeTags(extract == null ? cc.getPropertyValue("description") : extract.getDescription())%></textarea> |
951 |
18 Jul 05 |
nicklas |
531 |
</td> |
5913 |
15 Dec 11 |
nicklas |
532 |
<td style="width: 20px;"> |
6215 |
13 Dec 12 |
nicklas |
533 |
<base:zoom textarea="description" title="Description" /> |
5913 |
15 Dec 11 |
nicklas |
534 |
</td> |
951 |
18 Jul 05 |
nicklas |
535 |
</tr> |
951 |
18 Jul 05 |
nicklas |
536 |
</table> |
951 |
18 Jul 05 |
nicklas |
537 |
</t:tab> |
951 |
18 Jul 05 |
nicklas |
538 |
|
5799 |
12 Oct 11 |
nicklas |
539 |
<t:tab id="parents" title="Parents" helpid="extract.parents"> |
5913 |
15 Dec 11 |
nicklas |
540 |
<table class="fullform input100"> |
951 |
18 Jul 05 |
nicklas |
541 |
<tr> |
5913 |
15 Dec 11 |
nicklas |
542 |
<th>Parent type</th> |
951 |
18 Jul 05 |
nicklas |
543 |
<td> |
5664 |
23 Jun 11 |
nicklas |
544 |
<input type="radio" name="parentType" id="parentType.sample" |
6312 |
28 Aug 13 |
nicklas |
545 |
value="SAMPLE" <%=parentType != Item.EXTRACT ? "checked" : ""%> |
5664 |
23 Jun 11 |
nicklas |
546 |
><label for="parentType.sample">Sample</label> |
5664 |
23 Jun 11 |
nicklas |
547 |
<input type="radio" name="parentType" id="parentType.extract" |
6312 |
28 Aug 13 |
nicklas |
548 |
value="EXTRACT" <%=parentType == Item.EXTRACT ? "checked" : ""%> |
5664 |
23 Jun 11 |
nicklas |
549 |
><label for="parentType.extract">Extract</label> |
951 |
18 Jul 05 |
nicklas |
550 |
</td> |
951 |
18 Jul 05 |
nicklas |
551 |
</tr> |
5913 |
15 Dec 11 |
nicklas |
552 |
<tr> |
5913 |
15 Dec 11 |
nicklas |
553 |
<th>Sample</th> |
951 |
18 Jul 05 |
nicklas |
554 |
<td> |
2597 |
25 Aug 06 |
nicklas |
555 |
<base:select |
2597 |
25 Aug 06 |
nicklas |
556 |
id="sample_id" |
2597 |
25 Aug 06 |
nicklas |
557 |
clazz="selectionlist" |
6605 |
18 Nov 14 |
nicklas |
558 |
buttonstyle="width: 14em;" |
5664 |
23 Jun 11 |
nicklas |
559 |
buttonicon="add.png" |
5665 |
23 Jun 11 |
nicklas |
560 |
buttontitle="Select sample…" |
6605 |
18 Nov 14 |
nicklas |
561 |
buttonclass="leftaligned basicbutton button" |
2597 |
25 Aug 06 |
nicklas |
562 |
required="false" |
2597 |
25 Aug 06 |
nicklas |
563 |
current="<%=currentSample%>" |
2597 |
25 Aug 06 |
nicklas |
564 |
denied="<%=!readCurrentSample%>" |
2597 |
25 Aug 06 |
nicklas |
565 |
recent="<%=recentSamples%>" |
2597 |
25 Aug 06 |
nicklas |
566 |
selectrecent="false" |
2597 |
25 Aug 06 |
nicklas |
567 |
newitem="<%=extract == null%>" |
2597 |
25 Aug 06 |
nicklas |
568 |
/> |
5664 |
23 Jun 11 |
nicklas |
569 |
</td> |
5664 |
23 Jun 11 |
nicklas |
570 |
</tr> |
5664 |
23 Jun 11 |
nicklas |
571 |
<tr> |
6145 |
21 Sep 12 |
nicklas |
572 |
<th class="subprompt">used quantity</th> |
5664 |
23 Jun 11 |
nicklas |
573 |
<td> |
6312 |
28 Aug 13 |
nicklas |
574 |
<input class="text" style="width: 15em;" type="text" name="used_from_sample" |
6312 |
28 Aug 13 |
nicklas |
575 |
id="used_from_sample" |
5913 |
15 Dec 11 |
nicklas |
576 |
value="<%=Values.formatNumber(usedFromSample, -1)%>" |
6312 |
28 Aug 13 |
nicklas |
577 |
maxlength="10"> (µg) |
951 |
18 Jul 05 |
nicklas |
578 |
</td> |
951 |
18 Jul 05 |
nicklas |
579 |
</tr> |
5913 |
15 Dec 11 |
nicklas |
580 |
<tr class="big"> |
6145 |
21 Sep 12 |
nicklas |
581 |
<th>Extracts</th> |
951 |
18 Jul 05 |
nicklas |
582 |
<td> |
5913 |
15 Dec 11 |
nicklas |
583 |
<div class="selectionlist"> |
5913 |
15 Dec 11 |
nicklas |
584 |
<table> |
5913 |
15 Dec 11 |
nicklas |
585 |
<tr> |
951 |
18 Jul 05 |
nicklas |
586 |
<td> |
6312 |
28 Aug 13 |
nicklas |
587 |
<select name="extracts" id="extracts" |
6312 |
28 Aug 13 |
nicklas |
588 |
class="auto-init" |
6312 |
28 Aug 13 |
nicklas |
589 |
data-auto-init="link-container" |
6312 |
28 Aug 13 |
nicklas |
590 |
data-initial-items="[<%=HTML.encodeTags(jsonExtracts.toJSONString()) %>]" |
6312 |
28 Aug 13 |
nicklas |
591 |
data-initial-action="<%=extract == null ? 1 : 0 %>" |
6312 |
28 Aug 13 |
nicklas |
592 |
size="15" multiple> |
5913 |
15 Dec 11 |
nicklas |
593 |
</select> |
5913 |
15 Dec 11 |
nicklas |
594 |
</td> |
5913 |
15 Dec 11 |
nicklas |
595 |
<td> |
5913 |
15 Dec 11 |
nicklas |
596 |
<td style="vertical-align: top;"> |
5913 |
15 Dec 11 |
nicklas |
597 |
<base:buttongroup vertical="true"> |
5913 |
15 Dec 11 |
nicklas |
598 |
<base:button |
6312 |
28 Aug 13 |
nicklas |
599 |
id="btnAddExtracts" |
5913 |
15 Dec 11 |
nicklas |
600 |
subclass="leftaligned" |
6605 |
18 Nov 14 |
nicklas |
601 |
style="width: 14em;" |
5913 |
15 Dec 11 |
nicklas |
602 |
title="Add extracts…" |
5913 |
15 Dec 11 |
nicklas |
603 |
tooltip="Add extracts" |
5913 |
15 Dec 11 |
nicklas |
604 |
/> |
5913 |
15 Dec 11 |
nicklas |
605 |
<base:button |
6312 |
28 Aug 13 |
nicklas |
606 |
subclass="leftaligned auto-init" |
6312 |
28 Aug 13 |
nicklas |
607 |
data-auto-init="remove-link" |
6312 |
28 Aug 13 |
nicklas |
608 |
data-list-id="extracts" |
6605 |
18 Nov 14 |
nicklas |
609 |
style="width: 14em;" |
5913 |
15 Dec 11 |
nicklas |
610 |
title="Remove" |
5913 |
15 Dec 11 |
nicklas |
611 |
tooltip="Remove the selected extracts" |
5913 |
15 Dec 11 |
nicklas |
612 |
/> |
5913 |
15 Dec 11 |
nicklas |
613 |
</base:buttongroup> |
951 |
18 Jul 05 |
nicklas |
614 |
</td> |
951 |
18 Jul 05 |
nicklas |
615 |
</tr> |
951 |
18 Jul 05 |
nicklas |
616 |
</table> |
5913 |
15 Dec 11 |
nicklas |
617 |
</div> |
951 |
18 Jul 05 |
nicklas |
618 |
</td> |
951 |
18 Jul 05 |
nicklas |
619 |
</tr> |
5664 |
23 Jun 11 |
nicklas |
620 |
<tr> |
5913 |
15 Dec 11 |
nicklas |
621 |
<th class="subprompt">used quantity</th> |
5913 |
15 Dec 11 |
nicklas |
622 |
<td> |
6217 |
14 Dec 12 |
nicklas |
623 |
<input class="text" style="width: 15em;" type="text" name="used_quantity" |
6312 |
28 Aug 13 |
nicklas |
624 |
id="used_quantity" value="" maxlength="10" > (µg) |
5664 |
23 Jun 11 |
nicklas |
625 |
</td> |
5664 |
23 Jun 11 |
nicklas |
626 |
</tr> |
5913 |
15 Dec 11 |
nicklas |
627 |
<tr class="dynamic"> |
5913 |
15 Dec 11 |
nicklas |
628 |
<th></th> |
5913 |
15 Dec 11 |
nicklas |
629 |
<td></td> |
5913 |
15 Dec 11 |
nicklas |
630 |
</tr> |
951 |
18 Jul 05 |
nicklas |
631 |
</table> |
951 |
18 Jul 05 |
nicklas |
632 |
</t:tab> |
951 |
18 Jul 05 |
nicklas |
633 |
|
6312 |
28 Aug 13 |
nicklas |
634 |
<t:tab id="annotations" title="Annotations & parameters" helpid="annotations.edit"> |
6254 |
22 Mar 13 |
nicklas |
635 |
<jsp:include page="../../common/annotations/annotate_frameset.jsp"> |
6254 |
22 Mar 13 |
nicklas |
636 |
<jsp:param name="item_type" value="<%=itemType.name()%>" /> |
6254 |
22 Mar 13 |
nicklas |
637 |
<jsp:param name="item_id" value="<%=itemId%>" /> |
6254 |
22 Mar 13 |
nicklas |
638 |
<jsp:param name="ID" value="<%=ID%>" /> |
6254 |
22 Mar 13 |
nicklas |
639 |
</jsp:include> |
6254 |
22 Mar 13 |
nicklas |
640 |
</t:tab> |
951 |
18 Jul 05 |
nicklas |
641 |
|
951 |
18 Jul 05 |
nicklas |
642 |
</t:tabcontrol> |
5913 |
15 Dec 11 |
nicklas |
643 |
</form> |
951 |
18 Jul 05 |
nicklas |
644 |
|
5913 |
15 Dec 11 |
nicklas |
645 |
<div class="legend"> |
5946 |
03 Feb 12 |
nicklas |
646 |
<base:icon image="required.png" />= required information |
5913 |
15 Dec 11 |
nicklas |
647 |
</div> |
5913 |
15 Dec 11 |
nicklas |
648 |
|
5913 |
15 Dec 11 |
nicklas |
649 |
<base:buttongroup subclass="dialogbuttons"> |
6312 |
28 Aug 13 |
nicklas |
650 |
<base:button id="btnSave" title="Save" /> |
6312 |
28 Aug 13 |
nicklas |
651 |
<base:button id="close" title="Cancel" /> |
5913 |
15 Dec 11 |
nicklas |
652 |
</base:buttongroup> |
951 |
18 Jul 05 |
nicklas |
653 |
</base:body> |
951 |
18 Jul 05 |
nicklas |
654 |
</base:page> |
951 |
18 Jul 05 |
nicklas |
655 |
<% |
951 |
18 Jul 05 |
nicklas |
656 |
} |
951 |
18 Jul 05 |
nicklas |
657 |
finally |
951 |
18 Jul 05 |
nicklas |
658 |
{ |
951 |
18 Jul 05 |
nicklas |
659 |
if (dc != null) dc.close(); |
951 |
18 Jul 05 |
nicklas |
660 |
} |
951 |
18 Jul 05 |
nicklas |
661 |
%> |