5370 |
23 Jun 10 |
nicklas |
1 |
<%-- $Id$ |
5370 |
23 Jun 10 |
nicklas |
2 |
------------------------------------------------------------------ |
5370 |
23 Jun 10 |
nicklas |
Copyright (C) 2010 Nicklas Nordborg |
5370 |
23 Jun 10 |
nicklas |
4 |
|
5370 |
23 Jun 10 |
nicklas |
5 |
This file is part of BASE - BioArray Software Environment. |
5370 |
23 Jun 10 |
nicklas |
6 |
Available at http://base.thep.lu.se/ |
5370 |
23 Jun 10 |
nicklas |
7 |
|
5370 |
23 Jun 10 |
nicklas |
8 |
BASE is free software; you can redistribute it and/or |
5370 |
23 Jun 10 |
nicklas |
9 |
modify it under the terms of the GNU General Public License |
5370 |
23 Jun 10 |
nicklas |
10 |
as published by the Free Software Foundation; either version 3 |
5370 |
23 Jun 10 |
nicklas |
11 |
of the License, or (at your option) any later version. |
5370 |
23 Jun 10 |
nicklas |
12 |
|
5370 |
23 Jun 10 |
nicklas |
13 |
BASE is distributed in the hope that it will be useful, |
5370 |
23 Jun 10 |
nicklas |
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
5370 |
23 Jun 10 |
nicklas |
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5370 |
23 Jun 10 |
nicklas |
16 |
GNU General Public License for more details. |
5370 |
23 Jun 10 |
nicklas |
17 |
|
5370 |
23 Jun 10 |
nicklas |
18 |
You should have received a copy of the GNU General Public License |
5370 |
23 Jun 10 |
nicklas |
19 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
5370 |
23 Jun 10 |
nicklas |
20 |
------------------------------------------------------------------ |
5370 |
23 Jun 10 |
nicklas |
21 |
|
5370 |
23 Jun 10 |
nicklas |
22 |
@author Nicklas |
5370 |
23 Jun 10 |
nicklas |
23 |
--%> |
5426 |
24 Sep 10 |
nicklas |
24 |
<%@ page pageEncoding="UTF-8" session="false" |
5370 |
23 Jun 10 |
nicklas |
25 |
import="net.sf.basedb.core.SessionControl" |
5370 |
23 Jun 10 |
nicklas |
26 |
import="net.sf.basedb.core.DbControl" |
5370 |
23 Jun 10 |
nicklas |
27 |
import="net.sf.basedb.core.Item" |
5370 |
23 Jun 10 |
nicklas |
28 |
import="net.sf.basedb.core.PermissionTemplate" |
5370 |
23 Jun 10 |
nicklas |
29 |
import="net.sf.basedb.core.ItemQuery" |
5370 |
23 Jun 10 |
nicklas |
30 |
import="net.sf.basedb.core.ItemResultIterator" |
5370 |
23 Jun 10 |
nicklas |
31 |
import="net.sf.basedb.core.ItemContext" |
5370 |
23 Jun 10 |
nicklas |
32 |
import="net.sf.basedb.core.Nameable" |
5370 |
23 Jun 10 |
nicklas |
33 |
import="net.sf.basedb.core.Permission" |
5370 |
23 Jun 10 |
nicklas |
34 |
import="net.sf.basedb.core.PluginDefinition" |
5370 |
23 Jun 10 |
nicklas |
35 |
import="net.sf.basedb.core.plugin.GuiContext" |
5370 |
23 Jun 10 |
nicklas |
36 |
import="net.sf.basedb.core.plugin.Plugin" |
5370 |
23 Jun 10 |
nicklas |
37 |
import="net.sf.basedb.core.query.Hql" |
5370 |
23 Jun 10 |
nicklas |
38 |
import="net.sf.basedb.core.query.Orders" |
5370 |
23 Jun 10 |
nicklas |
39 |
import="net.sf.basedb.clients.web.Base" |
5370 |
23 Jun 10 |
nicklas |
40 |
import="net.sf.basedb.clients.web.PermissionUtil" |
5370 |
23 Jun 10 |
nicklas |
41 |
import="net.sf.basedb.clients.web.ModeInfo" |
5370 |
23 Jun 10 |
nicklas |
42 |
import="net.sf.basedb.clients.web.util.HTML" |
5370 |
23 Jun 10 |
nicklas |
43 |
import="net.sf.basedb.util.ShareableUtil" |
5370 |
23 Jun 10 |
nicklas |
44 |
import="net.sf.basedb.util.Values" |
5370 |
23 Jun 10 |
nicklas |
45 |
import="net.sf.basedb.util.formatter.Formatter" |
5370 |
23 Jun 10 |
nicklas |
46 |
import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
5370 |
23 Jun 10 |
nicklas |
47 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
5370 |
23 Jun 10 |
nicklas |
48 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
5370 |
23 Jun 10 |
nicklas |
49 |
import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer" |
7604 |
25 Feb 19 |
nicklas |
50 |
import="net.sf.basedb.clients.web.extensions.toolbar.ButtonAction" |
5370 |
23 Jun 10 |
nicklas |
51 |
import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil" |
7604 |
25 Feb 19 |
nicklas |
52 |
import="net.sf.basedb.clients.web.extensions.list.ListColumnAction" |
6040 |
30 Mar 12 |
nicklas |
53 |
import="net.sf.basedb.clients.web.extensions.list.ListColumnUtil" |
5370 |
23 Jun 10 |
nicklas |
54 |
import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
5370 |
23 Jun 10 |
nicklas |
55 |
import="java.util.Date" |
5370 |
23 Jun 10 |
nicklas |
56 |
import="java.util.Iterator" |
5370 |
23 Jun 10 |
nicklas |
57 |
import="java.util.List" |
5370 |
23 Jun 10 |
nicklas |
58 |
import="java.util.Map" |
5370 |
23 Jun 10 |
nicklas |
59 |
%> |
5370 |
23 Jun 10 |
nicklas |
60 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
5370 |
23 Jun 10 |
nicklas |
61 |
<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
5370 |
23 Jun 10 |
nicklas |
62 |
<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
5370 |
23 Jun 10 |
nicklas |
63 |
<%! |
5370 |
23 Jun 10 |
nicklas |
64 |
private static final Item itemType = Item.PERMISSIONTEMPLATE; |
5370 |
23 Jun 10 |
nicklas |
65 |
private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.LIST); |
5370 |
23 Jun 10 |
nicklas |
66 |
%> |
5370 |
23 Jun 10 |
nicklas |
67 |
<% |
5370 |
23 Jun 10 |
nicklas |
68 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, Permission.DENIED, itemType); |
5370 |
23 Jun 10 |
nicklas |
69 |
final String ID = sc.getId(); |
5370 |
23 Jun 10 |
nicklas |
70 |
final boolean createPermission = sc.hasPermission(Permission.CREATE, itemType); |
5370 |
23 Jun 10 |
nicklas |
71 |
final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
5370 |
23 Jun 10 |
nicklas |
72 |
|
5370 |
23 Jun 10 |
nicklas |
73 |
final ModeInfo mode = ModeInfo.get(request.getParameter("mode")); |
5370 |
23 Jun 10 |
nicklas |
74 |
final String callback = request.getParameter("callback"); |
5370 |
23 Jun 10 |
nicklas |
75 |
final String title = mode.generateTitle("permission template", "permission templates"); |
7954 |
12 May 21 |
nicklas |
76 |
final DbControl dc = sc.newDbControl(":List "+itemType); |
5370 |
23 Jun 10 |
nicklas |
77 |
ItemResultIterator<PermissionTemplate> templates = null; |
5370 |
23 Jun 10 |
nicklas |
78 |
try |
5370 |
23 Jun 10 |
nicklas |
79 |
{ |
5370 |
23 Jun 10 |
nicklas |
80 |
Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); |
5370 |
23 Jun 10 |
nicklas |
81 |
Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); |
7914 |
23 Feb 21 |
nicklas |
82 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, null); |
5370 |
23 Jun 10 |
nicklas |
83 |
try |
5370 |
23 Jun 10 |
nicklas |
84 |
{ |
7914 |
23 Feb 21 |
nicklas |
85 |
final ItemQuery<PermissionTemplate> query = Base.getConfiguredQuery(dc, cc, jspContext, true, PermissionTemplate.getQuery(), mode); |
5370 |
23 Jun 10 |
nicklas |
86 |
templates = query.iterate(dc); |
5370 |
23 Jun 10 |
nicklas |
87 |
} |
5370 |
23 Jun 10 |
nicklas |
88 |
catch (Throwable t) |
5370 |
23 Jun 10 |
nicklas |
89 |
{ |
5370 |
23 Jun 10 |
nicklas |
90 |
cc.setMessage(t.getMessage()); |
5370 |
23 Jun 10 |
nicklas |
91 |
t.printStackTrace(); |
5370 |
23 Jun 10 |
nicklas |
92 |
} |
5370 |
23 Jun 10 |
nicklas |
93 |
int numListed = 0; |
7604 |
25 Feb 19 |
nicklas |
94 |
ExtensionsInvoker<ButtonAction> invoker = ToolbarUtil.useExtensions(jspContext); |
7604 |
25 Feb 19 |
nicklas |
95 |
ExtensionsInvoker<ListColumnAction<PermissionTemplate,?>> columnsInvoker = ListColumnUtil.useExtensions(jspContext); |
5370 |
23 Jun 10 |
nicklas |
96 |
%> |
6311 |
23 Aug 13 |
nicklas |
97 |
<base:page title="<%=title==null ? "Permission templates" : title%>" type="<%=mode.getPageType()%>" id="list-page"> |
6311 |
23 Aug 13 |
nicklas |
98 |
<base:head scripts="table.js,~templates.js" styles="table.css,toolbar.css"> |
5370 |
23 Jun 10 |
nicklas |
99 |
<ext:scripts context="<%=jspContext%>" /> |
5370 |
23 Jun 10 |
nicklas |
100 |
<ext:stylesheets context="<%=jspContext%>" /> |
5370 |
23 Jun 10 |
nicklas |
101 |
</base:head> |
5370 |
23 Jun 10 |
nicklas |
102 |
|
5370 |
23 Jun 10 |
nicklas |
103 |
<base:body> |
5952 |
10 Feb 12 |
nicklas |
104 |
<h1><%=title==null ? "Permission templates" : title%></h1> |
5952 |
10 Feb 12 |
nicklas |
105 |
<div class="content"> |
5370 |
23 Jun 10 |
nicklas |
106 |
<tbl:table |
5370 |
23 Jun 10 |
nicklas |
107 |
id="templates" |
5370 |
23 Jun 10 |
nicklas |
108 |
columns="<%=cc.getSetting("columns")%>" |
5370 |
23 Jun 10 |
nicklas |
109 |
sortby="<%=cc.getSortProperty()%>" |
5370 |
23 Jun 10 |
nicklas |
110 |
direction="<%=cc.getSortDirection()%>" |
5370 |
23 Jun 10 |
nicklas |
111 |
action="index.jsp" |
5370 |
23 Jun 10 |
nicklas |
112 |
sc="<%=sc%>" |
5370 |
23 Jun 10 |
nicklas |
113 |
item="<%=itemType%>" |
6703 |
02 Feb 15 |
nicklas |
114 |
filterrows="<%=cc.getFilterRows()%>" |
5952 |
10 Feb 12 |
nicklas |
115 |
subclass="fulltable" |
7982 |
14 Jun 21 |
nicklas |
116 |
stickyheaders="<%=cc.getSetting("columns.sticky", "name")%>" |
5370 |
23 Jun 10 |
nicklas |
117 |
> |
5370 |
23 Jun 10 |
nicklas |
118 |
<tbl:hidden |
5370 |
23 Jun 10 |
nicklas |
119 |
name="mode" |
5370 |
23 Jun 10 |
nicklas |
120 |
value="<%=mode.getName()%>" |
5370 |
23 Jun 10 |
nicklas |
121 |
/> |
5370 |
23 Jun 10 |
nicklas |
122 |
<tbl:hidden |
5370 |
23 Jun 10 |
nicklas |
123 |
name="callback" |
5370 |
23 Jun 10 |
nicklas |
124 |
value="<%=callback%>" |
5370 |
23 Jun 10 |
nicklas |
125 |
skip="<%=callback == null%>" |
5370 |
23 Jun 10 |
nicklas |
126 |
/> |
5370 |
23 Jun 10 |
nicklas |
127 |
<tbl:columndef |
5370 |
23 Jun 10 |
nicklas |
128 |
id="name" |
5370 |
23 Jun 10 |
nicklas |
129 |
property="name" |
5370 |
23 Jun 10 |
nicklas |
130 |
datatype="string" |
5370 |
23 Jun 10 |
nicklas |
131 |
title="Name" |
5370 |
23 Jun 10 |
nicklas |
132 |
sortable="true" |
5370 |
23 Jun 10 |
nicklas |
133 |
filterable="true" |
5370 |
23 Jun 10 |
nicklas |
134 |
exportable="true" |
5370 |
23 Jun 10 |
nicklas |
135 |
show="always" |
5370 |
23 Jun 10 |
nicklas |
136 |
/> |
5370 |
23 Jun 10 |
nicklas |
137 |
<tbl:columndef |
5370 |
23 Jun 10 |
nicklas |
138 |
id="id" |
5370 |
23 Jun 10 |
nicklas |
139 |
clazz="uniquecol" |
5370 |
23 Jun 10 |
nicklas |
140 |
property="id" |
5370 |
23 Jun 10 |
nicklas |
141 |
datatype="int" |
5370 |
23 Jun 10 |
nicklas |
142 |
title="ID" |
5370 |
23 Jun 10 |
nicklas |
143 |
sortable="true" |
5370 |
23 Jun 10 |
nicklas |
144 |
filterable="true" |
5370 |
23 Jun 10 |
nicklas |
145 |
exportable="true" |
5370 |
23 Jun 10 |
nicklas |
146 |
/> |
5370 |
23 Jun 10 |
nicklas |
147 |
<tbl:columndef |
5370 |
23 Jun 10 |
nicklas |
148 |
id="owner" |
5370 |
23 Jun 10 |
nicklas |
149 |
property="owner.name" |
5370 |
23 Jun 10 |
nicklas |
150 |
datatype="string" |
5370 |
23 Jun 10 |
nicklas |
151 |
title="Owner" |
5370 |
23 Jun 10 |
nicklas |
152 |
sortable="true" |
5370 |
23 Jun 10 |
nicklas |
153 |
filterable="true" |
5370 |
23 Jun 10 |
nicklas |
154 |
exportable="true" |
5370 |
23 Jun 10 |
nicklas |
155 |
/> |
5370 |
23 Jun 10 |
nicklas |
156 |
<tbl:columndef |
5370 |
23 Jun 10 |
nicklas |
157 |
id="description" |
5370 |
23 Jun 10 |
nicklas |
158 |
property="description" |
5370 |
23 Jun 10 |
nicklas |
159 |
datatype="string" |
5370 |
23 Jun 10 |
nicklas |
160 |
title="Description" |
5370 |
23 Jun 10 |
nicklas |
161 |
sortable="true" |
5370 |
23 Jun 10 |
nicklas |
162 |
filterable="true" |
5370 |
23 Jun 10 |
nicklas |
163 |
exportable="true" |
5370 |
23 Jun 10 |
nicklas |
164 |
/> |
5370 |
23 Jun 10 |
nicklas |
165 |
<tbl:columndef |
5370 |
23 Jun 10 |
nicklas |
166 |
id="permission" |
5370 |
23 Jun 10 |
nicklas |
167 |
title="Permission" |
5370 |
23 Jun 10 |
nicklas |
168 |
/> |
5370 |
23 Jun 10 |
nicklas |
169 |
<tbl:columndef |
5370 |
23 Jun 10 |
nicklas |
170 |
id="sharedTo" |
5370 |
23 Jun 10 |
nicklas |
171 |
title="Shared to" |
5370 |
23 Jun 10 |
nicklas |
172 |
filterable="true" |
5370 |
23 Jun 10 |
nicklas |
173 |
filterproperty="!sharedTo.name" |
5370 |
23 Jun 10 |
nicklas |
174 |
datatype="string" |
5370 |
23 Jun 10 |
nicklas |
175 |
/> |
6040 |
30 Mar 12 |
nicklas |
176 |
<tbl:columndef |
6040 |
30 Mar 12 |
nicklas |
177 |
id="xt-columns" |
6040 |
30 Mar 12 |
nicklas |
178 |
extensions="<%=columnsInvoker%>" |
6040 |
30 Mar 12 |
nicklas |
179 |
jspcontext="<%=jspContext%>" |
6040 |
30 Mar 12 |
nicklas |
180 |
/> |
6604 |
18 Nov 14 |
nicklas |
181 |
<div class="panelgroup bg-filled-50 bottomborder"> |
5952 |
10 Feb 12 |
nicklas |
182 |
<tbl:toolbar |
5952 |
10 Feb 12 |
nicklas |
183 |
subclass="bottomborder" |
5952 |
10 Feb 12 |
nicklas |
184 |
visible="<%=mode.hasToolbar()%>" |
5952 |
10 Feb 12 |
nicklas |
185 |
> |
5952 |
10 Feb 12 |
nicklas |
186 |
<tbl:button |
6311 |
23 Aug 13 |
nicklas |
187 |
id="btnNewItem" |
5952 |
10 Feb 12 |
nicklas |
188 |
disabled="<%=!createPermission%>" |
5952 |
10 Feb 12 |
nicklas |
189 |
image="new.png" |
5952 |
10 Feb 12 |
nicklas |
190 |
title="New…" |
5952 |
10 Feb 12 |
nicklas |
191 |
tooltip="<%=createPermission ? "Create new permission template" : "You do not have permission to create permission templates"%>" |
5952 |
10 Feb 12 |
nicklas |
192 |
/> |
5952 |
10 Feb 12 |
nicklas |
193 |
<tbl:button |
6311 |
23 Aug 13 |
nicklas |
194 |
id="btnDeleteItems" |
5952 |
10 Feb 12 |
nicklas |
195 |
image="delete.png" |
5952 |
10 Feb 12 |
nicklas |
196 |
title="Delete" |
5952 |
10 Feb 12 |
nicklas |
197 |
tooltip="Delete the selected items" |
5952 |
10 Feb 12 |
nicklas |
198 |
/> |
5952 |
10 Feb 12 |
nicklas |
199 |
<tbl:button |
6311 |
23 Aug 13 |
nicklas |
200 |
id="btnRestoreItems" |
5952 |
10 Feb 12 |
nicklas |
201 |
image="restore.png" |
5952 |
10 Feb 12 |
nicklas |
202 |
title="Restore" |
5952 |
10 Feb 12 |
nicklas |
203 |
tooltip="Restore the selected (deleted) items" |
5952 |
10 Feb 12 |
nicklas |
204 |
/> |
5952 |
10 Feb 12 |
nicklas |
205 |
<tbl:button |
6311 |
23 Aug 13 |
nicklas |
206 |
id="btnShareItems" |
5952 |
10 Feb 12 |
nicklas |
207 |
image="share.png" |
5952 |
10 Feb 12 |
nicklas |
208 |
title="Share…" |
5952 |
10 Feb 12 |
nicklas |
209 |
tooltip="Share the selected items" |
5952 |
10 Feb 12 |
nicklas |
210 |
/> |
5952 |
10 Feb 12 |
nicklas |
211 |
<tbl:button |
6311 |
23 Aug 13 |
nicklas |
212 |
id="btnSetOwner" |
5952 |
10 Feb 12 |
nicklas |
213 |
image="take_ownership.png" |
5952 |
10 Feb 12 |
nicklas |
214 |
title="Set owner…" |
5952 |
10 Feb 12 |
nicklas |
215 |
tooltip="Change owner of the selected items" |
5952 |
10 Feb 12 |
nicklas |
216 |
/> |
5952 |
10 Feb 12 |
nicklas |
217 |
<tbl:button |
6311 |
23 Aug 13 |
nicklas |
218 |
id="btnColumns" |
5952 |
10 Feb 12 |
nicklas |
219 |
image="columns.png" |
5952 |
10 Feb 12 |
nicklas |
220 |
title="Columns…" |
5952 |
10 Feb 12 |
nicklas |
221 |
tooltip="Show, hide and re-order columns" |
5952 |
10 Feb 12 |
nicklas |
222 |
/> |
5952 |
10 Feb 12 |
nicklas |
223 |
<tbl:button |
6311 |
23 Aug 13 |
nicklas |
224 |
id="btnImport" |
6311 |
23 Aug 13 |
nicklas |
225 |
data-plugin-type="IMPORT" |
5952 |
10 Feb 12 |
nicklas |
226 |
image="import.png" |
5952 |
10 Feb 12 |
nicklas |
227 |
title="Import…" |
5952 |
10 Feb 12 |
nicklas |
228 |
tooltip="Import data" |
5952 |
10 Feb 12 |
nicklas |
229 |
visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>" |
5952 |
10 Feb 12 |
nicklas |
230 |
/> |
5952 |
10 Feb 12 |
nicklas |
231 |
<tbl:button |
6311 |
23 Aug 13 |
nicklas |
232 |
id="btnExport" |
6311 |
23 Aug 13 |
nicklas |
233 |
data-plugin-type="EXPORT" |
5952 |
10 Feb 12 |
nicklas |
234 |
image="export.png" |
5952 |
10 Feb 12 |
nicklas |
235 |
title="Export…" |
5952 |
10 Feb 12 |
nicklas |
236 |
tooltip="Export data" |
5952 |
10 Feb 12 |
nicklas |
237 |
visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>" |
5952 |
10 Feb 12 |
nicklas |
238 |
/> |
5952 |
10 Feb 12 |
nicklas |
239 |
<tbl:button |
6311 |
23 Aug 13 |
nicklas |
240 |
id="btnRunPlugin" |
6311 |
23 Aug 13 |
nicklas |
241 |
data-plugin-type="OTHER" |
5952 |
10 Feb 12 |
nicklas |
242 |
image="runplugin.png" |
5952 |
10 Feb 12 |
nicklas |
243 |
title="Run plugin…" |
5952 |
10 Feb 12 |
nicklas |
244 |
tooltip="Run a plugin" |
5952 |
10 Feb 12 |
nicklas |
245 |
visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>" |
5952 |
10 Feb 12 |
nicklas |
246 |
/> |
5952 |
10 Feb 12 |
nicklas |
247 |
<ext:render extensions="<%=invoker%>" context="<%=jspContext%>" |
7604 |
25 Feb 19 |
nicklas |
248 |
wrapper="<%=new PrefixSuffixRenderer<ButtonAction>(jspContext, "<td>", "</td>") %>"/> |
5952 |
10 Feb 12 |
nicklas |
249 |
</tbl:toolbar> |
5952 |
10 Feb 12 |
nicklas |
250 |
<tbl:panel> |
6182 |
23 Oct 12 |
nicklas |
251 |
<tbl:presetselector /> |
5952 |
10 Feb 12 |
nicklas |
252 |
<tbl:navigator |
5952 |
10 Feb 12 |
nicklas |
253 |
page="<%=cc.getPage()%>" |
5952 |
10 Feb 12 |
nicklas |
254 |
rowsperpage="<%=cc.getRowsPerPage()%>" |
5952 |
10 Feb 12 |
nicklas |
255 |
totalrows="<%=templates == null ? 0 : templates.getTotalCount()%>" |
5952 |
10 Feb 12 |
nicklas |
256 |
visible="<%=mode.hasNavigator()%>" |
5952 |
10 Feb 12 |
nicklas |
257 |
/> |
5952 |
10 Feb 12 |
nicklas |
258 |
</tbl:panel> |
5952 |
10 Feb 12 |
nicklas |
259 |
</div> |
5370 |
23 Jun 10 |
nicklas |
260 |
<tbl:data> |
5948 |
08 Feb 12 |
nicklas |
261 |
<tbl:headers> |
5948 |
08 Feb 12 |
nicklas |
262 |
<tbl:headerrow> |
7943 |
04 May 21 |
nicklas |
263 |
<tbl:header clazz="row-index bg-filled-100" /> |
5948 |
08 Feb 12 |
nicklas |
264 |
<tbl:columnheaders /> |
5948 |
08 Feb 12 |
nicklas |
265 |
</tbl:headerrow> |
6703 |
02 Feb 15 |
nicklas |
266 |
<% |
6703 |
02 Feb 15 |
nicklas |
267 |
int numFilters = cc.getNumPropertyFilters(); |
6703 |
02 Feb 15 |
nicklas |
268 |
int numRows = cc.getFilterRows(); |
6703 |
02 Feb 15 |
nicklas |
269 |
for (int filterNo = 0; filterNo < numRows; filterNo++) |
6703 |
02 Feb 15 |
nicklas |
270 |
{ |
6703 |
02 Feb 15 |
nicklas |
271 |
boolean lastRow = filterNo == numRows-1; |
6703 |
02 Feb 15 |
nicklas |
272 |
%> |
6703 |
02 Feb 15 |
nicklas |
273 |
<tbl:headerrow> |
7943 |
04 May 21 |
nicklas |
274 |
<tbl:header subclass="row-index bg-filled-100"> |
7943 |
04 May 21 |
nicklas |
275 |
<div class="index-<%=mode.getName()%>"> |
7943 |
04 May 21 |
nicklas |
276 |
<div class="index"></div> |
7943 |
04 May 21 |
nicklas |
277 |
<div class="check"> |
7943 |
04 May 21 |
nicklas |
278 |
<base:icon |
7943 |
04 May 21 |
nicklas |
279 |
subclass="link table-check" |
7943 |
04 May 21 |
nicklas |
280 |
image="check_uncheck.png" |
7943 |
04 May 21 |
nicklas |
281 |
tooltip="Toggle all (use CTRL, ALT or SHIFT to check/uncheck)" |
7943 |
04 May 21 |
nicklas |
282 |
visible="<%=lastRow && mode.hasCheck()%>" |
7943 |
04 May 21 |
nicklas |
283 |
/> |
7943 |
04 May 21 |
nicklas |
284 |
</div> |
7943 |
04 May 21 |
nicklas |
285 |
<div class="icons"> |
7943 |
04 May 21 |
nicklas |
286 |
<base:icon |
7943 |
04 May 21 |
nicklas |
287 |
subclass="link table-filter-row-action" |
7943 |
04 May 21 |
nicklas |
288 |
image="add.png" |
7943 |
04 May 21 |
nicklas |
289 |
tooltip="Add extra filter row" |
7943 |
04 May 21 |
nicklas |
290 |
visible="<%=lastRow%>" |
7943 |
04 May 21 |
nicklas |
291 |
/><base:icon |
7943 |
04 May 21 |
nicklas |
292 |
subclass="link table-filter-row-action" |
7943 |
04 May 21 |
nicklas |
293 |
image="remove.png" |
7943 |
04 May 21 |
nicklas |
294 |
tooltip="Remove this filter row" |
7943 |
04 May 21 |
nicklas |
295 |
visible="<%=numRows > 1 || numFilters > 0 %>" |
7943 |
04 May 21 |
nicklas |
296 |
data-remove-row="<%=filterNo%>" |
7943 |
04 May 21 |
nicklas |
297 |
/> |
7943 |
04 May 21 |
nicklas |
298 |
</div> |
7943 |
04 May 21 |
nicklas |
299 |
</div> |
6703 |
02 Feb 15 |
nicklas |
300 |
</tbl:header> |
6703 |
02 Feb 15 |
nicklas |
301 |
<tbl:propertyfilter row="<%=filterNo%>" /> |
6703 |
02 Feb 15 |
nicklas |
302 |
</tbl:headerrow> |
6703 |
02 Feb 15 |
nicklas |
303 |
<% |
6703 |
02 Feb 15 |
nicklas |
304 |
} |
6703 |
02 Feb 15 |
nicklas |
305 |
%> |
7913 |
22 Feb 21 |
nicklas |
306 |
<tbl:columnsubtitles /> |
5948 |
08 Feb 12 |
nicklas |
307 |
</tbl:headers> |
5948 |
08 Feb 12 |
nicklas |
308 |
<tbl:rows> |
5370 |
23 Jun 10 |
nicklas |
309 |
<% |
5952 |
10 Feb 12 |
nicklas |
310 |
if (cc.getMessage() != null) |
5952 |
10 Feb 12 |
nicklas |
311 |
{ |
5952 |
10 Feb 12 |
nicklas |
312 |
%> |
6604 |
18 Nov 14 |
nicklas |
313 |
<tbl:panel subclass="bg-filled-50"> |
5952 |
10 Feb 12 |
nicklas |
314 |
<div class="messagecontainer error"><%=cc.getMessage()%></div> |
5952 |
10 Feb 12 |
nicklas |
315 |
</tbl:panel> |
5952 |
10 Feb 12 |
nicklas |
316 |
<% |
5952 |
10 Feb 12 |
nicklas |
317 |
cc.setMessage(null); |
5952 |
10 Feb 12 |
nicklas |
318 |
} |
5370 |
23 Jun 10 |
nicklas |
319 |
int index = cc.getPage()*cc.getRowsPerPage(); |
5370 |
23 Jun 10 |
nicklas |
320 |
int selectedItemId = cc.getId(); |
5370 |
23 Jun 10 |
nicklas |
321 |
if (templates != null) |
5370 |
23 Jun 10 |
nicklas |
322 |
{ |
5370 |
23 Jun 10 |
nicklas |
323 |
while (templates.hasNext()) |
5370 |
23 Jun 10 |
nicklas |
324 |
{ |
5370 |
23 Jun 10 |
nicklas |
325 |
PermissionTemplate item = templates.next(); |
5370 |
23 Jun 10 |
nicklas |
326 |
int itemId = item.getId(); |
6221 |
10 Jan 13 |
nicklas |
327 |
|
5370 |
23 Jun 10 |
nicklas |
328 |
boolean deletePermission = item.hasPermission(Permission.DELETE); |
5370 |
23 Jun 10 |
nicklas |
329 |
boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); |
5370 |
23 Jun 10 |
nicklas |
330 |
boolean usePermission = item.hasPermission(Permission.USE); |
5370 |
23 Jun 10 |
nicklas |
331 |
boolean writePermission = item.hasPermission(Permission.WRITE); |
5370 |
23 Jun 10 |
nicklas |
332 |
String tooltip = mode.isSelectionMode() ? |
5370 |
23 Jun 10 |
nicklas |
333 |
"Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); |
5370 |
23 Jun 10 |
nicklas |
334 |
String name = HTML.encodeTags(item.getName()); |
5370 |
23 Jun 10 |
nicklas |
335 |
index++; |
5370 |
23 Jun 10 |
nicklas |
336 |
numListed++; |
5370 |
23 Jun 10 |
nicklas |
337 |
%> |
5370 |
23 Jun 10 |
nicklas |
338 |
<tbl:row> |
7943 |
04 May 21 |
nicklas |
339 |
<tbl:header clazz="row-index bg-filled-100"> |
7943 |
04 May 21 |
nicklas |
340 |
<div class="index-<%=mode.getName()%>"> |
7943 |
04 May 21 |
nicklas |
341 |
<div class="index <%=index>999?"index-smaller":""%>"><%=index%></div> |
7943 |
04 May 21 |
nicklas |
342 |
<div class="check"> |
7943 |
04 May 21 |
nicklas |
343 |
<base:input |
7943 |
04 May 21 |
nicklas |
344 |
type="checkbox" |
7943 |
04 May 21 |
nicklas |
345 |
name="<%=itemId%>" |
7943 |
04 May 21 |
nicklas |
346 |
value="<%=itemId%>" |
7943 |
04 May 21 |
nicklas |
347 |
title="<%=name%>" |
7943 |
04 May 21 |
nicklas |
348 |
checked="<%=cc.getSelected().contains(itemId)%>" |
7943 |
04 May 21 |
nicklas |
349 |
visible="<%=mode.hasCheck()%>" |
7943 |
04 May 21 |
nicklas |
350 |
/> |
7943 |
04 May 21 |
nicklas |
351 |
<base:input |
7943 |
04 May 21 |
nicklas |
352 |
type="radio" |
7943 |
04 May 21 |
nicklas |
353 |
name="item_id" |
7943 |
04 May 21 |
nicklas |
354 |
value="<%=itemId%>" |
7943 |
04 May 21 |
nicklas |
355 |
title="<%=name%>" |
7943 |
04 May 21 |
nicklas |
356 |
checked="<%=selectedItemId == itemId%>" |
7943 |
04 May 21 |
nicklas |
357 |
visible="<%=mode.hasRadio()%>" |
7943 |
04 May 21 |
nicklas |
358 |
/> |
7943 |
04 May 21 |
nicklas |
359 |
</div> |
7943 |
04 May 21 |
nicklas |
360 |
<div class="icons"> |
7943 |
04 May 21 |
nicklas |
361 |
<base:icon |
7943 |
04 May 21 |
nicklas |
362 |
image="deleted.png" |
7943 |
04 May 21 |
nicklas |
363 |
id="<%="delete."+itemId %>" |
7943 |
04 May 21 |
nicklas |
364 |
subclass="<%=deletePermission ? "table-delete-item" : "disabled" %>" |
7943 |
04 May 21 |
nicklas |
365 |
data-item-id="<%=itemId%>" |
7943 |
04 May 21 |
nicklas |
366 |
tooltip="This item has been scheduled for deletion" |
7943 |
04 May 21 |
nicklas |
367 |
visible="<%=item.isRemoved()%>" |
7943 |
04 May 21 |
nicklas |
368 |
/><base:icon |
7943 |
04 May 21 |
nicklas |
369 |
image="shared.png" |
7943 |
04 May 21 |
nicklas |
370 |
id="<%="share."+itemId %>" |
7943 |
04 May 21 |
nicklas |
371 |
subclass="<%=sharePermission ? "table-share-item" : "disabled" %>" |
7943 |
04 May 21 |
nicklas |
372 |
data-item-id="<%=itemId%>" |
7943 |
04 May 21 |
nicklas |
373 |
tooltip="This item is shared to other users, groups and/or projects" |
7943 |
04 May 21 |
nicklas |
374 |
visible="<%=item.isShared()%>" |
7943 |
04 May 21 |
nicklas |
375 |
/> |
7943 |
04 May 21 |
nicklas |
376 |
</div> |
7943 |
04 May 21 |
nicklas |
377 |
</div> |
7943 |
04 May 21 |
nicklas |
378 |
</tbl:header> |
6311 |
23 Aug 13 |
nicklas |
379 |
<tbl:cell column="name"><div |
6311 |
23 Aug 13 |
nicklas |
380 |
class="link table-item" |
6311 |
23 Aug 13 |
nicklas |
381 |
data-item-id="<%=itemId%>" |
6311 |
23 Aug 13 |
nicklas |
382 |
data-no-edit="<%=writePermission ? 0 : 1 %>" |
6311 |
23 Aug 13 |
nicklas |
383 |
tabindex="0" |
5370 |
23 Jun 10 |
nicklas |
384 |
title="<%=tooltip%>"><%=name%></div></tbl:cell> |
5370 |
23 Jun 10 |
nicklas |
385 |
<tbl:cell column="id"><%=item.getId()%></tbl:cell> |
5370 |
23 Jun 10 |
nicklas |
386 |
<tbl:cell column="owner" |
5370 |
23 Jun 10 |
nicklas |
387 |
><base:propertyvalue |
5370 |
23 Jun 10 |
nicklas |
388 |
item="<%=item%>" |
5370 |
23 Jun 10 |
nicklas |
389 |
property="owner" |
5370 |
23 Jun 10 |
nicklas |
390 |
enableEditLink="<%=mode.hasEditLink()%>" |
5370 |
23 Jun 10 |
nicklas |
391 |
enablePropertyLink="<%=mode.hasPropertyLink()%>" |
5370 |
23 Jun 10 |
nicklas |
392 |
/></tbl:cell> |
5370 |
23 Jun 10 |
nicklas |
393 |
<tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> |
5370 |
23 Jun 10 |
nicklas |
394 |
<tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell> |
5370 |
23 Jun 10 |
nicklas |
395 |
<tbl:cell column="sharedTo"> |
5370 |
23 Jun 10 |
nicklas |
396 |
<% |
5370 |
23 Jun 10 |
nicklas |
397 |
Iterator<Nameable> sharees = ShareableUtil.getSharedTo(dc, item).iterator(); |
5370 |
23 Jun 10 |
nicklas |
398 |
while(sharees.hasNext()) |
5370 |
23 Jun 10 |
nicklas |
399 |
{ |
5370 |
23 Jun 10 |
nicklas |
400 |
Nameable n = sharees.next(); |
5370 |
23 Jun 10 |
nicklas |
401 |
if (mode.hasPropertyLink()) |
5370 |
23 Jun 10 |
nicklas |
402 |
{ |
5370 |
23 Jun 10 |
nicklas |
403 |
out.write(Base.getLinkedName(ID, n, false, mode.hasEditLink())); |
5370 |
23 Jun 10 |
nicklas |
404 |
} |
5370 |
23 Jun 10 |
nicklas |
405 |
else |
5370 |
23 Jun 10 |
nicklas |
406 |
{ |
5370 |
23 Jun 10 |
nicklas |
407 |
out.write(HTML.encodeTags(n.getName())); |
5370 |
23 Jun 10 |
nicklas |
408 |
} |
5370 |
23 Jun 10 |
nicklas |
409 |
out.write(sharees.hasNext() ? ", " : ""); |
5370 |
23 Jun 10 |
nicklas |
410 |
} |
5370 |
23 Jun 10 |
nicklas |
411 |
%> |
5370 |
23 Jun 10 |
nicklas |
412 |
</tbl:cell> |
6040 |
30 Mar 12 |
nicklas |
413 |
<tbl:xt-cells dc="<%=dc%>" item="<%=item%>"> |
6040 |
30 Mar 12 |
nicklas |
414 |
<tbl:cell column="xt-columns" /> |
6040 |
30 Mar 12 |
nicklas |
415 |
</tbl:xt-cells> |
5370 |
23 Jun 10 |
nicklas |
416 |
</tbl:row> |
5370 |
23 Jun 10 |
nicklas |
417 |
<% |
5370 |
23 Jun 10 |
nicklas |
418 |
} |
5370 |
23 Jun 10 |
nicklas |
419 |
} |
5952 |
10 Feb 12 |
nicklas |
420 |
if (numListed == 0) |
5952 |
10 Feb 12 |
nicklas |
421 |
{ |
5952 |
10 Feb 12 |
nicklas |
422 |
%> |
6604 |
18 Nov 14 |
nicklas |
423 |
<tbl:panel subclass="bg-filled-50"> |
5952 |
10 Feb 12 |
nicklas |
424 |
<div class="messagecontainer note"> |
5952 |
10 Feb 12 |
nicklas |
425 |
<%=templates == null || templates.getTotalCount() == 0 ? "No permission templates were found" : "No permission templates on this page. Please select another page!" %> |
5952 |
10 Feb 12 |
nicklas |
426 |
</div> |
5952 |
10 Feb 12 |
nicklas |
427 |
</tbl:panel> |
5952 |
10 Feb 12 |
nicklas |
428 |
<% |
5952 |
10 Feb 12 |
nicklas |
429 |
} |
5370 |
23 Jun 10 |
nicklas |
430 |
%> |
5952 |
10 Feb 12 |
nicklas |
431 |
</tbl:rows> |
5370 |
23 Jun 10 |
nicklas |
432 |
</tbl:data> |
5370 |
23 Jun 10 |
nicklas |
433 |
</tbl:table> |
5952 |
10 Feb 12 |
nicklas |
434 |
</div> |
5952 |
10 Feb 12 |
nicklas |
435 |
|
5951 |
09 Feb 12 |
nicklas |
436 |
<base:buttongroup subclass="dialogbuttons"> |
6311 |
23 Aug 13 |
nicklas |
437 |
<base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" /> |
6311 |
23 Aug 13 |
nicklas |
438 |
<base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> |
6311 |
23 Aug 13 |
nicklas |
439 |
<base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" /> |
5370 |
23 Jun 10 |
nicklas |
440 |
</base:buttongroup> |
5951 |
09 Feb 12 |
nicklas |
441 |
|
5370 |
23 Jun 10 |
nicklas |
442 |
</base:body> |
5370 |
23 Jun 10 |
nicklas |
443 |
</base:page> |
5370 |
23 Jun 10 |
nicklas |
444 |
<% |
5370 |
23 Jun 10 |
nicklas |
445 |
} |
5370 |
23 Jun 10 |
nicklas |
446 |
finally |
5370 |
23 Jun 10 |
nicklas |
447 |
{ |
5370 |
23 Jun 10 |
nicklas |
448 |
if (templates != null) templates.close(); |
5370 |
23 Jun 10 |
nicklas |
449 |
if (dc != null) dc.close(); |
5370 |
23 Jun 10 |
nicklas |
450 |
} |
5370 |
23 Jun 10 |
nicklas |
451 |
%> |