5525 |
06 Dec 10 |
nicklas |
1 |
<%-- $Id$ |
5525 |
06 Dec 10 |
nicklas |
2 |
------------------------------------------------------------------ |
5525 |
06 Dec 10 |
nicklas |
Copyright (C) 2010 Nicklas Nordborg |
5525 |
06 Dec 10 |
nicklas |
4 |
|
5525 |
06 Dec 10 |
nicklas |
5 |
This file is part of BASE - BioArray Software Environment. |
5525 |
06 Dec 10 |
nicklas |
6 |
Available at http://base.thep.lu.se/ |
5525 |
06 Dec 10 |
nicklas |
7 |
|
5525 |
06 Dec 10 |
nicklas |
8 |
BASE is free software; you can redistribute it and/or |
5525 |
06 Dec 10 |
nicklas |
9 |
modify it under the terms of the GNU General Public License |
5525 |
06 Dec 10 |
nicklas |
10 |
as published by the Free Software Foundation; either version 3 |
5525 |
06 Dec 10 |
nicklas |
11 |
of the License, or (at your option) any later version. |
5525 |
06 Dec 10 |
nicklas |
12 |
|
5525 |
06 Dec 10 |
nicklas |
13 |
BASE is distributed in the hope that it will be useful, |
5525 |
06 Dec 10 |
nicklas |
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
5525 |
06 Dec 10 |
nicklas |
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5525 |
06 Dec 10 |
nicklas |
16 |
GNU General Public License for more details. |
5525 |
06 Dec 10 |
nicklas |
17 |
|
5525 |
06 Dec 10 |
nicklas |
18 |
You should have received a copy of the GNU General Public License |
5525 |
06 Dec 10 |
nicklas |
19 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
5525 |
06 Dec 10 |
nicklas |
20 |
------------------------------------------------------------------ |
5525 |
06 Dec 10 |
nicklas |
21 |
|
5525 |
06 Dec 10 |
nicklas |
22 |
@author Nicklas |
5525 |
06 Dec 10 |
nicklas |
23 |
--%> |
5525 |
06 Dec 10 |
nicklas |
24 |
<%@ page pageEncoding="UTF-8" session="false" |
5525 |
06 Dec 10 |
nicklas |
25 |
import="net.sf.basedb.core.SessionControl" |
5525 |
06 Dec 10 |
nicklas |
26 |
import="net.sf.basedb.core.DbControl" |
5525 |
06 Dec 10 |
nicklas |
27 |
import="net.sf.basedb.core.SystemItems" |
5525 |
06 Dec 10 |
nicklas |
28 |
import="net.sf.basedb.core.Item" |
5525 |
06 Dec 10 |
nicklas |
29 |
import="net.sf.basedb.core.ItemContext" |
5525 |
06 Dec 10 |
nicklas |
30 |
import="net.sf.basedb.core.Permission" |
5525 |
06 Dec 10 |
nicklas |
31 |
import="net.sf.basedb.core.CommonItem" |
5525 |
06 Dec 10 |
nicklas |
32 |
import="net.sf.basedb.core.BioPlate" |
5525 |
06 Dec 10 |
nicklas |
33 |
import="net.sf.basedb.core.BioPlateEvent" |
5525 |
06 Dec 10 |
nicklas |
34 |
import="net.sf.basedb.core.BioPlateEventParticipant" |
5525 |
06 Dec 10 |
nicklas |
35 |
import="net.sf.basedb.core.BioMaterialEvent" |
5525 |
06 Dec 10 |
nicklas |
36 |
import="net.sf.basedb.core.MeasuredBioMaterial" |
5642 |
26 May 11 |
nicklas |
37 |
import="net.sf.basedb.core.PhysicalBioAssay" |
5525 |
06 Dec 10 |
nicklas |
38 |
import="net.sf.basedb.core.Protocol" |
5525 |
06 Dec 10 |
nicklas |
39 |
import="net.sf.basedb.core.Hardware" |
5525 |
06 Dec 10 |
nicklas |
40 |
import="net.sf.basedb.core.PermissionDeniedException" |
5525 |
06 Dec 10 |
nicklas |
41 |
import="net.sf.basedb.core.ItemQuery" |
5525 |
06 Dec 10 |
nicklas |
42 |
import="net.sf.basedb.core.ItemResultList" |
5525 |
06 Dec 10 |
nicklas |
43 |
import="net.sf.basedb.core.Include" |
5525 |
06 Dec 10 |
nicklas |
44 |
import="net.sf.basedb.core.PluginDefinition" |
5525 |
06 Dec 10 |
nicklas |
45 |
import="net.sf.basedb.core.query.Orders" |
5525 |
06 Dec 10 |
nicklas |
46 |
import="net.sf.basedb.core.query.Hql" |
5525 |
06 Dec 10 |
nicklas |
47 |
import="net.sf.basedb.core.plugin.GuiContext" |
5525 |
06 Dec 10 |
nicklas |
48 |
import="net.sf.basedb.core.plugin.Plugin" |
5525 |
06 Dec 10 |
nicklas |
49 |
import="net.sf.basedb.clients.web.Base" |
5525 |
06 Dec 10 |
nicklas |
50 |
import="net.sf.basedb.clients.web.PermissionUtil" |
5525 |
06 Dec 10 |
nicklas |
51 |
import="net.sf.basedb.clients.web.util.HTML" |
5525 |
06 Dec 10 |
nicklas |
52 |
import="net.sf.basedb.util.Values" |
5525 |
06 Dec 10 |
nicklas |
53 |
import="net.sf.basedb.util.formatter.Formatter" |
5525 |
06 Dec 10 |
nicklas |
54 |
import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
5525 |
06 Dec 10 |
nicklas |
55 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
5525 |
06 Dec 10 |
nicklas |
56 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
5525 |
06 Dec 10 |
nicklas |
57 |
import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer" |
7604 |
25 Feb 19 |
nicklas |
58 |
import="net.sf.basedb.clients.web.extensions.toolbar.ButtonAction" |
5525 |
06 Dec 10 |
nicklas |
59 |
import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil" |
5525 |
06 Dec 10 |
nicklas |
60 |
import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
5525 |
06 Dec 10 |
nicklas |
61 |
import="java.util.Date" |
5525 |
06 Dec 10 |
nicklas |
62 |
import="java.util.Map" |
5525 |
06 Dec 10 |
nicklas |
63 |
import="java.util.Set" |
5525 |
06 Dec 10 |
nicklas |
64 |
%> |
5525 |
06 Dec 10 |
nicklas |
65 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
5525 |
06 Dec 10 |
nicklas |
66 |
<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
5525 |
06 Dec 10 |
nicklas |
67 |
<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
5525 |
06 Dec 10 |
nicklas |
68 |
<%@ taglib prefix="p" uri="/WEB-INF/path.tld" %> |
5525 |
06 Dec 10 |
nicklas |
69 |
<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
5525 |
06 Dec 10 |
nicklas |
70 |
<%! |
5525 |
06 Dec 10 |
nicklas |
71 |
private static final Item itemType = Item.BIOPLATEEVENT; |
5525 |
06 Dec 10 |
nicklas |
72 |
private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.ITEM); |
5525 |
06 Dec 10 |
nicklas |
73 |
%> |
5525 |
06 Dec 10 |
nicklas |
74 |
<% |
5525 |
06 Dec 10 |
nicklas |
75 |
int bioPlateId = Values.getInt(request.getParameter("bioplate_id")); |
5525 |
06 Dec 10 |
nicklas |
76 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
5525 |
06 Dec 10 |
nicklas |
77 |
final String ID = sc.getId(); |
5525 |
06 Dec 10 |
nicklas |
78 |
final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
5525 |
06 Dec 10 |
nicklas |
79 |
final int itemId = cc.getId(); |
6261 |
27 Mar 13 |
nicklas |
80 |
final String tab = Values.getStringOrNull(request.getParameter("tab")); |
5525 |
06 Dec 10 |
nicklas |
81 |
final float scale = Base.getScale(sc); |
7954 |
12 May 21 |
nicklas |
82 |
final DbControl dc = sc.newDbControl(":View "+itemType); |
5525 |
06 Dec 10 |
nicklas |
83 |
try |
5525 |
06 Dec 10 |
nicklas |
84 |
{ |
5525 |
06 Dec 10 |
nicklas |
85 |
Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); |
5525 |
06 Dec 10 |
nicklas |
86 |
Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); |
5525 |
06 Dec 10 |
nicklas |
87 |
|
5525 |
06 Dec 10 |
nicklas |
88 |
String title = null; |
5525 |
06 Dec 10 |
nicklas |
89 |
BioPlateEvent event = BioPlateEvent.getById(dc, itemId); |
5525 |
06 Dec 10 |
nicklas |
90 |
|
5525 |
06 Dec 10 |
nicklas |
91 |
// Load bioplates participating in this event |
5525 |
06 Dec 10 |
nicklas |
92 |
ItemQuery<BioPlateEventParticipant> participantQuery = event.getParticipants(); |
5525 |
06 Dec 10 |
nicklas |
93 |
participantQuery.join(Hql.innerJoin(null, "bioPlate", "bpl", true)); |
5525 |
06 Dec 10 |
nicklas |
94 |
participantQuery.include(Include.ALL); |
5525 |
06 Dec 10 |
nicklas |
95 |
participantQuery.order(Orders.asc(Hql.property("role"))); |
5525 |
06 Dec 10 |
nicklas |
96 |
participantQuery.order(Orders.asc(Hql.property("index"))); |
5525 |
06 Dec 10 |
nicklas |
97 |
participantQuery.order(Orders.asc(Hql.property("bpl", "name"))); |
5525 |
06 Dec 10 |
nicklas |
98 |
ItemResultList<BioPlateEventParticipant> participants = participantQuery.list(dc); |
5525 |
06 Dec 10 |
nicklas |
99 |
|
5525 |
06 Dec 10 |
nicklas |
100 |
if (bioPlateId == 0) |
5525 |
06 Dec 10 |
nicklas |
101 |
{ |
5525 |
06 Dec 10 |
nicklas |
102 |
for (BioPlateEventParticipant participant : participants) |
5525 |
06 Dec 10 |
nicklas |
103 |
{ |
5525 |
06 Dec 10 |
nicklas |
104 |
try |
5525 |
06 Dec 10 |
nicklas |
105 |
{ |
5525 |
06 Dec 10 |
nicklas |
106 |
bioPlateId = participant.getBioPlate().getId(); |
5525 |
06 Dec 10 |
nicklas |
107 |
break; |
5525 |
06 Dec 10 |
nicklas |
108 |
} |
5525 |
06 Dec 10 |
nicklas |
109 |
catch (RuntimeException ex) |
5525 |
06 Dec 10 |
nicklas |
110 |
{} |
5525 |
06 Dec 10 |
nicklas |
111 |
} |
5525 |
06 Dec 10 |
nicklas |
112 |
} |
5525 |
06 Dec 10 |
nicklas |
113 |
BioPlate bioPlate = bioPlateId == 0 ? null : BioPlate.getById(dc, bioPlateId); |
5525 |
06 Dec 10 |
nicklas |
114 |
|
5525 |
06 Dec 10 |
nicklas |
115 |
final boolean usePermission = event.hasPermission(Permission.USE); |
5525 |
06 Dec 10 |
nicklas |
116 |
final boolean writePermission = event.hasPermission(Permission.WRITE); |
5525 |
06 Dec 10 |
nicklas |
117 |
final boolean deletePermission = event.hasPermission(Permission.DELETE); |
5525 |
06 Dec 10 |
nicklas |
118 |
final boolean sharePermission = event.hasPermission(Permission.SET_PERMISSION); |
5525 |
06 Dec 10 |
nicklas |
119 |
final boolean setOwnerPermission = event.hasPermission(Permission.SET_OWNER); |
5525 |
06 Dec 10 |
nicklas |
120 |
final boolean isRemoved = event.isRemoved(); |
5525 |
06 Dec 10 |
nicklas |
121 |
final boolean isUsed = isRemoved && event.isUsed(); |
5525 |
06 Dec 10 |
nicklas |
122 |
final boolean deletePermanentlyPermission = deletePermission && !isUsed; |
5525 |
06 Dec 10 |
nicklas |
123 |
final boolean isOwner = event.isOwner(); |
5525 |
06 Dec 10 |
nicklas |
124 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, event); |
7604 |
25 Feb 19 |
nicklas |
125 |
ExtensionsInvoker<ButtonAction> invoker = ToolbarUtil.useExtensions(jspContext); |
5525 |
06 Dec 10 |
nicklas |
126 |
%> |
6261 |
27 Mar 13 |
nicklas |
127 |
<base:page title="<%=title%>" id="view-page"> |
6261 |
27 Mar 13 |
nicklas |
128 |
<base:head scripts="table.js,tabcontrol-2.js,~events.js" styles="toolbar.css,table.css,headertabcontrol.css,path.css"> |
5525 |
06 Dec 10 |
nicklas |
129 |
<ext:scripts context="<%=jspContext%>" /> |
5525 |
06 Dec 10 |
nicklas |
130 |
<ext:stylesheets context="<%=jspContext%>" /> |
5525 |
06 Dec 10 |
nicklas |
131 |
</base:head> |
5525 |
06 Dec 10 |
nicklas |
132 |
<base:body> |
5525 |
06 Dec 10 |
nicklas |
133 |
<% |
5525 |
06 Dec 10 |
nicklas |
134 |
if (bioPlate != null) |
5525 |
06 Dec 10 |
nicklas |
135 |
{ |
5525 |
06 Dec 10 |
nicklas |
136 |
%> |
5937 |
27 Jan 12 |
nicklas |
137 |
<p:path><p:pathelement |
5937 |
27 Jan 12 |
nicklas |
138 |
title="Bioplates" href="<%="../index.jsp?ID="+ID%>" /><p:pathelement |
5937 |
27 Jan 12 |
nicklas |
139 |
title="<%=HTML.encodeTags(bioPlate.getName())%>" |
6145 |
21 Sep 12 |
nicklas |
140 |
href="<%="index.jsp?ID="+ID+"&bioplate_id="+bioPlateId%>" /><p:pathelement |
5937 |
27 Jan 12 |
nicklas |
141 |
title="<%=HTML.encodeTags(event.getName())%>" /></p:path> |
5525 |
06 Dec 10 |
nicklas |
142 |
<% |
5525 |
06 Dec 10 |
nicklas |
143 |
} |
5525 |
06 Dec 10 |
nicklas |
144 |
else |
5525 |
06 Dec 10 |
nicklas |
145 |
{ |
5525 |
06 Dec 10 |
nicklas |
146 |
%> |
5937 |
27 Jan 12 |
nicklas |
147 |
<p:path><p:pathelement |
5937 |
27 Jan 12 |
nicklas |
148 |
title="Bioplate events" /><p:pathelement |
5937 |
27 Jan 12 |
nicklas |
149 |
title="<%=HTML.encodeTags(event.getName())%>" /></p:path> |
5525 |
06 Dec 10 |
nicklas |
150 |
<% |
5525 |
06 Dec 10 |
nicklas |
151 |
} |
5525 |
06 Dec 10 |
nicklas |
152 |
%> |
6261 |
27 Mar 13 |
nicklas |
153 |
<div id="page-data" data-item-id="<%=itemId%>"></div> |
6261 |
27 Mar 13 |
nicklas |
154 |
|
5937 |
27 Jan 12 |
nicklas |
155 |
<t:tabcontrol id="main" |
5937 |
27 Jan 12 |
nicklas |
156 |
subclass="content mastertabcontrol" |
6261 |
27 Mar 13 |
nicklas |
157 |
active="<%=tab %>"> |
5525 |
06 Dec 10 |
nicklas |
158 |
<t:tab id="properties" title="Properties"> |
5937 |
27 Jan 12 |
nicklas |
159 |
<div> |
5937 |
27 Jan 12 |
nicklas |
160 |
<table class="fullform bottomborder"> |
5937 |
27 Jan 12 |
nicklas |
161 |
<tr> |
5937 |
27 Jan 12 |
nicklas |
162 |
<th class="itemstatus"> |
5525 |
06 Dec 10 |
nicklas |
163 |
<base:icon |
5946 |
03 Feb 12 |
nicklas |
164 |
image="shared.png" |
5937 |
27 Jan 12 |
nicklas |
165 |
visible="<%=event.isShared()%>" |
5937 |
27 Jan 12 |
nicklas |
166 |
tooltip="This item is shared to other users, groups and/or projects" |
5937 |
27 Jan 12 |
nicklas |
167 |
/> |
5937 |
27 Jan 12 |
nicklas |
168 |
<base:icon |
6261 |
27 Mar 13 |
nicklas |
169 |
id="btnDeletePermanently" |
6261 |
27 Mar 13 |
nicklas |
170 |
data-extra-url="<%="&bioplate_id=" + bioPlateId%>" |
5946 |
03 Feb 12 |
nicklas |
171 |
image="deleted.png" |
5937 |
27 Jan 12 |
nicklas |
172 |
tooltip="This item has been flagged for deletion. Click to delete it now." |
5937 |
27 Jan 12 |
nicklas |
173 |
enabled="<%=deletePermanentlyPermission %>" |
5937 |
27 Jan 12 |
nicklas |
174 |
visible="<%=isRemoved%>" |
5937 |
27 Jan 12 |
nicklas |
175 |
/> |
6261 |
27 Mar 13 |
nicklas |
176 |
<base:icon |
6261 |
27 Mar 13 |
nicklas |
177 |
id="btnUsingItems" |
6261 |
27 Mar 13 |
nicklas |
178 |
image="used.png" |
5937 |
27 Jan 12 |
nicklas |
179 |
tooltip="This item is used by other items and can't be permanently deleted. Show the items that are using this one" |
5937 |
27 Jan 12 |
nicklas |
180 |
visible="<%=isRemoved && isUsed%>" /> |
5937 |
27 Jan 12 |
nicklas |
181 |
</th> |
6145 |
21 Sep 12 |
nicklas |
182 |
<td style="padding: 0px;"> |
6605 |
18 Nov 14 |
nicklas |
183 |
<tbl:toolbar subclass="bottomborder bg-filled-50"> |
5937 |
27 Jan 12 |
nicklas |
184 |
<tbl:button |
6261 |
27 Mar 13 |
nicklas |
185 |
id="btnEdit" |
5942 |
01 Feb 12 |
nicklas |
186 |
disabled="<%=!writePermission%>" |
5945 |
02 Feb 12 |
nicklas |
187 |
image="edit.png" |
5937 |
27 Jan 12 |
nicklas |
188 |
title="Edit…" |
5937 |
27 Jan 12 |
nicklas |
189 |
tooltip="<%=writePermission ? "Edit this event" : "You do not have permission to edit this event"%>" |
5937 |
27 Jan 12 |
nicklas |
190 |
/> |
5937 |
27 Jan 12 |
nicklas |
191 |
<tbl:button |
6261 |
27 Mar 13 |
nicklas |
192 |
id="btnDelete" |
6261 |
27 Mar 13 |
nicklas |
193 |
data-extra-url="<%="&bioplate_id=" + bioPlateId%>" |
5942 |
01 Feb 12 |
nicklas |
194 |
disabled="<%=!deletePermission%>" |
5946 |
03 Feb 12 |
nicklas |
195 |
image="delete.png" |
5937 |
27 Jan 12 |
nicklas |
196 |
title="Delete" |
5937 |
27 Jan 12 |
nicklas |
197 |
visible="<%=!event.isRemoved()%>" |
5937 |
27 Jan 12 |
nicklas |
198 |
tooltip="<%=deletePermission ? "Delete this event" : "You do not have permission to delete this event"%>" |
5937 |
27 Jan 12 |
nicklas |
199 |
/> |
5937 |
27 Jan 12 |
nicklas |
200 |
<tbl:button |
6261 |
27 Mar 13 |
nicklas |
201 |
id="btnRestore" |
6261 |
27 Mar 13 |
nicklas |
202 |
data-extra-url="<%="&bioplate_id=" + bioPlateId%>" |
5942 |
01 Feb 12 |
nicklas |
203 |
disabled="<%=!writePermission%>" |
5946 |
03 Feb 12 |
nicklas |
204 |
image="restore.png" |
5937 |
27 Jan 12 |
nicklas |
205 |
title="Restore" |
5937 |
27 Jan 12 |
nicklas |
206 |
visible="<%=event.isRemoved()%>" |
5937 |
27 Jan 12 |
nicklas |
207 |
tooltip="<%=writePermission ? "Restore this event" : "You do not have permission to restore this event"%>" |
5937 |
27 Jan 12 |
nicklas |
208 |
/> |
5937 |
27 Jan 12 |
nicklas |
209 |
<tbl:button |
6261 |
27 Mar 13 |
nicklas |
210 |
id="btnShare" |
5942 |
01 Feb 12 |
nicklas |
211 |
disabled="<%=!sharePermission%>" |
5945 |
02 Feb 12 |
nicklas |
212 |
image="share.png" |
5937 |
27 Jan 12 |
nicklas |
213 |
title="Share…" |
5937 |
27 Jan 12 |
nicklas |
214 |
tooltip="<%=sharePermission ? "Share this event to other user, groups and projects" : "You do not have permission to share this event"%>" |
5937 |
27 Jan 12 |
nicklas |
215 |
/> |
5937 |
27 Jan 12 |
nicklas |
216 |
<tbl:button |
6261 |
27 Mar 13 |
nicklas |
217 |
id="btnSetOwner" |
5942 |
01 Feb 12 |
nicklas |
218 |
disabled="<%=!setOwnerPermission%>" |
5937 |
27 Jan 12 |
nicklas |
219 |
image="take_ownership.png" |
5937 |
27 Jan 12 |
nicklas |
220 |
title="Set owner…" |
5937 |
27 Jan 12 |
nicklas |
221 |
tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" |
5937 |
27 Jan 12 |
nicklas |
222 |
/> |
5937 |
27 Jan 12 |
nicklas |
223 |
<tbl:button |
6261 |
27 Mar 13 |
nicklas |
224 |
id="btnImport" |
5946 |
03 Feb 12 |
nicklas |
225 |
image="import.png" |
6261 |
27 Mar 13 |
nicklas |
226 |
data-plugin-type="IMPORT" |
5937 |
27 Jan 12 |
nicklas |
227 |
title="Import…" |
5937 |
27 Jan 12 |
nicklas |
228 |
tooltip="Import data" |
5937 |
27 Jan 12 |
nicklas |
229 |
visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>" |
5937 |
27 Jan 12 |
nicklas |
230 |
/> |
5937 |
27 Jan 12 |
nicklas |
231 |
<tbl:button |
6261 |
27 Mar 13 |
nicklas |
232 |
id="btnExport" |
6261 |
27 Mar 13 |
nicklas |
233 |
image="export.png" |
6261 |
27 Mar 13 |
nicklas |
234 |
data-plugin-type="EXPORT" |
5937 |
27 Jan 12 |
nicklas |
235 |
title="Export…" |
5937 |
27 Jan 12 |
nicklas |
236 |
tooltip="Export data" |
5937 |
27 Jan 12 |
nicklas |
237 |
visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>" |
5937 |
27 Jan 12 |
nicklas |
238 |
/> |
5937 |
27 Jan 12 |
nicklas |
239 |
<tbl:button |
6261 |
27 Mar 13 |
nicklas |
240 |
id="btnRunPlugin" |
6261 |
27 Mar 13 |
nicklas |
241 |
image="runplugin.png" |
6261 |
27 Mar 13 |
nicklas |
242 |
data-plugin-type="OTHER" |
5937 |
27 Jan 12 |
nicklas |
243 |
title="Run plugin…" |
5937 |
27 Jan 12 |
nicklas |
244 |
tooltip="Run a plugin" |
5937 |
27 Jan 12 |
nicklas |
245 |
visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>" |
5937 |
27 Jan 12 |
nicklas |
246 |
/> |
5937 |
27 Jan 12 |
nicklas |
247 |
<ext:render extensions="<%=invoker%>" context="<%=jspContext%>" |
7604 |
25 Feb 19 |
nicklas |
248 |
wrapper="<%=new PrefixSuffixRenderer<ButtonAction>(jspContext, "<td>", "</td>") %>"/> |
5937 |
27 Jan 12 |
nicklas |
249 |
</tbl:toolbar> |
5937 |
27 Jan 12 |
nicklas |
250 |
</td> |
5937 |
27 Jan 12 |
nicklas |
251 |
</tr> |
5525 |
06 Dec 10 |
nicklas |
252 |
<tr> |
5937 |
27 Jan 12 |
nicklas |
253 |
<th>Name</th> |
5525 |
06 Dec 10 |
nicklas |
254 |
<td><%=HTML.encodeTags(event.getName())%></td> |
5525 |
06 Dec 10 |
nicklas |
255 |
</tr> |
5525 |
06 Dec 10 |
nicklas |
256 |
<tr> |
5937 |
27 Jan 12 |
nicklas |
257 |
<th>Event date</th> |
5525 |
06 Dec 10 |
nicklas |
258 |
<td><%=dateFormatter.format(event.getEventDate())%></td> |
5525 |
06 Dec 10 |
nicklas |
259 |
</tr> |
5525 |
06 Dec 10 |
nicklas |
260 |
<tr> |
5937 |
27 Jan 12 |
nicklas |
261 |
<th>Registration date</th> |
5525 |
06 Dec 10 |
nicklas |
262 |
<td><%=dateFormatter.format(event.getEntryDate())%></td> |
5525 |
06 Dec 10 |
nicklas |
263 |
</tr> |
5525 |
06 Dec 10 |
nicklas |
264 |
<tr> |
5937 |
27 Jan 12 |
nicklas |
265 |
<th>Event type</th> |
5525 |
06 Dec 10 |
nicklas |
266 |
<td><base:propertyvalue item="<%=event%>" property="eventType" /></td> |
5525 |
06 Dec 10 |
nicklas |
267 |
</tr> |
5525 |
06 Dec 10 |
nicklas |
268 |
<tr> |
5937 |
27 Jan 12 |
nicklas |
269 |
<th>Protocol</th> |
5525 |
06 Dec 10 |
nicklas |
270 |
<td><base:propertyvalue item="<%=event%>" property="protocol"/></td> |
5525 |
06 Dec 10 |
nicklas |
271 |
</tr> |
5525 |
06 Dec 10 |
nicklas |
272 |
<tr> |
6997 |
03 Nov 15 |
nicklas |
273 |
<th>Kit</th> |
6997 |
03 Nov 15 |
nicklas |
274 |
<td><base:propertyvalue item="<%=event%>" property="kit"/></td> |
6997 |
03 Nov 15 |
nicklas |
275 |
</tr> |
6997 |
03 Nov 15 |
nicklas |
276 |
<tr> |
5937 |
27 Jan 12 |
nicklas |
277 |
<th>Hardware</th> |
5525 |
06 Dec 10 |
nicklas |
278 |
<td><base:propertyvalue item="<%=event%>" property="hardware"/></td> |
5525 |
06 Dec 10 |
nicklas |
279 |
</tr> |
5525 |
06 Dec 10 |
nicklas |
280 |
<tr> |
5937 |
27 Jan 12 |
nicklas |
281 |
<th>Owner</th> |
5525 |
06 Dec 10 |
nicklas |
282 |
<td><base:propertyvalue item="<%=event%>" property="owner" /></td> |
5525 |
06 Dec 10 |
nicklas |
283 |
</tr> |
5525 |
06 Dec 10 |
nicklas |
284 |
<tr> |
5937 |
27 Jan 12 |
nicklas |
285 |
<th>Description</th> |
5525 |
06 Dec 10 |
nicklas |
286 |
<td><%=HTML.niceFormat(event.getDescription())%></td> |
5525 |
06 Dec 10 |
nicklas |
287 |
</tr> |
5525 |
06 Dec 10 |
nicklas |
288 |
</table> |
5937 |
27 Jan 12 |
nicklas |
289 |
</div> |
5525 |
06 Dec 10 |
nicklas |
290 |
|
5937 |
27 Jan 12 |
nicklas |
291 |
<base:section |
5937 |
27 Jan 12 |
nicklas |
292 |
id="participantSection" |
5937 |
27 Jan 12 |
nicklas |
293 |
title="<%="Participating plates (" + participants.size() + ")"%>" |
5937 |
27 Jan 12 |
nicklas |
294 |
context="<%=cc%>" |
5937 |
27 Jan 12 |
nicklas |
295 |
> |
5525 |
06 Dec 10 |
nicklas |
296 |
<% |
5937 |
27 Jan 12 |
nicklas |
297 |
if (participants.size() == 0) |
5937 |
27 Jan 12 |
nicklas |
298 |
{ |
5937 |
27 Jan 12 |
nicklas |
299 |
%> |
5937 |
27 Jan 12 |
nicklas |
300 |
<div class="messagecontainer note"> |
5937 |
27 Jan 12 |
nicklas |
301 |
No plates are participating in this event |
5937 |
27 Jan 12 |
nicklas |
302 |
(or, you don't have permission to view them). |
5937 |
27 Jan 12 |
nicklas |
303 |
</div> |
5937 |
27 Jan 12 |
nicklas |
304 |
<% |
5937 |
27 Jan 12 |
nicklas |
305 |
} |
5937 |
27 Jan 12 |
nicklas |
306 |
else |
5937 |
27 Jan 12 |
nicklas |
307 |
{ |
5937 |
27 Jan 12 |
nicklas |
308 |
%> |
5525 |
06 Dec 10 |
nicklas |
309 |
<tbl:table |
5525 |
06 Dec 10 |
nicklas |
310 |
id="participants" |
5525 |
06 Dec 10 |
nicklas |
311 |
columns="all" |
5525 |
06 Dec 10 |
nicklas |
312 |
> |
5525 |
06 Dec 10 |
nicklas |
313 |
<tbl:columndef |
5525 |
06 Dec 10 |
nicklas |
314 |
id="bioplate" |
5525 |
06 Dec 10 |
nicklas |
315 |
title="Bioplate" |
5525 |
06 Dec 10 |
nicklas |
316 |
/> |
5525 |
06 Dec 10 |
nicklas |
317 |
<tbl:columndef |
5525 |
06 Dec 10 |
nicklas |
318 |
id="role" |
5525 |
06 Dec 10 |
nicklas |
319 |
title="Role" |
5525 |
06 Dec 10 |
nicklas |
320 |
/> |
5525 |
06 Dec 10 |
nicklas |
321 |
<tbl:columndef |
5525 |
06 Dec 10 |
nicklas |
322 |
id="description" |
5525 |
06 Dec 10 |
nicklas |
323 |
title="Description" |
5525 |
06 Dec 10 |
nicklas |
324 |
/> |
5525 |
06 Dec 10 |
nicklas |
325 |
<tbl:data> |
5937 |
27 Jan 12 |
nicklas |
326 |
<tbl:headers> |
5937 |
27 Jan 12 |
nicklas |
327 |
<tbl:headerrow> |
5937 |
27 Jan 12 |
nicklas |
328 |
<tbl:columnheaders /> |
5937 |
27 Jan 12 |
nicklas |
329 |
</tbl:headerrow> |
5937 |
27 Jan 12 |
nicklas |
330 |
</tbl:headers> |
5525 |
06 Dec 10 |
nicklas |
331 |
<tbl:rows> |
5525 |
06 Dec 10 |
nicklas |
332 |
<% |
5525 |
06 Dec 10 |
nicklas |
333 |
for (BioPlateEventParticipant participant : participants) |
5525 |
06 Dec 10 |
nicklas |
334 |
{ |
5525 |
06 Dec 10 |
nicklas |
335 |
BioPlate plate = null; |
5525 |
06 Dec 10 |
nicklas |
336 |
try |
5525 |
06 Dec 10 |
nicklas |
337 |
{ |
5525 |
06 Dec 10 |
nicklas |
338 |
plate = participant.getBioPlate(); |
5525 |
06 Dec 10 |
nicklas |
339 |
} |
5525 |
06 Dec 10 |
nicklas |
340 |
catch (PermissionDeniedException ex) |
5525 |
06 Dec 10 |
nicklas |
341 |
{} |
5525 |
06 Dec 10 |
nicklas |
342 |
%> |
5525 |
06 Dec 10 |
nicklas |
343 |
<tbl:row> |
5525 |
06 Dec 10 |
nicklas |
344 |
<tbl:cell column="bioplate"><base:icon |
5946 |
03 Feb 12 |
nicklas |
345 |
image="deleted.png" |
5525 |
06 Dec 10 |
nicklas |
346 |
tooltip="This item has been scheduled for deletion" |
5525 |
06 Dec 10 |
nicklas |
347 |
visible="<%=plate != null && plate.isRemoved()%>" |
5525 |
06 Dec 10 |
nicklas |
348 |
/><%=Base.getLinkedName(ID, plate, true, true)%></tbl:cell> |
5525 |
06 Dec 10 |
nicklas |
349 |
<tbl:cell column="role"><%=HTML.encodeTags(participant.getRole())%> [<%=participant.getIndex()%>]</tbl:cell> |
5525 |
06 Dec 10 |
nicklas |
350 |
<tbl:cell column="description"><%=plate == null ? "" : HTML.encodeTags(plate.getDescription())%></tbl:cell> |
5525 |
06 Dec 10 |
nicklas |
351 |
</tbl:row> |
5525 |
06 Dec 10 |
nicklas |
352 |
<% |
5525 |
06 Dec 10 |
nicklas |
353 |
} |
5525 |
06 Dec 10 |
nicklas |
354 |
%> |
5525 |
06 Dec 10 |
nicklas |
355 |
</tbl:rows> |
5525 |
06 Dec 10 |
nicklas |
356 |
</tbl:data> |
5525 |
06 Dec 10 |
nicklas |
357 |
</tbl:table> |
5937 |
27 Jan 12 |
nicklas |
358 |
<% |
5937 |
27 Jan 12 |
nicklas |
359 |
} |
5937 |
27 Jan 12 |
nicklas |
360 |
%> |
5937 |
27 Jan 12 |
nicklas |
361 |
</base:section> |
5937 |
27 Jan 12 |
nicklas |
362 |
<% |
5525 |
06 Dec 10 |
nicklas |
363 |
// Biomaterial events linked with this event |
5525 |
06 Dec 10 |
nicklas |
364 |
ItemQuery<BioMaterialEvent> eventQuery = event.getBioMaterialEvents(); |
5525 |
06 Dec 10 |
nicklas |
365 |
eventQuery.join(Hql.leftJoin("bioMaterial", "bm")); |
5642 |
26 May 11 |
nicklas |
366 |
eventQuery.join(Hql.leftJoin("physicalBioAssay", "pba")); |
5525 |
06 Dec 10 |
nicklas |
367 |
eventQuery.include(Include.ALL); |
5525 |
06 Dec 10 |
nicklas |
368 |
eventQuery.order(Orders.asc(Hql.property("bm", "name"))); |
5642 |
26 May 11 |
nicklas |
369 |
eventQuery.order(Orders.asc(Hql.property("pba", "name"))); |
5525 |
06 Dec 10 |
nicklas |
370 |
ItemResultList<BioMaterialEvent> events = eventQuery.list(dc); |
5937 |
27 Jan 12 |
nicklas |
371 |
%> |
5937 |
27 Jan 12 |
nicklas |
372 |
<base:section |
5937 |
27 Jan 12 |
nicklas |
373 |
id="eventsSection" |
5937 |
27 Jan 12 |
nicklas |
374 |
title="<%="Related biomaterial events (" + events.size() + ")"%>" |
5937 |
27 Jan 12 |
nicklas |
375 |
context="<%=cc%>" |
5937 |
27 Jan 12 |
nicklas |
376 |
> |
5525 |
06 Dec 10 |
nicklas |
377 |
<% |
5937 |
27 Jan 12 |
nicklas |
378 |
if (events.size() == 0) |
5937 |
27 Jan 12 |
nicklas |
379 |
{ |
5937 |
27 Jan 12 |
nicklas |
380 |
%> |
5937 |
27 Jan 12 |
nicklas |
381 |
<div class="messagecontainer note"> |
5937 |
27 Jan 12 |
nicklas |
382 |
No biomaterial events are linked to this event |
5937 |
27 Jan 12 |
nicklas |
383 |
(or, you don't have permission to view them). |
5937 |
27 Jan 12 |
nicklas |
384 |
</div> |
5937 |
27 Jan 12 |
nicklas |
385 |
<% |
5937 |
27 Jan 12 |
nicklas |
386 |
} |
5937 |
27 Jan 12 |
nicklas |
387 |
else |
5937 |
27 Jan 12 |
nicklas |
388 |
{ |
5937 |
27 Jan 12 |
nicklas |
389 |
%> |
5525 |
06 Dec 10 |
nicklas |
390 |
<tbl:table |
5525 |
06 Dec 10 |
nicklas |
391 |
id="events" |
5525 |
06 Dec 10 |
nicklas |
392 |
columns="all" |
5525 |
06 Dec 10 |
nicklas |
393 |
> |
5525 |
06 Dec 10 |
nicklas |
394 |
<tbl:columndef |
5525 |
06 Dec 10 |
nicklas |
395 |
id="item" |
5642 |
26 May 11 |
nicklas |
396 |
title="Biomaterial/Bioassay" |
5525 |
06 Dec 10 |
nicklas |
397 |
/> |
5525 |
06 Dec 10 |
nicklas |
398 |
<tbl:columndef |
5525 |
06 Dec 10 |
nicklas |
399 |
id="bioplate" |
5525 |
06 Dec 10 |
nicklas |
400 |
title="Bioplate" |
5525 |
06 Dec 10 |
nicklas |
401 |
/> |
5525 |
06 Dec 10 |
nicklas |
402 |
<tbl:columndef |
5525 |
06 Dec 10 |
nicklas |
403 |
id="eventType" |
5525 |
06 Dec 10 |
nicklas |
404 |
title="Event type" |
5525 |
06 Dec 10 |
nicklas |
405 |
/> |
5525 |
06 Dec 10 |
nicklas |
406 |
<tbl:columndef |
5525 |
06 Dec 10 |
nicklas |
407 |
id="comment" |
5525 |
06 Dec 10 |
nicklas |
408 |
title="Comment" |
5525 |
06 Dec 10 |
nicklas |
409 |
/> |
5525 |
06 Dec 10 |
nicklas |
410 |
<tbl:data> |
5949 |
08 Feb 12 |
nicklas |
411 |
<tbl:headers> |
5949 |
08 Feb 12 |
nicklas |
412 |
<tbl:headerrow> |
5949 |
08 Feb 12 |
nicklas |
413 |
<tbl:columnheaders /> |
5949 |
08 Feb 12 |
nicklas |
414 |
</tbl:headerrow> |
5949 |
08 Feb 12 |
nicklas |
415 |
</tbl:headers> |
5525 |
06 Dec 10 |
nicklas |
416 |
<tbl:rows> |
5525 |
06 Dec 10 |
nicklas |
417 |
<% |
5525 |
06 Dec 10 |
nicklas |
418 |
for (BioMaterialEvent bmEvent : events) |
5525 |
06 Dec 10 |
nicklas |
419 |
{ |
5525 |
06 Dec 10 |
nicklas |
420 |
BioMaterialEvent.Type eventType = bmEvent.getEventType(); |
5525 |
06 Dec 10 |
nicklas |
421 |
CommonItem item = null; |
5525 |
06 Dec 10 |
nicklas |
422 |
try |
5525 |
06 Dec 10 |
nicklas |
423 |
{ |
5642 |
26 May 11 |
nicklas |
424 |
if (eventType == BioMaterialEvent.Type.BIOASSAY) |
5525 |
06 Dec 10 |
nicklas |
425 |
{ |
5642 |
26 May 11 |
nicklas |
426 |
item = bmEvent.getPhysicalBioAssay(); |
5525 |
06 Dec 10 |
nicklas |
427 |
} |
5525 |
06 Dec 10 |
nicklas |
428 |
else |
5525 |
06 Dec 10 |
nicklas |
429 |
{ |
5525 |
06 Dec 10 |
nicklas |
430 |
item = bmEvent.getBioMaterial(); |
5525 |
06 Dec 10 |
nicklas |
431 |
} |
5525 |
06 Dec 10 |
nicklas |
432 |
} |
5525 |
06 Dec 10 |
nicklas |
433 |
catch (PermissionDeniedException ex) |
5525 |
06 Dec 10 |
nicklas |
434 |
{} |
5525 |
06 Dec 10 |
nicklas |
435 |
%> |
5525 |
06 Dec 10 |
nicklas |
436 |
<tbl:row> |
5525 |
06 Dec 10 |
nicklas |
437 |
<tbl:cell column="item"><base:icon |
5946 |
03 Feb 12 |
nicklas |
438 |
image="deleted.png" |
5525 |
06 Dec 10 |
nicklas |
439 |
tooltip="This item has been scheduled for deletion" |
5525 |
06 Dec 10 |
nicklas |
440 |
visible="<%=item != null && item.isRemoved()%>" |
5525 |
06 Dec 10 |
nicklas |
441 |
/><%=Base.getLinkedName(ID, item, true, true)%><%=item != null ? " (" +item.getType().toString() + ")" : "" %></tbl:cell> |
5525 |
06 Dec 10 |
nicklas |
442 |
<tbl:cell column="bioplate"><base:propertyvalue item="<%=bmEvent%>" property="bioPlateEventParticipant.bioPlate" /></tbl:cell> |
5525 |
06 Dec 10 |
nicklas |
443 |
<tbl:cell column="eventType"><%=eventType%></tbl:cell> |
5525 |
06 Dec 10 |
nicklas |
444 |
<tbl:cell column="comment"><%=HTML.encodeTags(bmEvent.getComment())%></tbl:cell> |
5525 |
06 Dec 10 |
nicklas |
445 |
</tbl:row> |
5525 |
06 Dec 10 |
nicklas |
446 |
<% |
5525 |
06 Dec 10 |
nicklas |
447 |
} |
5525 |
06 Dec 10 |
nicklas |
448 |
%> |
5525 |
06 Dec 10 |
nicklas |
449 |
</tbl:rows> |
5525 |
06 Dec 10 |
nicklas |
450 |
</tbl:data> |
5525 |
06 Dec 10 |
nicklas |
451 |
</tbl:table> |
5937 |
27 Jan 12 |
nicklas |
452 |
<% |
5937 |
27 Jan 12 |
nicklas |
453 |
} |
5937 |
27 Jan 12 |
nicklas |
454 |
%> |
5937 |
27 Jan 12 |
nicklas |
455 |
</base:section> |
5525 |
06 Dec 10 |
nicklas |
456 |
<jsp:include page="../../../common/anytoany/list_anytoany.jsp"> |
5525 |
06 Dec 10 |
nicklas |
457 |
<jsp:param name="ID" value="<%=ID%>" /> |
5525 |
06 Dec 10 |
nicklas |
458 |
<jsp:param name="item_type" value="<%=itemType.name()%>" /> |
5525 |
06 Dec 10 |
nicklas |
459 |
<jsp:param name="item_id" value="<%=itemId%>" /> |
5525 |
06 Dec 10 |
nicklas |
460 |
<jsp:param name="title" value="Other items related to this event" /> |
5525 |
06 Dec 10 |
nicklas |
461 |
</jsp:include> |
5525 |
06 Dec 10 |
nicklas |
462 |
</t:tab> |
5525 |
06 Dec 10 |
nicklas |
463 |
</t:tabcontrol> |
5525 |
06 Dec 10 |
nicklas |
464 |
|
5525 |
06 Dec 10 |
nicklas |
465 |
</base:body> |
5525 |
06 Dec 10 |
nicklas |
466 |
</base:page> |
5525 |
06 Dec 10 |
nicklas |
467 |
<% |
5525 |
06 Dec 10 |
nicklas |
468 |
} |
5525 |
06 Dec 10 |
nicklas |
469 |
finally |
5525 |
06 Dec 10 |
nicklas |
470 |
{ |
5525 |
06 Dec 10 |
nicklas |
471 |
if (dc != null) dc.close(); |
5525 |
06 Dec 10 |
nicklas |
472 |
} |
5525 |
06 Dec 10 |
nicklas |
473 |
|
5525 |
06 Dec 10 |
nicklas |
474 |
%> |