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