1895 |
02 Feb 06 |
nicklas |
1 |
<%-- $Id$ |
1895 |
02 Feb 06 |
nicklas |
2 |
------------------------------------------------------------------ |
5425 |
23 Sep 10 |
nicklas |
Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson |
1895 |
02 Feb 06 |
nicklas |
4 |
|
2304 |
22 May 06 |
jari |
5 |
This file is part of BASE - BioArray Software Environment. |
2304 |
22 May 06 |
jari |
6 |
Available at http://base.thep.lu.se/ |
1895 |
02 Feb 06 |
nicklas |
7 |
|
1895 |
02 Feb 06 |
nicklas |
8 |
BASE is free software; you can redistribute it and/or |
1895 |
02 Feb 06 |
nicklas |
9 |
modify it under the terms of the GNU General Public License |
4476 |
05 Sep 08 |
jari |
10 |
as published by the Free Software Foundation; either version 3 |
1895 |
02 Feb 06 |
nicklas |
11 |
of the License, or (at your option) any later version. |
1895 |
02 Feb 06 |
nicklas |
12 |
|
1895 |
02 Feb 06 |
nicklas |
13 |
BASE is distributed in the hope that it will be useful, |
1895 |
02 Feb 06 |
nicklas |
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
1895 |
02 Feb 06 |
nicklas |
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1895 |
02 Feb 06 |
nicklas |
16 |
GNU General Public License for more details. |
1895 |
02 Feb 06 |
nicklas |
17 |
|
1895 |
02 Feb 06 |
nicklas |
18 |
You should have received a copy of the GNU General Public License |
4511 |
11 Sep 08 |
jari |
19 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
1895 |
02 Feb 06 |
nicklas |
20 |
------------------------------------------------------------------ |
1895 |
02 Feb 06 |
nicklas |
21 |
|
1895 |
02 Feb 06 |
nicklas |
22 |
@author Nicklas |
1895 |
02 Feb 06 |
nicklas |
23 |
@version 2.0 |
1895 |
02 Feb 06 |
nicklas |
24 |
--%> |
5426 |
24 Sep 10 |
nicklas |
25 |
<%@ page pageEncoding="UTF-8" session="false" |
1895 |
02 Feb 06 |
nicklas |
26 |
import="net.sf.basedb.core.SessionControl" |
2947 |
23 Nov 06 |
martin |
27 |
import="net.sf.basedb.core.BasicItem" |
2947 |
23 Nov 06 |
martin |
28 |
import="net.sf.basedb.core.Nameable" |
1895 |
02 Feb 06 |
nicklas |
29 |
import="net.sf.basedb.core.DbControl" |
1895 |
02 Feb 06 |
nicklas |
30 |
import="net.sf.basedb.core.SystemItems" |
1895 |
02 Feb 06 |
nicklas |
31 |
import="net.sf.basedb.core.Item" |
1895 |
02 Feb 06 |
nicklas |
32 |
import="net.sf.basedb.core.ItemContext" |
3888 |
29 Oct 07 |
nicklas |
33 |
import="net.sf.basedb.core.Include" |
1895 |
02 Feb 06 |
nicklas |
34 |
import="net.sf.basedb.core.Permission" |
1895 |
02 Feb 06 |
nicklas |
35 |
import="net.sf.basedb.core.Project" |
1895 |
02 Feb 06 |
nicklas |
36 |
import="net.sf.basedb.core.User" |
1895 |
02 Feb 06 |
nicklas |
37 |
import="net.sf.basedb.core.Group" |
6142 |
20 Sep 12 |
nicklas |
38 |
import="net.sf.basedb.core.Subtypable" |
1895 |
02 Feb 06 |
nicklas |
39 |
import="net.sf.basedb.core.ItemQuery" |
1895 |
02 Feb 06 |
nicklas |
40 |
import="net.sf.basedb.core.ItemResultList" |
1895 |
02 Feb 06 |
nicklas |
41 |
import="net.sf.basedb.core.PermissionDeniedException" |
1895 |
02 Feb 06 |
nicklas |
42 |
import="net.sf.basedb.core.PluginDefinition" |
1895 |
02 Feb 06 |
nicklas |
43 |
import="net.sf.basedb.core.plugin.GuiContext" |
1895 |
02 Feb 06 |
nicklas |
44 |
import="net.sf.basedb.core.plugin.Plugin" |
1895 |
02 Feb 06 |
nicklas |
45 |
import="net.sf.basedb.core.query.Orders" |
2947 |
23 Nov 06 |
martin |
46 |
import="net.sf.basedb.core.RawDataType" |
1895 |
02 Feb 06 |
nicklas |
47 |
import="net.sf.basedb.core.query.Hql" |
1895 |
02 Feb 06 |
nicklas |
48 |
import="net.sf.basedb.clients.web.Base" |
7199 |
17 Oct 16 |
nicklas |
49 |
import="net.sf.basedb.clients.web.ChangeHistoryUtil" |
2386 |
15 Jun 06 |
martin |
50 |
import="net.sf.basedb.clients.web.PermissionUtil" |
1895 |
02 Feb 06 |
nicklas |
51 |
import="net.sf.basedb.clients.web.util.HTML" |
2753 |
20 Oct 06 |
nicklas |
52 |
import="net.sf.basedb.util.Values" |
4698 |
10 Dec 08 |
nicklas |
53 |
import="net.sf.basedb.util.formatter.Formatter" |
4698 |
10 Dec 08 |
nicklas |
54 |
import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
4887 |
06 Apr 09 |
nicklas |
55 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
4887 |
06 Apr 09 |
nicklas |
56 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
4887 |
06 Apr 09 |
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" |
4887 |
06 Apr 09 |
nicklas |
59 |
import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil" |
4887 |
06 Apr 09 |
nicklas |
60 |
import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
1895 |
02 Feb 06 |
nicklas |
61 |
import="java.util.Date" |
1895 |
02 Feb 06 |
nicklas |
62 |
import="java.util.Map" |
1895 |
02 Feb 06 |
nicklas |
63 |
import="java.util.Set" |
1895 |
02 Feb 06 |
nicklas |
64 |
import="java.util.List" |
1895 |
02 Feb 06 |
nicklas |
65 |
%> |
1895 |
02 Feb 06 |
nicklas |
66 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
1895 |
02 Feb 06 |
nicklas |
67 |
<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
1895 |
02 Feb 06 |
nicklas |
68 |
<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
1895 |
02 Feb 06 |
nicklas |
69 |
<%@ taglib prefix="p" uri="/WEB-INF/path.tld" %> |
4887 |
06 Apr 09 |
nicklas |
70 |
<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
1895 |
02 Feb 06 |
nicklas |
71 |
<%! |
1895 |
02 Feb 06 |
nicklas |
72 |
private static final Item itemType = Item.PROJECT; |
1895 |
02 Feb 06 |
nicklas |
73 |
private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.ITEM); |
1895 |
02 Feb 06 |
nicklas |
74 |
%> |
1895 |
02 Feb 06 |
nicklas |
75 |
<% |
1895 |
02 Feb 06 |
nicklas |
76 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
1895 |
02 Feb 06 |
nicklas |
77 |
final String ID = sc.getId(); |
1895 |
02 Feb 06 |
nicklas |
78 |
final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
1895 |
02 Feb 06 |
nicklas |
79 |
final int itemId = cc.getId(); |
1895 |
02 Feb 06 |
nicklas |
80 |
final String tab = Values.getString(request.getParameter("tab"), "properties"); |
1895 |
02 Feb 06 |
nicklas |
81 |
final float scale = Base.getScale(sc); |
7954 |
12 May 21 |
nicklas |
82 |
final DbControl dc = sc.newDbControl(":View "+itemType); |
1895 |
02 Feb 06 |
nicklas |
83 |
try |
1895 |
02 Feb 06 |
nicklas |
84 |
{ |
4698 |
10 Dec 08 |
nicklas |
85 |
Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); |
1895 |
02 Feb 06 |
nicklas |
86 |
Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); |
1895 |
02 Feb 06 |
nicklas |
87 |
|
1895 |
02 Feb 06 |
nicklas |
88 |
String title = null; |
1895 |
02 Feb 06 |
nicklas |
89 |
Project project = Project.getById(dc, itemId); |
1895 |
02 Feb 06 |
nicklas |
90 |
|
2425 |
26 Jun 06 |
nicklas |
91 |
final boolean usePermission = project.hasPermission(Permission.USE); |
1895 |
02 Feb 06 |
nicklas |
92 |
final boolean writePermission = project.hasPermission(Permission.WRITE); |
1895 |
02 Feb 06 |
nicklas |
93 |
final boolean deletePermission = project.hasPermission(Permission.DELETE); |
2918 |
15 Nov 06 |
nicklas |
94 |
final boolean setOwnerPermission = project.hasPermission(Permission.SET_OWNER); |
4003 |
26 Nov 07 |
nicklas |
95 |
final boolean isRemoved = project.isRemoved(); |
4003 |
26 Nov 07 |
nicklas |
96 |
final boolean isUsed = isRemoved && project.isUsed(); |
4003 |
26 Nov 07 |
nicklas |
97 |
final boolean deletePermanentlyPermission = deletePermission && !isUsed; |
2918 |
15 Nov 06 |
nicklas |
98 |
final boolean isOwner = project.isOwner(); |
4887 |
06 Apr 09 |
nicklas |
99 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, project); |
7604 |
25 Feb 19 |
nicklas |
100 |
ExtensionsInvoker<ButtonAction> invoker = ToolbarUtil.useExtensions(jspContext); |
1895 |
02 Feb 06 |
nicklas |
101 |
%> |
6307 |
15 Aug 13 |
nicklas |
102 |
<base:page title="<%=title%>" id="view-page"> |
6307 |
15 Aug 13 |
nicklas |
103 |
<base:head scripts="table.js,tabcontrol-2.js,~projects.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css"> |
4887 |
06 Apr 09 |
nicklas |
104 |
<ext:scripts context="<%=jspContext%>" /> |
4887 |
06 Apr 09 |
nicklas |
105 |
<ext:stylesheets context="<%=jspContext%>" /> |
1895 |
02 Feb 06 |
nicklas |
106 |
</base:head> |
1895 |
02 Feb 06 |
nicklas |
107 |
<base:body> |
5939 |
30 Jan 12 |
nicklas |
108 |
<p:path><p:pathelement |
5939 |
30 Jan 12 |
nicklas |
109 |
title="Projects" href="<%="index.jsp?ID="+ID%>" |
5939 |
30 Jan 12 |
nicklas |
110 |
/><p:pathelement title="<%=HTML.encodeTags(project.getName())%>" |
5939 |
30 Jan 12 |
nicklas |
111 |
/></p:path> |
6307 |
15 Aug 13 |
nicklas |
112 |
<div id="page-data" data-item-id="<%=itemId%>"></div> |
1895 |
02 Feb 06 |
nicklas |
113 |
|
5939 |
30 Jan 12 |
nicklas |
114 |
<t:tabcontrol |
5939 |
30 Jan 12 |
nicklas |
115 |
id="main" |
5939 |
30 Jan 12 |
nicklas |
116 |
subclass="content mastertabcontrol" |
6307 |
15 Aug 13 |
nicklas |
117 |
active="<%=tab%>"> |
1895 |
02 Feb 06 |
nicklas |
118 |
<t:tab id="properties" title="Properties"> |
5939 |
30 Jan 12 |
nicklas |
119 |
<div> |
5939 |
30 Jan 12 |
nicklas |
120 |
<table class="fullform bottomborder"> |
5939 |
30 Jan 12 |
nicklas |
121 |
<tr> |
5939 |
30 Jan 12 |
nicklas |
122 |
<th class="itemstatus"> |
4003 |
26 Nov 07 |
nicklas |
123 |
<base:icon |
6307 |
15 Aug 13 |
nicklas |
124 |
id="btnDeletePermanently" |
5946 |
03 Feb 12 |
nicklas |
125 |
image="deleted.png" |
5939 |
30 Jan 12 |
nicklas |
126 |
tooltip="This item has been flagged for deletion. Click to delete it now." |
5939 |
30 Jan 12 |
nicklas |
127 |
enabled="<%=deletePermanentlyPermission %>" |
5939 |
30 Jan 12 |
nicklas |
128 |
visible="<%=isRemoved%>" |
5939 |
30 Jan 12 |
nicklas |
129 |
/> |
6307 |
15 Aug 13 |
nicklas |
130 |
<base:icon |
6307 |
15 Aug 13 |
nicklas |
131 |
id="btnUsingItems" |
6307 |
15 Aug 13 |
nicklas |
132 |
image="used.png" |
5939 |
30 Jan 12 |
nicklas |
133 |
tooltip="This item is used by other items and can't be permanently deleted. Show the items that are using this one" |
5939 |
30 Jan 12 |
nicklas |
134 |
visible="<%=isRemoved && isUsed%>" /> |
5939 |
30 Jan 12 |
nicklas |
135 |
</th> |
5939 |
30 Jan 12 |
nicklas |
136 |
<td style="padding: 0px;"> |
6605 |
18 Nov 14 |
nicklas |
137 |
<tbl:toolbar subclass="bottomborder bg-filled-50"> |
5939 |
30 Jan 12 |
nicklas |
138 |
<tbl:button |
6307 |
15 Aug 13 |
nicklas |
139 |
id="btnEdit" |
5942 |
01 Feb 12 |
nicklas |
140 |
disabled="<%=!writePermission%>" |
5945 |
02 Feb 12 |
nicklas |
141 |
image="edit.png" |
5939 |
30 Jan 12 |
nicklas |
142 |
title="Edit…" |
5939 |
30 Jan 12 |
nicklas |
143 |
tooltip="<%=writePermission ? "Edit this project" : "You do not have permission to edit this project"%>" |
5939 |
30 Jan 12 |
nicklas |
144 |
/> |
5939 |
30 Jan 12 |
nicklas |
145 |
<tbl:button |
6307 |
15 Aug 13 |
nicklas |
146 |
id="btnDelete" |
5942 |
01 Feb 12 |
nicklas |
147 |
disabled="<%=!deletePermission%>" |
5946 |
03 Feb 12 |
nicklas |
148 |
image="delete.png" |
5939 |
30 Jan 12 |
nicklas |
149 |
title="Delete" |
5939 |
30 Jan 12 |
nicklas |
150 |
visible="<%=!project.isRemoved()%>" |
5939 |
30 Jan 12 |
nicklas |
151 |
tooltip="<%=deletePermission ? "Delete this project" : "You do not have permission to delete this project"%>" |
5939 |
30 Jan 12 |
nicklas |
152 |
/> |
5939 |
30 Jan 12 |
nicklas |
153 |
<tbl:button |
6307 |
15 Aug 13 |
nicklas |
154 |
id="btnRestore" |
5942 |
01 Feb 12 |
nicklas |
155 |
disabled="<%=!writePermission%>" |
5946 |
03 Feb 12 |
nicklas |
156 |
image="restore.png" |
5939 |
30 Jan 12 |
nicklas |
157 |
title="Restore" |
5939 |
30 Jan 12 |
nicklas |
158 |
visible="<%=project.isRemoved()%>" |
5939 |
30 Jan 12 |
nicklas |
159 |
tooltip="<%=writePermission ? "Restore this project" : "You do not have permission to restore this project"%>" |
5939 |
30 Jan 12 |
nicklas |
160 |
/> |
5939 |
30 Jan 12 |
nicklas |
161 |
<tbl:button |
6307 |
15 Aug 13 |
nicklas |
162 |
id="btnSetOwner" |
5942 |
01 Feb 12 |
nicklas |
163 |
disabled="<%=!setOwnerPermission%>" |
5939 |
30 Jan 12 |
nicklas |
164 |
image="take_ownership.png" |
5939 |
30 Jan 12 |
nicklas |
165 |
title="Set owner…" |
5939 |
30 Jan 12 |
nicklas |
166 |
tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" |
5939 |
30 Jan 12 |
nicklas |
167 |
/> |
5939 |
30 Jan 12 |
nicklas |
168 |
<tbl:button |
6307 |
15 Aug 13 |
nicklas |
169 |
id="btnSetActive" |
5946 |
03 Feb 12 |
nicklas |
170 |
image="bullet.png" |
5939 |
30 Jan 12 |
nicklas |
171 |
title="Set active" |
5939 |
30 Jan 12 |
nicklas |
172 |
tooltip="Set this project to the active project" |
5939 |
30 Jan 12 |
nicklas |
173 |
/> |
5939 |
30 Jan 12 |
nicklas |
174 |
<tbl:button |
6307 |
15 Aug 13 |
nicklas |
175 |
id="btnImport" |
5946 |
03 Feb 12 |
nicklas |
176 |
image="import.png" |
6307 |
15 Aug 13 |
nicklas |
177 |
data-plugin-type="IMPORT" |
5939 |
30 Jan 12 |
nicklas |
178 |
title="Import…" |
5939 |
30 Jan 12 |
nicklas |
179 |
tooltip="Import data" |
5939 |
30 Jan 12 |
nicklas |
180 |
visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>" |
5939 |
30 Jan 12 |
nicklas |
181 |
/> |
5939 |
30 Jan 12 |
nicklas |
182 |
<tbl:button |
6307 |
15 Aug 13 |
nicklas |
183 |
id="btnExport" |
6307 |
15 Aug 13 |
nicklas |
184 |
image="export.png" |
6307 |
15 Aug 13 |
nicklas |
185 |
data-plugin-type="EXPORT" |
5939 |
30 Jan 12 |
nicklas |
186 |
title="Export…" |
5939 |
30 Jan 12 |
nicklas |
187 |
tooltip="Export data" |
5939 |
30 Jan 12 |
nicklas |
188 |
visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>" |
5939 |
30 Jan 12 |
nicklas |
189 |
/> |
5939 |
30 Jan 12 |
nicklas |
190 |
<tbl:button |
6307 |
15 Aug 13 |
nicklas |
191 |
id="btnRunPlugin" |
6307 |
15 Aug 13 |
nicklas |
192 |
image="runplugin.png" |
6307 |
15 Aug 13 |
nicklas |
193 |
data-plugin-type="OTHER" |
5939 |
30 Jan 12 |
nicklas |
194 |
title="Run plugin…" |
5939 |
30 Jan 12 |
nicklas |
195 |
tooltip="Run a plugin" |
5939 |
30 Jan 12 |
nicklas |
196 |
visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>" |
5939 |
30 Jan 12 |
nicklas |
197 |
/> |
5939 |
30 Jan 12 |
nicklas |
198 |
<ext:render extensions="<%=invoker%>" context="<%=jspContext%>" |
7604 |
25 Feb 19 |
nicklas |
199 |
wrapper="<%=new PrefixSuffixRenderer<ButtonAction>(jspContext, "<td>", "</td>") %>"/> |
5939 |
30 Jan 12 |
nicklas |
200 |
<tbl:button |
5939 |
30 Jan 12 |
nicklas |
201 |
image="help.png" |
6307 |
15 Aug 13 |
nicklas |
202 |
subclass="auto-init" |
6307 |
15 Aug 13 |
nicklas |
203 |
data-auto-init="help" |
6307 |
15 Aug 13 |
nicklas |
204 |
data-help-id="project.view.properties" |
5939 |
30 Jan 12 |
nicklas |
205 |
title="Help…" |
5939 |
30 Jan 12 |
nicklas |
206 |
tooltip="Get help about this page" |
5939 |
30 Jan 12 |
nicklas |
207 |
/> |
5939 |
30 Jan 12 |
nicklas |
208 |
</tbl:toolbar> |
5939 |
30 Jan 12 |
nicklas |
209 |
</td> |
5939 |
30 Jan 12 |
nicklas |
210 |
</tr> |
1895 |
02 Feb 06 |
nicklas |
211 |
<tr> |
5939 |
30 Jan 12 |
nicklas |
212 |
<th>Name</th> |
1895 |
02 Feb 06 |
nicklas |
213 |
<td><%=HTML.encodeTags(project.getName())%></td> |
1895 |
02 Feb 06 |
nicklas |
214 |
</tr> |
1895 |
02 Feb 06 |
nicklas |
215 |
<tr> |
5939 |
30 Jan 12 |
nicklas |
216 |
<th>Registered</th> |
4698 |
10 Dec 08 |
nicklas |
217 |
<td><%=dateFormatter.format(project.getEntryDate())%></td> |
4698 |
10 Dec 08 |
nicklas |
218 |
</tr> |
4698 |
10 Dec 08 |
nicklas |
219 |
<tr> |
5939 |
30 Jan 12 |
nicklas |
220 |
<th>Owner</th> |
2425 |
26 Jun 06 |
nicklas |
221 |
<td><base:propertyvalue item="<%=project%>" property="owner" /></td> |
1895 |
02 Feb 06 |
nicklas |
222 |
</tr> |
1895 |
02 Feb 06 |
nicklas |
223 |
<tr> |
5939 |
30 Jan 12 |
nicklas |
224 |
<th>Default permissions</th> |
5370 |
23 Jun 10 |
nicklas |
225 |
<td><base:propertyvalue item="<%=project%>" property="permissionTemplate" |
7214 |
19 Oct 16 |
nicklas |
226 |
nulltext="<%=PermissionUtil.getFullPermissionNames(project.getAutoPermission(), "Annotate")%>" /></td> |
4690 |
08 Dec 08 |
nicklas |
227 |
</tr> |
4690 |
08 Dec 08 |
nicklas |
228 |
<tr> |
5939 |
30 Jan 12 |
nicklas |
229 |
<th>Your permissions</th> |
5939 |
30 Jan 12 |
nicklas |
230 |
<td><%=PermissionUtil.getFullPermissionNames(project)%></td> |
5939 |
30 Jan 12 |
nicklas |
231 |
</tr> |
5939 |
30 Jan 12 |
nicklas |
232 |
<tr> |
5939 |
30 Jan 12 |
nicklas |
233 |
<th>Description</th> |
1895 |
02 Feb 06 |
nicklas |
234 |
<td><%=HTML.niceFormat(project.getDescription())%></td> |
1895 |
02 Feb 06 |
nicklas |
235 |
</tr> |
1895 |
02 Feb 06 |
nicklas |
236 |
</table> |
6142 |
20 Sep 12 |
nicklas |
237 |
</div> |
5045 |
12 Aug 09 |
martin |
238 |
<% |
5045 |
12 Aug 09 |
martin |
239 |
// Query to retrieve child groups |
5045 |
12 Aug 09 |
martin |
240 |
ItemQuery<Group> groupQuery = project.getGroups(); |
5045 |
12 Aug 09 |
martin |
241 |
groupQuery.include(Include.ALL); |
5045 |
12 Aug 09 |
martin |
242 |
groupQuery.order(Orders.asc(Hql.property("name"))); |
5045 |
12 Aug 09 |
martin |
243 |
ItemResultList<Group> groups = groupQuery.list(dc); |
1895 |
02 Feb 06 |
nicklas |
244 |
|
5045 |
12 Aug 09 |
martin |
245 |
// Query to retrieve user members |
5045 |
12 Aug 09 |
martin |
246 |
ItemQuery<User> userQuery = project.getUsers(); |
5045 |
12 Aug 09 |
martin |
247 |
userQuery.include(Include.ALL); |
5045 |
12 Aug 09 |
martin |
248 |
userQuery.order(Orders.asc(Hql.property("name"))); |
5045 |
12 Aug 09 |
martin |
249 |
ItemResultList<User> users = userQuery.list(dc); |
5939 |
30 Jan 12 |
nicklas |
250 |
int numMembers = groups.size() + users.size(); |
5939 |
30 Jan 12 |
nicklas |
251 |
%> |
5045 |
12 Aug 09 |
martin |
252 |
<base:section |
5045 |
12 Aug 09 |
martin |
253 |
id="membersSection" |
5939 |
30 Jan 12 |
nicklas |
254 |
title="<%="Members (" + numMembers + ")"%>" |
5045 |
12 Aug 09 |
martin |
255 |
context="<%=cc%>" |
5939 |
30 Jan 12 |
nicklas |
256 |
> |
5939 |
30 Jan 12 |
nicklas |
257 |
<% |
5939 |
30 Jan 12 |
nicklas |
258 |
if (numMembers == 0) |
5939 |
30 Jan 12 |
nicklas |
259 |
{ |
5939 |
30 Jan 12 |
nicklas |
260 |
%> |
5939 |
30 Jan 12 |
nicklas |
261 |
<div class="messagecontainer note"> |
5939 |
30 Jan 12 |
nicklas |
262 |
There are no members in this project |
5939 |
30 Jan 12 |
nicklas |
263 |
(or, you don't have permission to view them). |
5939 |
30 Jan 12 |
nicklas |
264 |
</div> |
5939 |
30 Jan 12 |
nicklas |
265 |
<% |
5939 |
30 Jan 12 |
nicklas |
266 |
} |
5939 |
30 Jan 12 |
nicklas |
267 |
else |
5939 |
30 Jan 12 |
nicklas |
268 |
{ |
5939 |
30 Jan 12 |
nicklas |
269 |
%> |
5939 |
30 Jan 12 |
nicklas |
270 |
<tbl:table |
5939 |
30 Jan 12 |
nicklas |
271 |
id="members" |
5939 |
30 Jan 12 |
nicklas |
272 |
columns="all" |
5939 |
30 Jan 12 |
nicklas |
273 |
> |
5939 |
30 Jan 12 |
nicklas |
274 |
<tbl:columndef |
5939 |
30 Jan 12 |
nicklas |
275 |
id="type" |
5939 |
30 Jan 12 |
nicklas |
276 |
title="User/Group" |
5939 |
30 Jan 12 |
nicklas |
277 |
/> |
5939 |
30 Jan 12 |
nicklas |
278 |
<tbl:columndef |
5939 |
30 Jan 12 |
nicklas |
279 |
id="name" |
5939 |
30 Jan 12 |
nicklas |
280 |
title="Name" |
5939 |
30 Jan 12 |
nicklas |
281 |
/> |
5939 |
30 Jan 12 |
nicklas |
282 |
<tbl:columndef |
5939 |
30 Jan 12 |
nicklas |
283 |
id="permissions" |
5939 |
30 Jan 12 |
nicklas |
284 |
title="Permissions" |
5939 |
30 Jan 12 |
nicklas |
285 |
/> |
5939 |
30 Jan 12 |
nicklas |
286 |
<tbl:data> |
5939 |
30 Jan 12 |
nicklas |
287 |
<tbl:headers> |
5939 |
30 Jan 12 |
nicklas |
288 |
<tbl:headerrow> |
5939 |
30 Jan 12 |
nicklas |
289 |
<tbl:columnheaders /> |
5939 |
30 Jan 12 |
nicklas |
290 |
</tbl:headerrow> |
5939 |
30 Jan 12 |
nicklas |
291 |
</tbl:headers> |
5045 |
12 Aug 09 |
martin |
292 |
<tbl:rows> |
5045 |
12 Aug 09 |
martin |
293 |
<% |
5045 |
12 Aug 09 |
martin |
294 |
for (Group group : groups) |
5045 |
12 Aug 09 |
martin |
295 |
{ |
5045 |
12 Aug 09 |
martin |
296 |
Set<Permission> permissions = project.getPermissions(group); |
5045 |
12 Aug 09 |
martin |
297 |
%> |
5045 |
12 Aug 09 |
martin |
298 |
<tbl:row> |
5045 |
12 Aug 09 |
martin |
299 |
<tbl:cell column="type">Group</tbl:cell> |
5045 |
12 Aug 09 |
martin |
300 |
<tbl:cell column="name"><base:icon |
5946 |
03 Feb 12 |
nicklas |
301 |
image="deleted.png" |
5045 |
12 Aug 09 |
martin |
302 |
tooltip="This item has been scheduled for deletion" |
5045 |
12 Aug 09 |
martin |
303 |
visible="<%=group.isRemoved()%>" |
5045 |
12 Aug 09 |
martin |
304 |
/><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> |
7214 |
19 Oct 16 |
nicklas |
305 |
<tbl:cell column="permissions"><%=PermissionUtil.getFullPermissionNames(permissions, "Annotate")%></tbl:cell> |
5045 |
12 Aug 09 |
martin |
306 |
</tbl:row> |
5045 |
12 Aug 09 |
martin |
307 |
<% |
5045 |
12 Aug 09 |
martin |
308 |
} |
5045 |
12 Aug 09 |
martin |
309 |
for (User user : users) |
5045 |
12 Aug 09 |
martin |
310 |
{ |
5045 |
12 Aug 09 |
martin |
311 |
Set<Permission> permissions = project.getPermissions(user); |
5045 |
12 Aug 09 |
martin |
312 |
%> |
5045 |
12 Aug 09 |
martin |
313 |
<tbl:row> |
5045 |
12 Aug 09 |
martin |
314 |
<tbl:cell column="type">User</tbl:cell> |
5045 |
12 Aug 09 |
martin |
315 |
<tbl:cell column="name"><base:icon |
5946 |
03 Feb 12 |
nicklas |
316 |
image="deleted.png" |
5045 |
12 Aug 09 |
martin |
317 |
tooltip="This item has been scheduled for deletion" |
5045 |
12 Aug 09 |
martin |
318 |
visible="<%=user.isRemoved()%>" |
5045 |
12 Aug 09 |
martin |
319 |
/><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> |
7214 |
19 Oct 16 |
nicklas |
320 |
<tbl:cell column="permissions"><%=PermissionUtil.getFullPermissionNames(permissions, "Annotate")%></tbl:cell> |
5045 |
12 Aug 09 |
martin |
321 |
</tbl:row> |
5045 |
12 Aug 09 |
martin |
322 |
<% |
5045 |
12 Aug 09 |
martin |
323 |
} |
5045 |
12 Aug 09 |
martin |
324 |
%> |
5045 |
12 Aug 09 |
martin |
325 |
</tbl:rows> |
5045 |
12 Aug 09 |
martin |
326 |
</tbl:data> |
5045 |
12 Aug 09 |
martin |
327 |
</tbl:table> |
5939 |
30 Jan 12 |
nicklas |
328 |
<% |
5939 |
30 Jan 12 |
nicklas |
329 |
} |
5939 |
30 Jan 12 |
nicklas |
330 |
%> |
5045 |
12 Aug 09 |
martin |
331 |
</base:section> |
5650 |
01 Jun 11 |
nicklas |
332 |
<% |
5650 |
01 Jun 11 |
nicklas |
333 |
List<BasicItem> defaultItems = project.getDefaultItems(dc); |
5939 |
30 Jan 12 |
nicklas |
334 |
%> |
5045 |
12 Aug 09 |
martin |
335 |
<base:section |
5045 |
12 Aug 09 |
martin |
336 |
id="defaultSection" |
5650 |
01 Jun 11 |
nicklas |
337 |
title="Default items" |
5045 |
12 Aug 09 |
martin |
338 |
context="<%=cc%>" |
1895 |
02 Feb 06 |
nicklas |
339 |
> |
5939 |
30 Jan 12 |
nicklas |
340 |
<% |
5939 |
30 Jan 12 |
nicklas |
341 |
if (defaultItems.size() == 0 && project.getDefaultRawDataType() == null) |
5939 |
30 Jan 12 |
nicklas |
342 |
{ |
5939 |
30 Jan 12 |
nicklas |
343 |
%> |
5939 |
30 Jan 12 |
nicklas |
344 |
<div class="messagecontainer note"> |
5939 |
30 Jan 12 |
nicklas |
345 |
There are no default items in this project |
5939 |
30 Jan 12 |
nicklas |
346 |
(or, you don't have permission to view them). |
5939 |
30 Jan 12 |
nicklas |
347 |
</div> |
5939 |
30 Jan 12 |
nicklas |
348 |
<% |
5939 |
30 Jan 12 |
nicklas |
349 |
} |
5939 |
30 Jan 12 |
nicklas |
350 |
else |
5939 |
30 Jan 12 |
nicklas |
351 |
{ |
5939 |
30 Jan 12 |
nicklas |
352 |
%> |
5939 |
30 Jan 12 |
nicklas |
353 |
<tbl:table |
5939 |
30 Jan 12 |
nicklas |
354 |
id="defaults" |
5939 |
30 Jan 12 |
nicklas |
355 |
columns="all" |
5939 |
30 Jan 12 |
nicklas |
356 |
> |
5939 |
30 Jan 12 |
nicklas |
357 |
<tbl:columndef |
5939 |
30 Jan 12 |
nicklas |
358 |
id="item" |
5939 |
30 Jan 12 |
nicklas |
359 |
title="Item" |
5939 |
30 Jan 12 |
nicklas |
360 |
/> |
5939 |
30 Jan 12 |
nicklas |
361 |
<tbl:columndef |
5939 |
30 Jan 12 |
nicklas |
362 |
id="type" |
5939 |
30 Jan 12 |
nicklas |
363 |
title="Type" |
5939 |
30 Jan 12 |
nicklas |
364 |
/> |
5939 |
30 Jan 12 |
nicklas |
365 |
<tbl:data> |
5939 |
30 Jan 12 |
nicklas |
366 |
<tbl:headers> |
5939 |
30 Jan 12 |
nicklas |
367 |
<tbl:headerrow> |
5939 |
30 Jan 12 |
nicklas |
368 |
<tbl:columnheaders /> |
5939 |
30 Jan 12 |
nicklas |
369 |
</tbl:headerrow> |
5939 |
30 Jan 12 |
nicklas |
370 |
</tbl:headers> |
5045 |
12 Aug 09 |
martin |
371 |
<tbl:rows> |
5650 |
01 Jun 11 |
nicklas |
372 |
<% |
5650 |
01 Jun 11 |
nicklas |
373 |
if (project.getDefaultRawDataType() != null) |
2947 |
23 Nov 06 |
martin |
374 |
{ |
5650 |
01 Jun 11 |
nicklas |
375 |
%> |
5650 |
01 Jun 11 |
nicklas |
376 |
<tbl:row> |
5650 |
01 Jun 11 |
nicklas |
377 |
<tbl:cell column="item"><%=project.getDefaultRawDataType().getName()%></tbl:cell> |
5650 |
01 Jun 11 |
nicklas |
378 |
<tbl:cell column="type">Raw data type</tbl:cell> |
5650 |
01 Jun 11 |
nicklas |
379 |
</tbl:row> |
5650 |
01 Jun 11 |
nicklas |
380 |
<% |
5650 |
01 Jun 11 |
nicklas |
381 |
} |
5650 |
01 Jun 11 |
nicklas |
382 |
for (BasicItem item : defaultItems) |
5650 |
01 Jun 11 |
nicklas |
383 |
{ |
5650 |
01 Jun 11 |
nicklas |
384 |
%> |
5650 |
01 Jun 11 |
nicklas |
385 |
<tbl:row> |
5650 |
01 Jun 11 |
nicklas |
386 |
<tbl:cell column="item"><base:propertyvalue item="<%=item%>" /></tbl:cell> |
5650 |
01 Jun 11 |
nicklas |
387 |
<tbl:cell column="type"> |
5650 |
01 Jun 11 |
nicklas |
388 |
<% |
5650 |
01 Jun 11 |
nicklas |
389 |
if (item instanceof Subtypable) |
5045 |
12 Aug 09 |
martin |
390 |
{ |
5650 |
01 Jun 11 |
nicklas |
391 |
%> |
5650 |
01 Jun 11 |
nicklas |
392 |
<base:propertyvalue item="<%=item%>" property="itemSubtype" nulltext="" /> (<%=item.getType()%>) |
5650 |
01 Jun 11 |
nicklas |
393 |
<% |
5045 |
12 Aug 09 |
martin |
394 |
} |
5650 |
01 Jun 11 |
nicklas |
395 |
else |
5650 |
01 Jun 11 |
nicklas |
396 |
{ |
5650 |
01 Jun 11 |
nicklas |
397 |
%> |
5650 |
01 Jun 11 |
nicklas |
398 |
<%=item.getType()%> |
5650 |
01 Jun 11 |
nicklas |
399 |
<% |
5650 |
01 Jun 11 |
nicklas |
400 |
} |
5650 |
01 Jun 11 |
nicklas |
401 |
%> |
5650 |
01 Jun 11 |
nicklas |
402 |
</tbl:cell> |
5650 |
01 Jun 11 |
nicklas |
403 |
</tbl:row> |
5650 |
01 Jun 11 |
nicklas |
404 |
<% |
2947 |
23 Nov 06 |
martin |
405 |
} |
5045 |
12 Aug 09 |
martin |
406 |
%> |
5045 |
12 Aug 09 |
martin |
407 |
</tbl:rows> |
5045 |
12 Aug 09 |
martin |
408 |
</tbl:data> |
5045 |
12 Aug 09 |
martin |
409 |
</tbl:table> |
5939 |
30 Jan 12 |
nicklas |
410 |
<% |
5650 |
01 Jun 11 |
nicklas |
411 |
} |
5650 |
01 Jun 11 |
nicklas |
412 |
%> |
5939 |
30 Jan 12 |
nicklas |
413 |
</base:section> |
5502 |
18 Nov 10 |
nicklas |
414 |
<jsp:include page="../../common/anytoany/list_anytoany.jsp"> |
5502 |
18 Nov 10 |
nicklas |
415 |
<jsp:param name="ID" value="<%=ID%>" /> |
5502 |
18 Nov 10 |
nicklas |
416 |
<jsp:param name="item_type" value="<%=itemType.name()%>" /> |
5502 |
18 Nov 10 |
nicklas |
417 |
<jsp:param name="item_id" value="<%=itemId%>" /> |
5502 |
18 Nov 10 |
nicklas |
418 |
<jsp:param name="title" value="Other items related to this project" /> |
5502 |
18 Nov 10 |
nicklas |
419 |
</jsp:include> |
5939 |
30 Jan 12 |
nicklas |
420 |
</t:tab> |
1895 |
02 Feb 06 |
nicklas |
421 |
|
5939 |
30 Jan 12 |
nicklas |
422 |
<t:tab id="items" title="Items" tooltip="List all items in this project" /> |
7199 |
17 Oct 16 |
nicklas |
423 |
<t:tab id="annotations" title="Annotations" |
7199 |
17 Oct 16 |
nicklas |
424 |
tooltip="View annotation values" clazz="white"> |
7199 |
17 Oct 16 |
nicklas |
425 |
<jsp:include page="../../common/annotations/list_frameset.jsp"> |
7199 |
17 Oct 16 |
nicklas |
426 |
<jsp:param name="item_type" value="<%=itemType.name()%>" /> |
7199 |
17 Oct 16 |
nicklas |
427 |
<jsp:param name="item_id" value="<%=itemId%>" /> |
7199 |
17 Oct 16 |
nicklas |
428 |
<jsp:param name="ID" value="<%=ID%>" /> |
7199 |
17 Oct 16 |
nicklas |
429 |
</jsp:include> |
7199 |
17 Oct 16 |
nicklas |
430 |
</t:tab> |
7199 |
17 Oct 16 |
nicklas |
431 |
<t:tab id="history" title="History" |
7199 |
17 Oct 16 |
nicklas |
432 |
tooltip="Displays a log with the history of this item" |
7199 |
17 Oct 16 |
nicklas |
433 |
visible="<%=ChangeHistoryUtil.showChangeHistoryTab(sc)%>"> |
7199 |
17 Oct 16 |
nicklas |
434 |
<jsp:include page="../../common/history/frameset.jsp"> |
7199 |
17 Oct 16 |
nicklas |
435 |
<jsp:param name="item_type" value="<%=itemType.name()%>" /> |
7199 |
17 Oct 16 |
nicklas |
436 |
<jsp:param name="item_id" value="<%=itemId%>" /> |
7199 |
17 Oct 16 |
nicklas |
437 |
<jsp:param name="ID" value="<%=ID%>" /> |
7199 |
17 Oct 16 |
nicklas |
438 |
</jsp:include> |
7199 |
17 Oct 16 |
nicklas |
439 |
</t:tab> |
5939 |
30 Jan 12 |
nicklas |
440 |
</t:tabcontrol> |
1895 |
02 Feb 06 |
nicklas |
441 |
|
1895 |
02 Feb 06 |
nicklas |
442 |
</base:body> |
1895 |
02 Feb 06 |
nicklas |
443 |
</base:page> |
1895 |
02 Feb 06 |
nicklas |
444 |
<% |
5650 |
01 Jun 11 |
nicklas |
445 |
dc.commit(); |
1895 |
02 Feb 06 |
nicklas |
446 |
} |
1895 |
02 Feb 06 |
nicklas |
447 |
finally |
1895 |
02 Feb 06 |
nicklas |
448 |
{ |
1895 |
02 Feb 06 |
nicklas |
449 |
if (dc != null) dc.close(); |
1895 |
02 Feb 06 |
nicklas |
450 |
} |
1895 |
02 Feb 06 |
nicklas |
451 |
|
1895 |
02 Feb 06 |
nicklas |
452 |
%> |