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