1 | <%-- $Id: preferences.jsp 7502 2018-08-10 12:41:32Z nicklas $ |
---|
2 | ------------------------------------------------------------------ |
---|
3 | Copyright (C) 2005 Nicklas Nordborg |
---|
4 | Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson |
---|
5 | Copyright (C) 2007 Johan Enell, Nicklas Nordborg, Martin Svensson |
---|
6 | |
---|
7 | This file is part of BASE - BioArray Software Environment. |
---|
8 | Available at http://base.thep.lu.se/ |
---|
9 | |
---|
10 | BASE is free software; you can redistribute it and/or |
---|
11 | modify it under the terms of the GNU General Public License |
---|
12 | as published by the Free Software Foundation; either version 3 |
---|
13 | of the License, or (at your option) any later version. |
---|
14 | |
---|
15 | BASE is distributed in the hope that it will be useful, |
---|
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
18 | GNU General Public License for more details. |
---|
19 | |
---|
20 | You should have received a copy of the GNU General Public License |
---|
21 | along with BASE. If not, see <http://www.gnu.org/licenses/>. |
---|
22 | ------------------------------------------------------------------ |
---|
23 | |
---|
24 | This page is used to display and modify the preferences for |
---|
25 | the logged in user. It displays a tabbed dialogue: |
---|
26 | |
---|
27 | @param page |
---|
28 | The name active page of the tabbed dialog. |
---|
29 | - appearance: Font sizes, scale factor, etc. |
---|
30 | |
---|
31 | Saving the form invokes the submit_user.jsp page with cmd=SavePreferences |
---|
32 | |
---|
33 | @author Nicklas |
---|
34 | @version 2.0 |
---|
35 | --%> |
---|
36 | <%@ page pageEncoding="UTF-8" session="false" |
---|
37 | import="net.sf.basedb.core.SessionControl" |
---|
38 | import="net.sf.basedb.core.Item" |
---|
39 | import="net.sf.basedb.core.DbControl" |
---|
40 | import="net.sf.basedb.core.User" |
---|
41 | import="net.sf.basedb.core.Role" |
---|
42 | import="net.sf.basedb.core.Type" |
---|
43 | import="net.sf.basedb.core.Metadata" |
---|
44 | import="net.sf.basedb.core.ItemContext" |
---|
45 | import="net.sf.basedb.core.ItemQuery" |
---|
46 | import="net.sf.basedb.core.Permission" |
---|
47 | import="net.sf.basedb.core.query.Hql" |
---|
48 | import="net.sf.basedb.core.query.Restrictions" |
---|
49 | import="net.sf.basedb.core.query.Expressions" |
---|
50 | import="net.sf.basedb.core.query.Orders" |
---|
51 | import="net.sf.basedb.util.ToStringComparator" |
---|
52 | import="net.sf.basedb.clients.web.Base" |
---|
53 | import="net.sf.basedb.clients.web.util.HTML" |
---|
54 | import="net.sf.basedb.clients.web.formatter.FormatterSettings" |
---|
55 | import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
---|
56 | import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
---|
57 | import="net.sf.basedb.clients.web.extensions.JspContext" |
---|
58 | import="net.sf.basedb.clients.web.extensions.startpage.StartPageAction" |
---|
59 | import="net.sf.basedb.clients.web.extensions.edit.EditUtil" |
---|
60 | import="net.sf.basedb.clients.web.extensions.tabcontrol.TabAction" |
---|
61 | import="net.sf.basedb.util.Values" |
---|
62 | import="java.util.Collections" |
---|
63 | import="java.util.List" |
---|
64 | import="java.util.Set" |
---|
65 | import="java.util.TreeSet" |
---|
66 | import="java.util.HashSet" |
---|
67 | import="java.util.Arrays" |
---|
68 | import="java.util.Iterator" |
---|
69 | %> |
---|
70 | <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
---|
71 | <%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
---|
72 | <%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
---|
73 | <% |
---|
74 | final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
---|
75 | final String ID = sc.getId(); |
---|
76 | final float scale = Base.getScale(sc); |
---|
77 | final String activePage = Values.getStringOrNull(request.getParameter("page")); |
---|
78 | final DbControl dc = sc.newDbControl(); |
---|
79 | try |
---|
80 | { |
---|
81 | final User user = User.getById(dc, sc.getLoggedInUserId()); |
---|
82 | |
---|
83 | final String longTexts = Values.getString(sc.getUserClientSetting("text.long"), "display"); |
---|
84 | |
---|
85 | final boolean hasImages = Values.getBoolean(sc.getUserClientSetting("toolbar.images"), true); |
---|
86 | final boolean hasText = Values.getBoolean(sc.getUserClientSetting("toolbar.text"), true); |
---|
87 | |
---|
88 | final String minColor = Values.getString(sc.getUserClientSetting("ratiocolor.min"), "0000FF"); |
---|
89 | final String midColor = Values.getString(sc.getUserClientSetting("ratiocolor.mid"), "FFFFFF"); |
---|
90 | final String maxColor = Values.getString(sc.getUserClientSetting("ratiocolor.max"), "FFFF00"); |
---|
91 | |
---|
92 | final boolean rememberDialogPositions = Values.getBoolean(sc.getUserClientSetting("dialogs.remember-positions"), true); |
---|
93 | final String startPageId = sc.getUserClientSetting("start-page-id"); |
---|
94 | |
---|
95 | ItemContext cc = sc.getCurrentContext(Item.USERCLIENTSETTING); |
---|
96 | List<String> recentColors = cc.getRecent("colors"); |
---|
97 | List<String> recentDateFormats = cc.getRecent("dateFormats"); |
---|
98 | List<String> recentDateTimeFormats = cc.getRecent("dateTimeFormats"); |
---|
99 | |
---|
100 | // Load sticky items |
---|
101 | String mostRecent = Values.getString(sc.getUserClientSetting("menu.mostRecent"), |
---|
102 | "EXPERIMENT:BIOASSAYSET:TRANSFORMATION"); |
---|
103 | Set<String> stickyItems = new HashSet<String>(Arrays.asList(mostRecent.split(":"))); |
---|
104 | Set<Item> allItems = new TreeSet<Item>(new ToStringComparator<Item>(false)); |
---|
105 | allItems.addAll(Metadata.getOwnableItems()); |
---|
106 | allItems.add(Item.BIOASSAYSET); |
---|
107 | |
---|
108 | // Load roles |
---|
109 | List<Role> roles = null; |
---|
110 | Set<Integer> roleIds = sc.getAllRoles(); |
---|
111 | Set<Integer> defaultInactive = Collections.emptySet(); |
---|
112 | if (roleIds != null && roleIds.size() > 0) |
---|
113 | { |
---|
114 | ItemQuery<Role> roleQuery = Role.getQuery(); |
---|
115 | roleQuery.restrict(Restrictions.in(Hql.property("id"), Expressions.parameter("roles"))); |
---|
116 | roleQuery.setParameter("roles", roleIds, Type.INT); |
---|
117 | roleQuery.order(Orders.asc(Hql.property("name"))); |
---|
118 | roles = roleQuery.list(dc); |
---|
119 | |
---|
120 | String tmp = Values.getStringOrNull(sc.getUserClientSetting("inactiveRoles")); |
---|
121 | if (tmp != null) |
---|
122 | { |
---|
123 | defaultInactive = new HashSet<Integer>(Arrays.asList(Values.getInt(tmp.split(":")))); |
---|
124 | } |
---|
125 | } |
---|
126 | |
---|
127 | JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, null, user); |
---|
128 | ExtensionsInvoker<StartPageAction> invoker = (ExtensionsInvoker<StartPageAction>)ExtensionsControl.useExtensions(jspContext, "net.sf.basedb.clients.web.start-page"); |
---|
129 | ExtensionsInvoker<TabAction> tabsInvoker = (ExtensionsInvoker<TabAction>)ExtensionsControl.useExtensions(jspContext, EditUtil.EP_PREFIX_EDIT+"user-preferences"); |
---|
130 | %> |
---|
131 | <base:page type="popup" title="<%="Preferences for "+HTML.encodeTags(user.getName())%>" id="preferences"> |
---|
132 | <base:head scripts="tabcontrol-2.js,~preferences.js" styles="tabcontrol.css"> |
---|
133 | <ext:scripts context="<%=jspContext%>" /> |
---|
134 | <ext:stylesheets context="<%=jspContext%>" /> |
---|
135 | <style> |
---|
136 | .colorbox |
---|
137 | { |
---|
138 | margin: 2px; |
---|
139 | } |
---|
140 | </style> |
---|
141 | </base:head> |
---|
142 | <base:body> |
---|
143 | <h1>Preferences for <%=HTML.encodeTags(user.getName())%> <base:help tabcontrol="settings" /></h1> |
---|
144 | <form action="submit_user.jsp?ID=<%=ID%>" method="post" name="preferences"> |
---|
145 | <input type=hidden name="cmd" value="SavePreferences"> |
---|
146 | <input type="hidden" name="mincolor" id="mincolor" value="<%=minColor%>"> |
---|
147 | <input type="hidden" name="midcolor" id="midcolor" value="<%=midColor%>"> |
---|
148 | <input type="hidden" name="maxcolor" id="maxcolor" value="<%=maxColor%>"> |
---|
149 | |
---|
150 | <t:tabcontrol |
---|
151 | id="settings" |
---|
152 | subclass="content dialogtabcontrol" |
---|
153 | active="<%=activePage%>" remember="<%=activePage == null%>" |
---|
154 | extensions="<%=tabsInvoker%>" |
---|
155 | position="bottom"> |
---|
156 | <t:tab |
---|
157 | id="appearance" |
---|
158 | title="Appearance" |
---|
159 | helpid="userpreferences.appearance" |
---|
160 | > |
---|
161 | <table class="fullform"> |
---|
162 | <tr> |
---|
163 | <th>Font size</th> |
---|
164 | <td> |
---|
165 | <% |
---|
166 | String fontsize = Values.getString(sc.getUserClientSetting("appearance.fontsize"), "size_m.css"); |
---|
167 | %> |
---|
168 | <input type="radio" name="fontsize" id="fontsizeXS" value="size_xs.css" |
---|
169 | <%="size_xs.css".equals(fontsize) ? "checked" : ""%> |
---|
170 | data-scale="80" |
---|
171 | ><label for="fontsizeXS">XS</label> |
---|
172 | <input type="radio" name="fontsize" id="fontsizeS" value="size_s.css" |
---|
173 | <%="size_s.css".equals(fontsize) ? "checked" : ""%> |
---|
174 | data-scale="90" |
---|
175 | ><label for="fontsizeS">S</label> |
---|
176 | <input type="radio" name="fontsize" id="fontsizeM" value="size_m.css" |
---|
177 | <%="size_m.css".equals(fontsize) ? "checked" : ""%> |
---|
178 | data-scale="100" |
---|
179 | ><label for="fontsizeM">M</label> |
---|
180 | <input type="radio" name="fontsize" id="fontsizeL" value="size_l.css" |
---|
181 | <%="size_l.css".equals(fontsize) ? "checked" : ""%> |
---|
182 | data-scale="115" |
---|
183 | ><label for="fontsizeL">L</label> |
---|
184 | <input type="radio" name="fontsize" id="fontsizeXL" value="size_xl.css" |
---|
185 | <%="size_xl.css".equals(fontsize) ? "checked" : ""%> |
---|
186 | data-scale="130" |
---|
187 | ><label for="fontsizeXL">XL</label> |
---|
188 | </td> |
---|
189 | </tr> |
---|
190 | <tr> |
---|
191 | <th>Scale factor</th> |
---|
192 | <td> |
---|
193 | <input class="text required" type="text" name="scale" id="scale" |
---|
194 | value="<%=Values.getInt(sc.getUserClientSetting("appearance.scale"), 100)%>" |
---|
195 | size="4" maxlength="3">% |
---|
196 | (50 - 200) |
---|
197 | </td> |
---|
198 | </tr> |
---|
199 | <tr> |
---|
200 | <th>Display long texts</th> |
---|
201 | <td> |
---|
202 | <input type="radio" name="longTexts" id="longTextsAlways" value="display" |
---|
203 | <%="display".equals(longTexts) ? "checked" : "" %> |
---|
204 | ><label for="longTextsAlways">Always</label> |
---|
205 | <input type="radio" name="longTexts" id="longTextsHover" value="hover" |
---|
206 | <%="hover".equals(longTexts) ? "checked" : "" %> |
---|
207 | ><label for="longTextsHover">On hover</label> |
---|
208 | <input type="radio" name="longTexts" id="longTextsClick" value="click" |
---|
209 | <%="click".equals(longTexts) ? "checked" : "" %> |
---|
210 | ><label for="longTextsClick">On click</label> |
---|
211 | </td> |
---|
212 | </tr> |
---|
213 | <tr> |
---|
214 | <th>Toolbar</th> |
---|
215 | <td> |
---|
216 | <input type="radio" name="toolbar" id="toolbarBoth" value="both" |
---|
217 | <%=hasImages && hasText ? "checked" : "" %> |
---|
218 | ><label for="toolbarBoth">Images and text</label> |
---|
219 | <input type="radio" name="toolbar" id="toolbarImages" value="images" |
---|
220 | <%=hasImages && !hasText ? "checked" : "" %> |
---|
221 | ><label for="toolbarImages">Images only</label> |
---|
222 | <input type="radio" name="toolbar" id="toolbarText" value="text" |
---|
223 | <%=!hasImages && hasText ? "checked" : "" %> |
---|
224 | ><label for="toolbarText">Text only</label> |
---|
225 | </td> |
---|
226 | </tr> |
---|
227 | <tr> |
---|
228 | <th>Ratio color range</th> |
---|
229 | <td> |
---|
230 | <span id="btnMinColor" tabindex="0" class="link" data-dialog-title="Color for min value" data-color-box="mincolor" |
---|
231 | ><span id="mincolor.visual" style="background: #<%=minColor%>; display: inline-block;" class="colorbox large"> </span>Min</span> |
---|
232 | |
---|
233 | <span id="btnMidColor" tabindex="0" class="link" data-dialog-title="Color for midpoint value" data-color-box="midcolor" |
---|
234 | ><span id="midcolor.visual" style="background: #<%=midColor%>; display: inline-block;" class="colorbox large"> </span>Mid</span> |
---|
235 | |
---|
236 | <span id="btnMaxColor" tabindex="0" class="link" data-dialog-title="Color for max value" data-color-box="maxcolor" |
---|
237 | ><span id="maxcolor.visual" style="background: #<%=maxColor%>; display: inline-block;" class="colorbox large"> </span>Max</span> |
---|
238 | |
---|
239 | |
---|
240 | <select name="presets" id="colorPresets" class="selectionlist"> |
---|
241 | <option value="">- presets - |
---|
242 | <option value="FF0000,FFFF00,00FF00">Red - Yellow - Green |
---|
243 | <option value="0000FF,FFFFFF,FFFF00">Blue - White - Yellow |
---|
244 | <option value="000000,999999,FFFFFF">Black - Grey - White |
---|
245 | <% |
---|
246 | if (recentColors != null && recentColors.size() > 0) |
---|
247 | { |
---|
248 | %> |
---|
249 | <option value="" class="recentheader" disabled>- recently used - |
---|
250 | <% |
---|
251 | for (int i = 0; i < recentColors.size(); ++i) |
---|
252 | { |
---|
253 | String color = recentColors.get(i); |
---|
254 | %> |
---|
255 | <option value="<%=color%>" class="recent"><%=color%> |
---|
256 | <% |
---|
257 | } |
---|
258 | } |
---|
259 | %> |
---|
260 | </select> |
---|
261 | </td> |
---|
262 | </tr> |
---|
263 | <tr> |
---|
264 | <th>Date format</th> |
---|
265 | <td> |
---|
266 | <input class="text" type="text" name="date_format" |
---|
267 | value="<%=HTML.encodeTags(FormatterSettings.getDateFormat(sc))%>" |
---|
268 | size="20"> |
---|
269 | <select name="datePresets" id="datePresets" class="selectionlist"> |
---|
270 | <option value="">- presets - |
---|
271 | <option value="yyyy-MM-dd">yyyy-MM-dd |
---|
272 | <option value="d/M/yyyy">d/M/yyyy |
---|
273 | <option value="M/d/yyyy">M/d/yyyy |
---|
274 | <% |
---|
275 | if (recentDateFormats != null && recentDateFormats.size() > 0) |
---|
276 | { |
---|
277 | %> |
---|
278 | <option value="" class="recentheader" disabled>- recently used - |
---|
279 | <% |
---|
280 | for (int i = 0; i < recentDateFormats.size(); ++i) |
---|
281 | { |
---|
282 | String format = HTML.encodeTags(recentDateFormats.get(i)); |
---|
283 | %> |
---|
284 | <option value="<%=format%>" class="recent"><%=format%> |
---|
285 | <% |
---|
286 | } |
---|
287 | } |
---|
288 | %> |
---|
289 | </select> |
---|
290 | </td> |
---|
291 | </tr> |
---|
292 | |
---|
293 | <tr> |
---|
294 | <th>Date-time format</th> |
---|
295 | <td> |
---|
296 | <input class="text" type="text" name="datetime_format" |
---|
297 | value="<%=HTML.encodeTags(FormatterSettings.getDateTimeFormat(sc))%>" |
---|
298 | size="20"> |
---|
299 | <select name="dateTimePresets" id="dateTimePresets" class="selectionlist"> |
---|
300 | <option value="">- presets - |
---|
301 | <option value="yyyy-MM-dd HH:mm:ss">yyyy-MM-dd HH:mm:ss |
---|
302 | <option value="d/M/yyyy HH:mm:ss">d/M/yyyy HH:mm:ss |
---|
303 | <option value="M/d/yyyy HH:mm:ss">M/d/yyyy HH:mm:ss |
---|
304 | <% |
---|
305 | if (recentDateTimeFormats != null && recentDateTimeFormats.size() > 0) |
---|
306 | { |
---|
307 | %> |
---|
308 | <option value="" class="recentheader" disabled>- recently used - |
---|
309 | <% |
---|
310 | for (int i = 0; i < recentDateTimeFormats.size(); ++i) |
---|
311 | { |
---|
312 | String format = HTML.encodeTags(recentDateTimeFormats.get(i)); |
---|
313 | %> |
---|
314 | <option value="<%=format%>" class="recent"><%=format%> |
---|
315 | <% |
---|
316 | } |
---|
317 | } |
---|
318 | %> |
---|
319 | </select> |
---|
320 | </td> |
---|
321 | </tr> |
---|
322 | <% |
---|
323 | int numDecimals = FormatterSettings.getNumDecimals(sc); |
---|
324 | %> |
---|
325 | <tr> |
---|
326 | <th>Decimals</th> |
---|
327 | <td> |
---|
328 | <select name="decimals" style="width: 4em;"> |
---|
329 | <% |
---|
330 | for (int i = 0; i < 8; i++) |
---|
331 | { |
---|
332 | %> |
---|
333 | <option value="<%=i%>" <%=numDecimals == i ? "selected" : ""%>><%=i%> |
---|
334 | <% |
---|
335 | } |
---|
336 | %> |
---|
337 | <option value="-1" <%=numDecimals < 0 ? "selected" : ""%>>all |
---|
338 | </select> |
---|
339 | </td> |
---|
340 | </tr> |
---|
341 | <tr> |
---|
342 | <th>Dialogs</th> |
---|
343 | <td> |
---|
344 | <label id="rememberPositions"><input type="checkbox" name="remember_positions" value="1" |
---|
345 | <%=rememberDialogPositions ? "checked" : "" %> |
---|
346 | >Remember positions</label> |
---|
347 | </td> |
---|
348 | </tr> |
---|
349 | <tr> |
---|
350 | <th>Start page</th> |
---|
351 | <td> |
---|
352 | <select name="start_page" class="selectionlist"> |
---|
353 | <option value="" title="The BASE › Home page">BASE › Home |
---|
354 | <% |
---|
355 | Iterator<StartPageAction> it = invoker.iterator(); |
---|
356 | while (it.hasNext()) |
---|
357 | { |
---|
358 | try |
---|
359 | { |
---|
360 | StartPageAction action = it.next(); |
---|
361 | %> |
---|
362 | <option value="<%=action.getId()%>" |
---|
363 | title="<%=HTML.encodeTags(action.getDescription())%>" |
---|
364 | <%=action.getId().equals(startPageId) ? "selected": ""%> |
---|
365 | ><%=HTML.encodeTags(action.getName())%> |
---|
366 | <% |
---|
367 | } |
---|
368 | catch (RuntimeException ex) |
---|
369 | {} // Ignore exceptions thrown inside extensions |
---|
370 | } |
---|
371 | %> |
---|
372 | </select> |
---|
373 | </td> |
---|
374 | </tr> |
---|
375 | <tr class="dynamic"> |
---|
376 | <th></th> |
---|
377 | <td></td> |
---|
378 | </tr> |
---|
379 | </table> |
---|
380 | </t:tab> |
---|
381 | |
---|
382 | <t:tab |
---|
383 | id="plugins" |
---|
384 | title="Plugins" |
---|
385 | helpid="userpreferences.plugins" |
---|
386 | > |
---|
387 | <table class="fullform"> |
---|
388 | <tr> |
---|
389 | <th>Messages</th> |
---|
390 | <td> |
---|
391 | <% |
---|
392 | boolean sendMessage = Values.getBoolean(sc.getUserClientSetting("plugins.sendmessage"), true); |
---|
393 | %> |
---|
394 | <input type="checkbox" name="sendmessage" id="sendMessage" value="1" <%=sendMessage ? "checked" : ""%> |
---|
395 | ><label for="sendMessage">Send message when plugin completes</label> |
---|
396 | </td> |
---|
397 | </tr> |
---|
398 | <tr> |
---|
399 | <th>Remove jobs</th> |
---|
400 | <td> |
---|
401 | <% |
---|
402 | boolean removeJobWhenFinished = Values.getBoolean(sc.getUserClientSetting("plugins.removejob"), false); |
---|
403 | %> |
---|
404 | <input type="checkbox" name="removejob" id="removeJob" value="1" <%=removeJobWhenFinished ? "checked" : "" %> |
---|
405 | ><label for="removeJob">Remove import and export jobs when they are finished.</label> |
---|
406 | </td> |
---|
407 | </tr> |
---|
408 | <tr> |
---|
409 | <th>Show warnings</th> |
---|
410 | <td> |
---|
411 | <% |
---|
412 | boolean showWarnings = Values.getBoolean(sc.getUserClientSetting("plugins.showWarnings"), false); |
---|
413 | %> |
---|
414 | <input type="checkbox" name="show_warnings" id="showWarnings" value="1" <%=showWarnings ? "checked" : "" %> |
---|
415 | ><label for="showWarnings">Show plug-in warning messages when starting a new job.</label> |
---|
416 | </td> |
---|
417 | </tr> |
---|
418 | <tr class="dynamic"> |
---|
419 | <th></th> |
---|
420 | <td></td> |
---|
421 | </tr> |
---|
422 | </table> |
---|
423 | </t:tab> |
---|
424 | |
---|
425 | <t:tab |
---|
426 | id="mostRecent" |
---|
427 | title="Recent items" |
---|
428 | helpid="userpreferences.mostrecent" |
---|
429 | tooltip="Specify how many items to remember in lists of 'most recent items'" |
---|
430 | > |
---|
431 | <% |
---|
432 | boolean loadNames = Values.getBoolean(sc.getUserClientSetting("menu.mostRecent.loadNames"), true); |
---|
433 | %> |
---|
434 | <table class="fullform"> |
---|
435 | <tr > |
---|
436 | <th>Recently viewed items</th> |
---|
437 | <td> |
---|
438 | <input class="text required" type="text" name="maxViewed" id="maxViewed" |
---|
439 | value="<%=Values.getInt(sc.getUserClientSetting("menu.mostRecent.maxViewed"), 6)%>" |
---|
440 | size="4" maxlength="2"> |
---|
441 | (0 - 10) |
---|
442 | </td> |
---|
443 | </tr> |
---|
444 | <tr> |
---|
445 | <th>Recently used items</th> |
---|
446 | <td> |
---|
447 | <input class="text required" type="text" name="maxUsed" id="maxUsed" |
---|
448 | value="<%=Values.getInt(sc.getUserClientSetting("appearance.recent"), 4)%>" |
---|
449 | size="4" maxlength="2"> |
---|
450 | (0 - 10) |
---|
451 | </td> |
---|
452 | </tr> |
---|
453 | <tr> |
---|
454 | <th>Load item names</th> |
---|
455 | <td> |
---|
456 | <input type="checkbox" name="loadNames" id="loadNames" value="1" <%=loadNames ? "checked" : ""%>> |
---|
457 | <label for="loadNames">Load the names of all items</label> |
---|
458 | </td> |
---|
459 | </tr> |
---|
460 | <tr class="dynamic"> |
---|
461 | <th></th> |
---|
462 | <td> |
---|
463 | <table> |
---|
464 | <tr> |
---|
465 | <td> |
---|
466 | <base:buttongroup |
---|
467 | vertical="true"> |
---|
468 | <base:button |
---|
469 | id="moveUp" |
---|
470 | image="move_up.png" |
---|
471 | tooltip="Move up" |
---|
472 | subclass="square" |
---|
473 | data-down="0" |
---|
474 | /> |
---|
475 | <base:button |
---|
476 | id="moveDown" |
---|
477 | image="move_down.png" |
---|
478 | tooltip="Move down" |
---|
479 | subclass="square" |
---|
480 | data-down="1" |
---|
481 | /> |
---|
482 | </base:buttongroup> |
---|
483 | </td> |
---|
484 | <td> |
---|
485 | <b>Sticky items</b><br> |
---|
486 | <select name="sticky_items" id="stickyItems" multiple size="12" style="width: 12em;"> |
---|
487 | <% |
---|
488 | Iterator<Item> it = allItems.iterator(); |
---|
489 | while (it.hasNext()) |
---|
490 | { |
---|
491 | Item item = it.next(); |
---|
492 | if (stickyItems.contains(item.name())) |
---|
493 | { |
---|
494 | it.remove(); |
---|
495 | %> |
---|
496 | <option value="<%=item.name()%>"><%=item.toString() %> |
---|
497 | <% |
---|
498 | } |
---|
499 | } |
---|
500 | %> |
---|
501 | </select> |
---|
502 | </td> |
---|
503 | <td> |
---|
504 | <base:buttongroup |
---|
505 | vertical="true" |
---|
506 | > |
---|
507 | <base:button |
---|
508 | id="moveLeft" |
---|
509 | image="move_left.png" |
---|
510 | tooltip="Show this item in the 'Most recent' menu" |
---|
511 | subclass="square" |
---|
512 | /> |
---|
513 | <base:button |
---|
514 | id="moveRight" |
---|
515 | image="move_right.png" |
---|
516 | tooltip="Don't show this item in the 'Most recent' menu" |
---|
517 | subclass="square" |
---|
518 | /> |
---|
519 | </base:buttongroup> |
---|
520 | </td> |
---|
521 | <td> |
---|
522 | <b>All items</b><br> |
---|
523 | <select name="all_items" id="allItems" multiple size="12" style="width: 12em;"> |
---|
524 | <% |
---|
525 | for (Item item : allItems) |
---|
526 | { |
---|
527 | %> |
---|
528 | <option value="<%=item.name()%>"><%=item.toString() %> |
---|
529 | <% |
---|
530 | } |
---|
531 | %> |
---|
532 | </select> |
---|
533 | </td> |
---|
534 | </tr> |
---|
535 | </table> |
---|
536 | |
---|
537 | </td> |
---|
538 | </tr> |
---|
539 | </table> |
---|
540 | </t:tab> |
---|
541 | <t:tab |
---|
542 | id="inactiveRoles" |
---|
543 | title="Inactive roles" |
---|
544 | helpid="userpreferences.inactiveroles" |
---|
545 | tooltip="Select if any roles should be inactive by default after logging in" |
---|
546 | visible="<%=roles != null && roles.size() > 0%>" |
---|
547 | > |
---|
548 | <table class="fullform"> |
---|
549 | <tr class="dynamic"> |
---|
550 | <th>Default roles</th> |
---|
551 | <td> |
---|
552 | <b>Inactive at login</b><br> |
---|
553 | <% |
---|
554 | for (Role r : roles) |
---|
555 | { |
---|
556 | boolean inactive = defaultInactive.contains(r.getId()); |
---|
557 | %> |
---|
558 | <label><input type="checkbox" id="role.<%=r.getId()%>" |
---|
559 | name="inactiveRoles" value="<%=r.getId()%>" |
---|
560 | <%=inactive ? "checked" : "" %> |
---|
561 | ><%=HTML.encodeTags(r.getName())%></label><br> |
---|
562 | <% |
---|
563 | } |
---|
564 | %> |
---|
565 | <div class="messagecontainer note" style="margin-top: 1em;"> |
---|
566 | Select all roles that should be inactive by default |
---|
567 | after logging in. Note! This setting only applies when |
---|
568 | logging in via the web interface. |
---|
569 | </div> |
---|
570 | </td> |
---|
571 | </tr> |
---|
572 | </table> |
---|
573 | |
---|
574 | </t:tab> |
---|
575 | </t:tabcontrol> |
---|
576 | </form> |
---|
577 | |
---|
578 | <div class="legend"> |
---|
579 | <base:icon image="required.png" />= required information |
---|
580 | </div> |
---|
581 | |
---|
582 | <base:buttongroup subclass="dialogbuttons"> |
---|
583 | <base:button id="btnSave" title="Save" /> |
---|
584 | <base:button id="close" title="Cancel" /> |
---|
585 | </base:buttongroup> |
---|
586 | </base:body> |
---|
587 | </base:page> |
---|
588 | <% |
---|
589 | } |
---|
590 | finally |
---|
591 | { |
---|
592 | if (dc != null) dc.close(); |
---|
593 | } |
---|
594 | %> |
---|