1 | <%-- $Id: menu.jsp 3679 2007-08-17 07:18:29Z jari $ |
---|
2 | ------------------------------------------------------------------ |
---|
3 | Copyright (C) 2005 Nicklas Nordborg, Gregory Vincic |
---|
4 | Copyright (C) 2006 Jari Hakkinen, Nicklas Nordborg, Martin Svensson, Gregory Vincic |
---|
5 | Copyright (C) 2007 Nicklas Nordborg |
---|
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 2 |
---|
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 this program; if not, write to the Free Software |
---|
22 | Foundation, Inc., 59 Temple Place - Suite 330, |
---|
23 | Boston, MA 02111-1307, USA. |
---|
24 | ------------------------------------------------------------------ |
---|
25 | |
---|
26 | This page is included from the <base:page> taglib to display the |
---|
27 | meny. |
---|
28 | |
---|
29 | @param name |
---|
30 | The name of the menu to display: |
---|
31 | - standard: The standard menu for a logged in user |
---|
32 | - login: The menu used on pages where no user is logged in |
---|
33 | - exception: Used on error pages, does not display a menu at all |
---|
34 | - auto: Will display either the "standard" or "login" menu |
---|
35 | |
---|
36 | @author Nicklas |
---|
37 | @version 2.0 |
---|
38 | --%> |
---|
39 | <%@ page session="false" |
---|
40 | import="net.sf.basedb.core.SessionControl" |
---|
41 | import="net.sf.basedb.core.DbControl" |
---|
42 | import="net.sf.basedb.core.BasicItem" |
---|
43 | import="net.sf.basedb.core.Nameable" |
---|
44 | import="net.sf.basedb.core.Permission" |
---|
45 | import="net.sf.basedb.core.Item" |
---|
46 | import="net.sf.basedb.core.ItemContext" |
---|
47 | import="net.sf.basedb.core.User" |
---|
48 | import="net.sf.basedb.core.Project" |
---|
49 | import="net.sf.basedb.core.Client" |
---|
50 | import="net.sf.basedb.core.StringUtil" |
---|
51 | import="net.sf.basedb.core.ItemQuery" |
---|
52 | import="net.sf.basedb.core.Include" |
---|
53 | import="net.sf.basedb.core.ItemResultList" |
---|
54 | import="net.sf.basedb.core.query.Orders" |
---|
55 | import="net.sf.basedb.core.query.Hql" |
---|
56 | import="net.sf.basedb.clients.web.Base" |
---|
57 | import="net.sf.basedb.clients.web.util.HTML" |
---|
58 | import="net.sf.basedb.util.Values" |
---|
59 | import="java.util.HashMap" |
---|
60 | import="java.util.ArrayList" |
---|
61 | import="java.util.List" |
---|
62 | import="java.util.Arrays" |
---|
63 | %> |
---|
64 | <%@ taglib prefix="m" uri="/WEB-INF/menu.tld" %> |
---|
65 | <% |
---|
66 | final SessionControl sc = Base.getSessionControl(pageContext, false); |
---|
67 | final String ID = sc == null ? "" : sc.getId(); |
---|
68 | String name = Values.getString(request.getParameter("name"), "login"); |
---|
69 | final String root = request.getContextPath()+"/"; |
---|
70 | if ("exception".equals(name) && sc != null && sc.isLoggedIn()) name = "standard"; |
---|
71 | |
---|
72 | if ("login".equals(name)) |
---|
73 | { |
---|
74 | } |
---|
75 | else if ("recentItems".equals(name) && sc != null && sc.isLoggedIn()) |
---|
76 | { |
---|
77 | // Recently used items menu |
---|
78 | String stickyItems = Values.getString(sc.getUserClientSetting("menu.mostRecent"), |
---|
79 | "EXPERIMENT:BIOASSAYSET:TRANSFORMATION"); |
---|
80 | boolean loadNames = Values.getBoolean(sc.getUserClientSetting("menu.mostRecent.loadNames"), |
---|
81 | true); |
---|
82 | String recentItems = sc.getUserClientSetting("menu.mostRecent.viewed"); |
---|
83 | DbControl dc = loadNames ? sc.newDbControl() : null; |
---|
84 | try |
---|
85 | { |
---|
86 | %> |
---|
87 | <m:menu |
---|
88 | id="mostRecent" |
---|
89 | style="display: none;" |
---|
90 | > |
---|
91 | <% |
---|
92 | int numItems = 0; |
---|
93 | // Recently viewed items |
---|
94 | List<String> recentlyViewed = recentItems == null ? |
---|
95 | new ArrayList<String>() : Arrays.asList(recentItems.split(":")); |
---|
96 | if (recentlyViewed.size() > 0) |
---|
97 | { |
---|
98 | %> |
---|
99 | <m:menuitem |
---|
100 | title="Recently viewed items" |
---|
101 | style="font-weight: bold; color: #000000; background: #e8e8e8;" |
---|
102 | enabled="false" |
---|
103 | /> |
---|
104 | <m:menuseparator /> |
---|
105 | <% |
---|
106 | for (String recent : recentlyViewed) |
---|
107 | { |
---|
108 | String[] tmp = recent.split("="); |
---|
109 | Item itemType = Item.valueOf(tmp[0]); |
---|
110 | int itemId = Values.getInt(tmp[1], 0); |
---|
111 | if (itemId != 0) |
---|
112 | { |
---|
113 | String shortName = ""; |
---|
114 | String fullName = ""; |
---|
115 | if (loadNames) |
---|
116 | { |
---|
117 | try |
---|
118 | { |
---|
119 | BasicItem item = itemType.getById(dc, itemId); |
---|
120 | fullName = ((Nameable)item).getName(); |
---|
121 | shortName = HTML.encodeTags(StringUtil.trimString(fullName, 35)); |
---|
122 | } |
---|
123 | catch (Throwable t) |
---|
124 | { |
---|
125 | continue; |
---|
126 | } |
---|
127 | } |
---|
128 | else |
---|
129 | { |
---|
130 | fullName = itemType.toString() + "; id=" + itemId; |
---|
131 | shortName = itemType + " (id=" + itemId + ")"; |
---|
132 | } |
---|
133 | numItems++; |
---|
134 | %> |
---|
135 | <m:menuitem |
---|
136 | title="<%=numItems + ". " + shortName%>" |
---|
137 | onclick="<%="Main.viewOrEditItem('" + ID + "', '" + itemType.name() + "', " + itemId + ")"%>" |
---|
138 | tooltip="<%="Go to " + HTML.encodeTags(fullName) + " (" + itemType + ")"%>" |
---|
139 | /> |
---|
140 | <% |
---|
141 | } |
---|
142 | } |
---|
143 | } |
---|
144 | if (stickyItems != null && stickyItems.length() > 0) |
---|
145 | { |
---|
146 | int numSticky = 0; |
---|
147 | if (numItems > 0) |
---|
148 | { |
---|
149 | %> |
---|
150 | <m:menuseparator /> |
---|
151 | <% |
---|
152 | } |
---|
153 | %> |
---|
154 | <m:menuitem |
---|
155 | title="Sticky items" |
---|
156 | style="font-weight: bold; color: #000000; background: #e8e8e8;" |
---|
157 | enabled="false" |
---|
158 | /> |
---|
159 | <m:menuseparator /> |
---|
160 | <% |
---|
161 | // Sticky items |
---|
162 | for (String recentItem : stickyItems.split(":")) |
---|
163 | { |
---|
164 | Item itemType = Item.valueOf(recentItem); |
---|
165 | ItemContext cc = sc.getCurrentContext(itemType); |
---|
166 | if (cc.getId() != 0) |
---|
167 | { |
---|
168 | String shortName = ""; |
---|
169 | String fullName = ""; |
---|
170 | if (loadNames) |
---|
171 | { |
---|
172 | try |
---|
173 | { |
---|
174 | BasicItem item = itemType.getById(dc, cc.getId()); |
---|
175 | fullName = ((Nameable)item).getName(); |
---|
176 | shortName = ": " + HTML.encodeTags(StringUtil.trimString(fullName, 30)); |
---|
177 | } |
---|
178 | catch (Throwable t) |
---|
179 | { |
---|
180 | continue; |
---|
181 | } |
---|
182 | } |
---|
183 | else |
---|
184 | { |
---|
185 | fullName = itemType.toString() + "; id=" + cc.getId(); |
---|
186 | shortName = " (id=" + cc.getId() + ")"; |
---|
187 | } |
---|
188 | numItems++; |
---|
189 | numSticky++; |
---|
190 | %> |
---|
191 | <m:menuitem |
---|
192 | title="<%=itemType + shortName%>" |
---|
193 | onclick="<%="Main.viewOrEditItem('" + ID + "', '" + itemType.name() + "', " + cc.getId() + ")"%>" |
---|
194 | tooltip="<%="Go to " + HTML.encodeTags(fullName) + " (" + itemType + ")"%>" |
---|
195 | /> |
---|
196 | <% |
---|
197 | if (itemType == Item.BIOASSAYSET) |
---|
198 | { |
---|
199 | // Add menu for Experiment explorer as well |
---|
200 | %> |
---|
201 | <m:menuitem |
---|
202 | title="<%="Experiment explorer"+HTML.encodeTags(shortName)%>" |
---|
203 | onclick="<%="location.href = '"+root+"views/experiments/explorer/view/index.jsp?ID=" + ID + "&bioassayset_id="+cc.getId()+"'"%>" |
---|
204 | tooltip="Go to experiment explorer" |
---|
205 | /> |
---|
206 | <% |
---|
207 | } |
---|
208 | } |
---|
209 | } |
---|
210 | if (numSticky == 0) |
---|
211 | { |
---|
212 | %> |
---|
213 | <m:menuitem |
---|
214 | title="<i>- no sticky items -</i>" |
---|
215 | enabled="false" |
---|
216 | /> |
---|
217 | <% |
---|
218 | } |
---|
219 | } |
---|
220 | %> |
---|
221 | <m:menuseparator /> |
---|
222 | <m:menuitem |
---|
223 | title="Options…" |
---|
224 | onclick="<%="Main.openPopup('"+root+"my_base/user/preferences.jsp?ID="+ID+"&page=mostRecent', 'Preferences', 500, 400);"%>" |
---|
225 | tooltip="Change options for this menu" |
---|
226 | /> |
---|
227 | </m:menu> |
---|
228 | <% |
---|
229 | } |
---|
230 | finally |
---|
231 | { |
---|
232 | if (dc != null) dc.close(); |
---|
233 | } |
---|
234 | } |
---|
235 | else if ("standard".equals(name)) |
---|
236 | { |
---|
237 | final DbControl dc = sc.newDbControl(); |
---|
238 | ItemResultList<Project> projects = null; |
---|
239 | StringBuilder fillText = new StringBuilder(); |
---|
240 | try |
---|
241 | { |
---|
242 | fillText.append("<a href=\"javascript:void(0)\" title=\"Refresh current page\""); |
---|
243 | fillText.append(" onclick=\"location.reload()\">"); |
---|
244 | fillText.append("<img src=\""+root+"images/refresh.gif\" border=\"0\"></a><span class=\"menuseparator\"> </span>"); |
---|
245 | |
---|
246 | fillText.append("<a href=\"javascript:void(0)\" title=\"Go to the most recently viewed item\""); |
---|
247 | fillText.append(" onclick=\"Menu.toggleTopMenu(document.getElementById('mostRecent'), event.clientX-20, event.clientY); event.cancelBubble = true;\">"); |
---|
248 | fillText.append(" <img src=\""+root+"images/recent.png\" border=\"0\"><img src=\""+root+"images/sort_asc.gif\" border=\"0\"></a><span class=\"menuseparator\"> </span>"); |
---|
249 | |
---|
250 | Project activeProject = sc.getActiveProjectId() == 0 ? null : Project.getById(dc, sc.getActiveProjectId()); |
---|
251 | fillText.append("<img src=\""+root+"images/project.gif\" border=\"0\"> <a href=\"javascript:void(0)\" title=\"Switch project\""); |
---|
252 | fillText.append(" onclick=\"Menu.toggleTopMenu(document.getElementById('projects'), event.clientX-100, event.clientY); event.cancelBubble = true;\">"); |
---|
253 | fillText.append(activeProject == null ? "<i>- none -</i>" : HTML.encodeTags(activeProject.getName())); |
---|
254 | fillText.append(" <img src=\""+root+"images/sort_asc.gif\" border=\"0\"></a><span class=\"menuseparator\"> </span>"); |
---|
255 | |
---|
256 | User user = User.getById(dc, sc.getLoggedInUserId()); |
---|
257 | String userPrompt = sc.isImpersonated() ? "Impersonated" : "User"; |
---|
258 | fillText.append("<img src=\""+root+"images/take_ownership.png\" border=\"0\"> <a href=\"javascript:void(0)\" title=\"Switch user/logout\""); |
---|
259 | fillText.append(" onclick=\"javascript:Menu.toggleTopMenu(document.getElementById('switchuser'), event.clientX-100, event.clientY); event.cancelBubble = true;\">"); |
---|
260 | fillText.append(HTML.encodeTags(user.getLogin())); |
---|
261 | fillText.append(" (").append(user.getName()).append(") <img src=\""+root+"images/sort_asc.gif\" border=\"0\"></a>"); |
---|
262 | %> |
---|
263 | <% |
---|
264 | // Permission settings |
---|
265 | final boolean hasFiles = !sc.hasPermission(Permission.DENIED, Item.FILE); |
---|
266 | final boolean createFiles = sc.hasPermission(Permission.CREATE, Item.FILE); |
---|
267 | |
---|
268 | final boolean hasProjects = !sc.hasPermission(Permission.DENIED, Item.PROJECT); |
---|
269 | final boolean createProjects = sc.hasPermission(Permission.CREATE, Item.PROJECT); |
---|
270 | |
---|
271 | final boolean hasMessages = !sc.hasPermission(Permission.DENIED, Item.MESSAGE); |
---|
272 | final boolean createMessages = sc.hasPermission(Permission.CREATE, Item.MESSAGE); |
---|
273 | |
---|
274 | final boolean hasLabels = !sc.hasPermission(Permission.DENIED, Item.LABEL); |
---|
275 | final boolean createLabels = sc.hasPermission(Permission.CREATE, Item.LABEL); |
---|
276 | |
---|
277 | final boolean hasBioSources = !sc.hasPermission(Permission.DENIED, Item.BIOSOURCE); |
---|
278 | final boolean createBioSources = sc.hasPermission(Permission.CREATE, Item.BIOSOURCE); |
---|
279 | |
---|
280 | final boolean hasSamples = !sc.hasPermission(Permission.DENIED, Item.SAMPLE); |
---|
281 | final boolean createSamples = sc.hasPermission(Permission.CREATE, Item.SAMPLE); |
---|
282 | |
---|
283 | final boolean hasExtracts = !sc.hasPermission(Permission.DENIED, Item.EXTRACT); |
---|
284 | final boolean createExtracts = sc.hasPermission(Permission.CREATE, Item.EXTRACT); |
---|
285 | |
---|
286 | final boolean hasLabeledExtracts = !sc.hasPermission(Permission.DENIED, Item.LABELEDEXTRACT); |
---|
287 | final boolean createLabeledExtracts = sc.hasPermission(Permission.CREATE, Item.LABELEDEXTRACT); |
---|
288 | |
---|
289 | final boolean hasHybridizations = !sc.hasPermission(Permission.DENIED, Item.HYBRIDIZATION); |
---|
290 | final boolean createHybridizations = sc.hasPermission(Permission.CREATE, Item.HYBRIDIZATION); |
---|
291 | |
---|
292 | final boolean hasScans = !sc.hasPermission(Permission.DENIED, Item.SCAN); |
---|
293 | final boolean createScans = sc.hasPermission(Permission.CREATE, Item.SCAN); |
---|
294 | final boolean hasRawBioAssays = !sc.hasPermission(Permission.DENIED, Item.RAWBIOASSAY); |
---|
295 | final boolean createRawBioAssays = sc.hasPermission(Permission.CREATE, Item.RAWBIOASSAY); |
---|
296 | final boolean hasExperiments = !sc.hasPermission(Permission.DENIED, Item.EXPERIMENT); |
---|
297 | final boolean createExperiments = sc.hasPermission(Permission.CREATE, Item.EXPERIMENT); |
---|
298 | final boolean hasFormulas = !sc.hasPermission(Permission.DENIED, Item.FORMULA); |
---|
299 | final boolean createFormulas = sc.hasPermission(Permission.CREATE, Item.FORMULA); |
---|
300 | |
---|
301 | final boolean hasReporters = !sc.hasPermission(Permission.DENIED, Item.REPORTER); |
---|
302 | final boolean hasReporterLists = !sc.hasPermission(Permission.DENIED, Item.REPORTERLIST); |
---|
303 | final boolean createReporters = sc.hasPermission(Permission.CREATE, Item.REPORTER); |
---|
304 | final boolean hasJobs = !sc.hasPermission(Permission.DENIED, Item.JOB); |
---|
305 | final boolean hasSessions = !sc.hasPermission(Permission.DENIED, Item.SESSION); |
---|
306 | %> |
---|
307 | <m:menu |
---|
308 | id="view" |
---|
309 | style="display: none" |
---|
310 | > |
---|
311 | <m:menuitem |
---|
312 | title="Home" |
---|
313 | onclick="<%="Menu.openUrl('"+root+"my_base/index.jsp?ID="+ID+"')"%>" |
---|
314 | /> |
---|
315 | <m:menuitem |
---|
316 | title="All items" |
---|
317 | tooltip="View all items that you are the owner of" |
---|
318 | onclick="<%="Menu.openUrl('"+root+"views/items/index.jsp?ID="+ID+"')"%>" |
---|
319 | /> |
---|
320 | <m:menuitem |
---|
321 | title="Trashcan" |
---|
322 | tooltip="View all items that have been marked for deletion" |
---|
323 | onclick="<%="Menu.openUrl('"+root+"views/trashcan/index.jsp?ID="+ID+"')"%>" |
---|
324 | /> |
---|
325 | <m:menuseparator /> |
---|
326 | <m:menuitem |
---|
327 | title="Files" |
---|
328 | onclick="<%="Menu.openUrl('"+root+"filemanager/index.jsp?ID="+ID+"')"%>" |
---|
329 | tooltip="<%=hasFiles ? "Manage files" : "You do not have permission to manage files"%>" |
---|
330 | enabled="<%=hasFiles%>" |
---|
331 | /> |
---|
332 | <m:menuitem |
---|
333 | title="Projects" |
---|
334 | onclick="<%="Menu.openUrl('"+root+"my_base/projects/index.jsp?ID="+ID+"')"%>" |
---|
335 | tooltip="Manage projects" |
---|
336 | enabled="<%=hasProjects%>" |
---|
337 | /> |
---|
338 | <m:menuitem |
---|
339 | title="Messages" |
---|
340 | onclick="<%="Menu.openUrl('"+root+"my_base/messages/index.jsp?ID="+ID+"')"%>" |
---|
341 | tooltip="<%=hasMessages ? "Read your messages" : "You do not have permission to read messages"%>" |
---|
342 | enabled="<%=hasMessages%>" |
---|
343 | /> |
---|
344 | <m:menuitem |
---|
345 | title="Jobs" |
---|
346 | onclick="<%="Menu.openUrl('"+root+"views/jobs/index.jsp?ID="+ID+"')"%>" |
---|
347 | tooltip="<%=hasJobs ? "Check the status of your jobs" : "You do not have permission to access jobs"%>" |
---|
348 | enabled="<%=hasJobs%>" |
---|
349 | /> |
---|
350 | <m:menuitem |
---|
351 | title="Sessions" |
---|
352 | onclick="<%="Menu.openUrl('"+root+"views/sessions/index.jsp?ID="+ID+"')"%>" |
---|
353 | tooltip="<%=hasSessions ? "Check you login sessions" : "You do not have permission to access sessions"%>" |
---|
354 | enabled="<%=hasSessions%>" |
---|
355 | /> |
---|
356 | <m:menuseparator /> |
---|
357 | <m:menuitem |
---|
358 | title="Biosources" |
---|
359 | onclick="<%="Menu.openUrl('"+root+"biomaterials/biosources/index.jsp?ID="+ID+"')"%>" |
---|
360 | tooltip="<%=hasBioSources ? "Manage biosources" : "You do not have permission to manage biosources"%>" |
---|
361 | enabled="<%=hasBioSources%>" |
---|
362 | /> |
---|
363 | <m:menuitem |
---|
364 | title="Samples" |
---|
365 | onclick="<%="Menu.openUrl('"+root+"biomaterials/samples/index.jsp?ID="+ID+"')"%>" |
---|
366 | tooltip="<%=hasSamples ? "Manage samples" : "You do not have permission to manage samples"%>" |
---|
367 | enabled="<%=hasSamples%>" |
---|
368 | /> |
---|
369 | <m:menuitem |
---|
370 | title="Extracts" |
---|
371 | onclick="<%="Menu.openUrl('"+root+"biomaterials/extracts/index.jsp?ID="+ID+"')"%>" |
---|
372 | tooltip="<%=hasExtracts ? "Manage extracts" : "You do not have permission to manage extracts"%>" |
---|
373 | enabled="<%=hasExtracts%>" |
---|
374 | /> |
---|
375 | <m:menuitem |
---|
376 | title="Labeled extracts" |
---|
377 | onclick="<%="Menu.openUrl('"+root+"biomaterials/labeledextracts/index.jsp?ID="+ID+"')"%>" |
---|
378 | tooltip="<%=hasLabeledExtracts ? "Manage labeled extracts" : "You do not have permission to manage labeled extracts"%>" |
---|
379 | enabled="<%=hasLabeledExtracts%>" |
---|
380 | /> |
---|
381 | <m:menuitem |
---|
382 | title="Labels" |
---|
383 | onclick="<%="Menu.openUrl('"+root+"biomaterials/labels/index.jsp?ID="+ID+"')"%>" |
---|
384 | tooltip="<%=hasLabels ? "Manage labels" : "You do not have permission to manage labels"%>" |
---|
385 | enabled="<%=hasLabels%>" |
---|
386 | /> |
---|
387 | <m:menuseparator /> |
---|
388 | <m:menuitem |
---|
389 | title="Hybridizations" |
---|
390 | onclick="<%="Menu.openUrl('"+root+"views/hybridizations/index.jsp?ID="+ID+"')"%>" |
---|
391 | tooltip="<%=hasHybridizations ? "Manage hybridizations" : "You do not have permission to manage hybridizations"%>" |
---|
392 | enabled="<%=hasHybridizations%>" |
---|
393 | /> |
---|
394 | <m:menuitem |
---|
395 | title="Scans" |
---|
396 | onclick="<%="Menu.openUrl('"+root+"views/scans/index.jsp?ID="+ID+"')"%>" |
---|
397 | tooltip="<%=hasScans ? "Manage scans" : "You do not have permission to manage scans"%>" |
---|
398 | enabled="<%=hasScans%>" |
---|
399 | /> |
---|
400 | <m:menuitem |
---|
401 | title="Raw bioassays" |
---|
402 | onclick="<%="Menu.openUrl('"+root+"views/rawbioassays/index.jsp?ID="+ID+"')"%>" |
---|
403 | tooltip="<%=hasRawBioAssays ? "Manage raw bioassays" : "You do not have permission to manage raw bioassays"%>" |
---|
404 | enabled="<%=hasRawBioAssays%>" |
---|
405 | /> |
---|
406 | <m:menuitem |
---|
407 | title="Experiments" |
---|
408 | onclick="<%="Menu.openUrl('"+root+"views/experiments/index.jsp?ID="+ID+"')"%>" |
---|
409 | tooltip="<%=hasExperiments ? "Manage experiments" : "You do not have permission to manage experiments"%>" |
---|
410 | enabled="<%=hasExperiments%>" |
---|
411 | /> |
---|
412 | <m:menuitem |
---|
413 | title="Formulas" |
---|
414 | onclick="<%="Menu.openUrl('"+root+"views/formulas/index.jsp?ID="+ID+"')"%>" |
---|
415 | tooltip="<%=hasFormulas ? "Manage formulas" : "You do not have permission to manage formulas"%>" |
---|
416 | enabled="<%=hasFormulas%>" |
---|
417 | /> |
---|
418 | <m:menuseparator /> |
---|
419 | <m:menuitem |
---|
420 | title="Reporters" |
---|
421 | onclick="<%="Menu.openUrl('"+root+"views/reporters/index.jsp?ID="+ID+"')"%>" |
---|
422 | tooltip="<%=hasReporters ? "Manage reporters" : "You do not have permission to manage reporters"%>" |
---|
423 | enabled="<%=hasReporters%>" |
---|
424 | /> |
---|
425 | <m:menuitem |
---|
426 | title="Reporter lists" |
---|
427 | onclick="<%="Menu.openUrl('"+root+"views/reporterlists/index.jsp?ID="+ID+"')"%>" |
---|
428 | tooltip="<%=hasReporterLists ? "Manage reporter lists" : "You do not have permission to manage reporter lists"%>" |
---|
429 | enabled="<%=hasReporterLists%>" |
---|
430 | /> |
---|
431 | |
---|
432 | </m:menu> |
---|
433 | |
---|
434 | |
---|
435 | <m:menu |
---|
436 | id="file" |
---|
437 | style="display: none" |
---|
438 | > |
---|
439 | <m:submenu |
---|
440 | subid="projects" |
---|
441 | title="Select project" |
---|
442 | enabled="<%=hasProjects%>" |
---|
443 | /> |
---|
444 | <m:menuseparator /> |
---|
445 | <m:menuitem |
---|
446 | title="Contact information…" |
---|
447 | onclick="<%="Main.openPopup('"+root+"my_base/user/settings.jsp?ID="+ID+"&page=contact', 'Settings', 500, 360);"%>" |
---|
448 | tooltip="Set your address, phone, email, etc." |
---|
449 | /> |
---|
450 | <m:menuitem |
---|
451 | title="Change password…" |
---|
452 | onclick="<%="Main.openPopup('"+root+"my_base/user/settings.jsp?ID="+ID+"&page=password', 'Settings', 500, 360);"%>" |
---|
453 | tooltip="Set your password" |
---|
454 | /> |
---|
455 | <m:menuitem |
---|
456 | title="Other information…" |
---|
457 | onclick="<%="Main.openPopup('"+root+"my_base/user/settings.jsp?ID="+ID+"&page=other', 'Settings', 500, 360);"%>" |
---|
458 | tooltip="Other user-related information" |
---|
459 | /> |
---|
460 | <m:menuseparator /> |
---|
461 | <m:menuitem |
---|
462 | title="Preferences…" |
---|
463 | onclick="<%="Main.openPopup('"+root+"my_base/user/preferences.jsp?ID="+ID+"', 'Preferences', 500, 400);"%>" |
---|
464 | tooltip="Change font sizes, etc." |
---|
465 | /> |
---|
466 | <m:menuitem |
---|
467 | title="Reload permissions" |
---|
468 | onclick="<%="Main.openPopup('"+root+"my_base/user/submit_user.jsp?ID="+ID+"&cmd=ReloadPermissions', 'ReloadPermissions', 300, 200);"%>" |
---|
469 | tooltip="Reload permissions" |
---|
470 | /> |
---|
471 | <m:menuseparator /> |
---|
472 | <m:menuitem |
---|
473 | title="Logout…" |
---|
474 | onclick="<%="Main.openPopup('"+root+"logout.jsp?ID="+ID+"', 'Logout', 360, 200);"%>" |
---|
475 | tooltip="Exit from BASE" |
---|
476 | /> |
---|
477 | </m:menu> |
---|
478 | <% |
---|
479 | // Projects menu |
---|
480 | int activeProjectId = sc.getActiveProjectId(); |
---|
481 | final ItemQuery<Project> projectQuery = Project.getQuery(); |
---|
482 | projectQuery.include(Include.MINE, Include.SHARED); |
---|
483 | projectQuery.order(Orders.asc(Hql.property("name"))); |
---|
484 | projectQuery.setCacheResult(true); |
---|
485 | %> |
---|
486 | <m:menu |
---|
487 | id="projects" |
---|
488 | style="display: none" |
---|
489 | > |
---|
490 | <m:menuitem |
---|
491 | title="<i>- no active project -</i>" |
---|
492 | onclick="<%="Main.openPopup('"+root+"my_base/projects/set_active.jsp?ID="+ID+"', 'ActivateProject', 300, 140)"%>" |
---|
493 | icon="<%=activeProjectId == 0 ? "checkedmenu.gif" : null%>" |
---|
494 | enabled="<%=activeProjectId != 0%>" |
---|
495 | tooltip="<%=activeProjectId == 0 ? "No project is active" : "Disable the currently active project"%>" |
---|
496 | /> |
---|
497 | <% |
---|
498 | projects = projectQuery.list(dc); |
---|
499 | for (Project p : projects) |
---|
500 | { |
---|
501 | int projectId = p.getId(); |
---|
502 | boolean active = activeProjectId == projectId; |
---|
503 | %> |
---|
504 | <m:menuitem |
---|
505 | title="<%=HTML.encodeTags(p.getName())%>" |
---|
506 | style="<%=active ? "color: #000000; font-weight: bold;" : null %>" |
---|
507 | onclick="<%="Main.openPopup('"+root+"my_base/projects/set_active.jsp?ID="+ID+"&project_id="+p.getId()+"', 'ActivateProject', 300, 140)"%>" |
---|
508 | icon="<%=active ? "checkedmenu.gif" : null%>" |
---|
509 | enabled="<%=!active%>" |
---|
510 | tooltip="<%=active ? "This is the active project" : "Set this project to the active project"%>" |
---|
511 | /> |
---|
512 | <% |
---|
513 | } |
---|
514 | %> |
---|
515 | </m:menu> |
---|
516 | |
---|
517 | <% |
---|
518 | // Array LIMS - menu |
---|
519 | final boolean hasPlateGeometries = sc.hasPermission(Permission.READ, Item.PLATEGEOMETRY); |
---|
520 | final boolean hasPlateTypes = !sc.hasPermission(Permission.DENIED, Item.PLATETYPE); |
---|
521 | final boolean hasPlates = !sc.hasPermission(Permission.DENIED, Item.PLATE); |
---|
522 | final boolean hasPlateMappings = !sc.hasPermission(Permission.DENIED, Item.PLATEMAPPING); |
---|
523 | final boolean hasArraySlides = !sc.hasPermission(Permission.DENIED, Item.ARRAYSLIDE); |
---|
524 | final boolean hasArrayBatches = !sc.hasPermission(Permission.DENIED, Item.ARRAYBATCH); |
---|
525 | final boolean hasArrayDesigns = !sc.hasPermission(Permission.DENIED, Item.ARRAYDESIGN); |
---|
526 | final boolean hasLims = hasPlateGeometries || hasPlateTypes || hasPlates || hasPlateMappings || |
---|
527 | hasArraySlides || hasArrayBatches || hasArrayDesigns; |
---|
528 | if (hasLims) |
---|
529 | { |
---|
530 | %> |
---|
531 | <m:menu |
---|
532 | id="lims" |
---|
533 | style="display: none" |
---|
534 | > |
---|
535 | <m:menuitem |
---|
536 | title="Plate geometries" |
---|
537 | onclick="<%="Menu.openUrl('"+root+"lims/geometries/index.jsp?ID="+ID+"')"%>" |
---|
538 | tooltip="<%=hasPlateGeometries ? "Manage plate geometries" : "You do not have permission to manage plate geometries"%>" |
---|
539 | enabled="<%=hasPlateGeometries%>" |
---|
540 | /> |
---|
541 | <m:menuitem |
---|
542 | title="Plate types" |
---|
543 | onclick="<%="Menu.openUrl('"+root+"lims/platetypes/index.jsp?ID="+ID+"')"%>" |
---|
544 | tooltip="<%=hasPlateTypes ? "Manage plate types" : "You do not have permission to manage plate types"%>" |
---|
545 | enabled="<%=hasPlateTypes%>" |
---|
546 | /> |
---|
547 | <m:menuitem |
---|
548 | title="Plates" |
---|
549 | onclick="<%="Menu.openUrl('"+root+"lims/plates/index.jsp?ID="+ID+"')"%>" |
---|
550 | tooltip="<%=hasPlates ? "Manage plates" : "You do not have permission to manage plates"%>" |
---|
551 | enabled="<%=hasPlates%>" |
---|
552 | /> |
---|
553 | <m:menuitem |
---|
554 | title="Plate mappings" |
---|
555 | onclick="<%="Menu.openUrl('"+root+"lims/platemappings/index.jsp?ID="+ID+"')"%>" |
---|
556 | tooltip="<%=hasPlateTypes ? "Manage plate mappings" : "You do not have permission to manage plate mappings"%>" |
---|
557 | enabled="<%=hasPlateTypes%>" |
---|
558 | /> |
---|
559 | <m:menuseparator /> |
---|
560 | <m:menuitem |
---|
561 | title="Array designs" |
---|
562 | onclick="<%="Menu.openUrl('"+root+"lims/arraydesigns/index.jsp?ID="+ID+"')"%>" |
---|
563 | tooltip="<%=hasArrayDesigns ? "Manage array designs" : "You do not have permission to manage array designs"%>" |
---|
564 | enabled="<%=hasArrayDesigns%>" |
---|
565 | /> |
---|
566 | <m:menuitem |
---|
567 | title="Array batches" |
---|
568 | onclick="<%="Menu.openUrl('"+root+"lims/arraybatches/index.jsp?ID="+ID+"')"%>" |
---|
569 | tooltip="<%=hasArrayBatches ? "Manage array batches" : "You do not have permission to manage array batches"%>" |
---|
570 | enabled="<%=hasArrayBatches%>" |
---|
571 | /> |
---|
572 | <m:menuitem |
---|
573 | title="Array slides" |
---|
574 | onclick="<%="Menu.openUrl('"+root+"lims/arrayslides/index.jsp?ID="+ID+"')"%>" |
---|
575 | tooltip="<%=hasArraySlides ? "Manage array slides" : "You do not have permission to manage array slides"%>" |
---|
576 | enabled="<%=hasArraySlides%>" |
---|
577 | /> |
---|
578 | </m:menu> |
---|
579 | <% |
---|
580 | } |
---|
581 | %> |
---|
582 | <% |
---|
583 | // Administrate -> Types menu |
---|
584 | final boolean hasQuotaTypes = sc.hasPermission(Permission.READ, Item.QUOTATYPE); |
---|
585 | final boolean hasProtocolTypes = sc.hasPermission(Permission.READ, Item.PROTOCOLTYPE); |
---|
586 | final boolean hasFileTypes = sc.hasPermission(Permission.READ, Item.FILETYPE); |
---|
587 | final boolean hasMimeTypes = sc.hasPermission(Permission.READ, Item.MIMETYPE); |
---|
588 | final boolean hasHardwareTypes = sc.hasPermission(Permission.READ, Item.HARDWARETYPE); |
---|
589 | final boolean hasSoftwareTypes = sc.hasPermission(Permission.READ, Item.SOFTWARETYPE); |
---|
590 | final boolean hasAnnotationTypeCategories = !sc.hasPermission(Permission.DENIED, Item.ANNOTATIONTYPECATEGORY); |
---|
591 | final boolean hasAnnotationTypes = !sc.hasPermission(Permission.DENIED, Item.ANNOTATIONTYPE); |
---|
592 | final boolean hasReporterTypes = !sc.hasPermission(Permission.DENIED, Item.REPORTERTYPE); |
---|
593 | final boolean hasExtraValueTypes = !sc.hasPermission(Permission.DENIED, Item.EXTRAVALUETYPE); |
---|
594 | final boolean hasTypes = hasFileTypes || hasProtocolTypes || hasMimeTypes || hasQuotaTypes || |
---|
595 | hasSoftwareTypes || hasHardwareTypes || hasAnnotationTypeCategories || hasAnnotationTypes || |
---|
596 | hasReporterTypes || hasExtraValueTypes; |
---|
597 | if (hasTypes) |
---|
598 | { |
---|
599 | %> |
---|
600 | <m:menu |
---|
601 | id="types" |
---|
602 | style="display: none" |
---|
603 | > |
---|
604 | <m:menuitem |
---|
605 | title="Quota types" |
---|
606 | onclick="<%="Menu.openUrl('"+root+"admin/quotatypes/index.jsp?ID="+ID+"')"%>" |
---|
607 | tooltip="<%=hasQuotaTypes ? "Administrate quota types" : "You do not have permission to administrate quota types"%>" |
---|
608 | enabled="<%=hasQuotaTypes%>" |
---|
609 | /> |
---|
610 | <m:menuitem |
---|
611 | title="Protocol types" |
---|
612 | onclick="<%="Menu.openUrl('"+root+"admin/protocoltypes/index.jsp?ID="+ID+"')"%>" |
---|
613 | tooltip="<%=hasProtocolTypes ? "Administrate protocol types" : "You do not have permission to administrate protocol types"%>" |
---|
614 | enabled="<%=hasProtocolTypes%>" |
---|
615 | /> |
---|
616 | <m:menuitem |
---|
617 | title="File types" |
---|
618 | onclick="<%="Menu.openUrl('"+root+"admin/filetypes/index.jsp?ID="+ID+"')"%>" |
---|
619 | tooltip="<%=hasFileTypes ? "Administrate file types" : "You do not have permission to administrate file types"%>" |
---|
620 | enabled="<%=hasFileTypes%>" |
---|
621 | /> |
---|
622 | <m:menuitem |
---|
623 | title="MIME types" |
---|
624 | onclick="<%="Menu.openUrl('"+root+"admin/mimetypes/index.jsp?ID="+ID+"')"%>" |
---|
625 | tooltip="<%=hasMimeTypes ? "Administrate MIME types" : "You do not have permission to administrate mime types"%>" |
---|
626 | enabled="<%=hasMimeTypes%>" |
---|
627 | /> |
---|
628 | <m:menuitem |
---|
629 | title="Software types" |
---|
630 | onclick="<%="Menu.openUrl('"+root+"admin/softwaretypes/index.jsp?ID="+ID+"')"%>" |
---|
631 | tooltip="<%=hasSoftwareTypes ? "Administrate software types" : "You do not have permission to administrate software types"%>" |
---|
632 | enabled="<%=hasSoftwareTypes%>" |
---|
633 | /> |
---|
634 | <m:menuitem |
---|
635 | title="Hardware types" |
---|
636 | onclick="<%="Menu.openUrl('"+root+"admin/hardwaretypes/index.jsp?ID="+ID+"')"%>" |
---|
637 | tooltip="<%=hasHardwareTypes ? "Administrate hardware types" : "You do not have permission to administrate hardware types"%>" |
---|
638 | enabled="<%=hasHardwareTypes%>" |
---|
639 | /> |
---|
640 | <m:menuitem |
---|
641 | title="Annotation type categories" |
---|
642 | onclick="<%="Menu.openUrl('"+root+"admin/annotationtypecategories/index.jsp?ID="+ID+"')"%>" |
---|
643 | tooltip="<%=hasAnnotationTypeCategories ? "Administrate annotation type categories" : "You do not have permission to administrate annotation types categories"%>" |
---|
644 | enabled="<%=hasAnnotationTypeCategories%>" |
---|
645 | /> |
---|
646 | <m:menuitem |
---|
647 | title="Annotation types" |
---|
648 | onclick="<%="Menu.openUrl('"+root+"admin/annotationtypes/index.jsp?ID="+ID+"')"%>" |
---|
649 | tooltip="<%=hasAnnotationTypes ? "Administrate annotation types" : "You do not have permission to administrate annotation types"%>" |
---|
650 | enabled="<%=hasAnnotationTypes%>" |
---|
651 | /> |
---|
652 | <m:menuitem |
---|
653 | title="Reporter types" |
---|
654 | onclick="<%="Menu.openUrl('"+root+"admin/reportertypes/index.jsp?ID="+ID+"')"%>" |
---|
655 | tooltip="<%=hasReporterTypes ? "Administrate reporter types" : "You do not have permission to administrate reporter types"%>" |
---|
656 | enabled="<%=hasReporterTypes%>" |
---|
657 | /> |
---|
658 | <m:menuitem |
---|
659 | title="Extra value types" |
---|
660 | onclick="<%="Menu.openUrl('"+root+"admin/extravaluetypes/index.jsp?ID="+ID+"')"%>" |
---|
661 | tooltip="<%=hasExtraValueTypes ? "Administrate extra value types" : "You do not have permission to administrate extra value types"%>" |
---|
662 | enabled="<%=hasExtraValueTypes%>" |
---|
663 | /> |
---|
664 | </m:menu> |
---|
665 | <% |
---|
666 | } |
---|
667 | %> |
---|
668 | |
---|
669 | <% |
---|
670 | // Plugins menu |
---|
671 | final boolean hasPluginTypes = !sc.hasPermission(Permission.DENIED, Item.PLUGINTYPE); |
---|
672 | final boolean hasPluginDefinitions = !sc.hasPermission(Permission.DENIED, Item.PLUGINDEFINITION); |
---|
673 | final boolean hasPluginConfigurations = !sc.hasPermission(Permission.DENIED, Item.PLUGINCONFIGURATION); |
---|
674 | final boolean hasJobAgents = sc.hasPermission(Permission.READ, Item.JOBAGENT); |
---|
675 | final boolean hasPlugins = hasPluginTypes || hasPluginDefinitions || |
---|
676 | hasPluginConfigurations || hasJobAgents; |
---|
677 | |
---|
678 | if (hasPlugins) |
---|
679 | { |
---|
680 | %> |
---|
681 | <m:menu |
---|
682 | id="plugins" |
---|
683 | style="display: none" |
---|
684 | > |
---|
685 | <m:menuitem |
---|
686 | title="Types" |
---|
687 | onclick="<%="Menu.openUrl('"+root+"admin/plugintypes/index.jsp?ID="+ID+"')"%>" |
---|
688 | tooltip="<%=hasPluginDefinitions ? "Administrate plugin types" : "You do not have permission to administrate plugin types"%>" |
---|
689 | enabled="<%=hasPluginTypes%>" |
---|
690 | /> |
---|
691 | <m:menuitem |
---|
692 | title="Definitions" |
---|
693 | onclick="<%="Menu.openUrl('"+root+"admin/plugindefinitions/index.jsp?ID="+ID+"')"%>" |
---|
694 | tooltip="<%=hasPluginDefinitions ? "Administrate plugin definitions" : "You do not have permission to administrate plugin definitions"%>" |
---|
695 | enabled="<%=hasPluginDefinitions%>" |
---|
696 | /> |
---|
697 | <m:menuitem |
---|
698 | title="Configurations" |
---|
699 | onclick="<%="Menu.openUrl('"+root+"admin/pluginconfigurations/index.jsp?ID="+ID+"')"%>" |
---|
700 | tooltip="<%=hasPluginConfigurations ? "Administrate plugin configurations" : "You do not have permission to administrate plugin configurations"%>" |
---|
701 | enabled="<%=hasPluginConfigurations%>" |
---|
702 | /> |
---|
703 | <m:menuseparator /> |
---|
704 | <m:menuitem |
---|
705 | title="Job agents" |
---|
706 | onclick="<%="Menu.openUrl('"+root+"admin/jobagents/index.jsp?ID="+ID+"')"%>" |
---|
707 | tooltip="<%=hasJobAgents ? "Administrate job agents" : "You do not have permission to administrate job agents"%>" |
---|
708 | enabled="<%=hasJobAgents%>" |
---|
709 | /> |
---|
710 | </m:menu> |
---|
711 | <% |
---|
712 | } |
---|
713 | %> |
---|
714 | |
---|
715 | <% |
---|
716 | // Administrate menu |
---|
717 | final boolean hasUsers = sc.hasPermission(Permission.READ, Item.USER); |
---|
718 | final boolean hasGroups = sc.hasPermission(Permission.READ, Item.GROUP); |
---|
719 | final boolean hasRoles = sc.hasPermission(Permission.READ, Item.ROLE); |
---|
720 | final boolean hasQuota = sc.hasPermission(Permission.READ, Item.QUOTA); |
---|
721 | final boolean hasSoftware = !sc.hasPermission(Permission.DENIED, Item.SOFTWARE); |
---|
722 | final boolean hasHardware = !sc.hasPermission(Permission.DENIED, Item.HARDWARE); |
---|
723 | final boolean hasProtocols = !sc.hasPermission(Permission.DENIED, Item.PROTOCOL); |
---|
724 | final boolean hasClients = sc.hasPermission(Permission.READ, Item.CLIENT); |
---|
725 | final boolean hasNews = sc.hasPermission(Permission.READ, Item.NEWS); |
---|
726 | final boolean hasDiskUsage = sc.hasPermission(Permission.READ, Item.DISKUSAGE); |
---|
727 | final Client currentClient = Client.getById(dc, sc.getClientId()); |
---|
728 | final boolean hasServer = currentClient.hasPermission(Permission.WRITE); |
---|
729 | |
---|
730 | final boolean hasAdministrate = |
---|
731 | hasUsers || hasGroups || hasRoles || hasQuota || hasTypes || hasPlugins || |
---|
732 | hasSoftware || hasHardware || hasProtocols || hasClients || hasNews || |
---|
733 | hasDiskUsage || hasServer; |
---|
734 | |
---|
735 | if (hasAdministrate) |
---|
736 | { |
---|
737 | %> |
---|
738 | <m:menu |
---|
739 | id="administrate" |
---|
740 | style="display: none" |
---|
741 | > |
---|
742 | <m:menuitem |
---|
743 | title="Users" |
---|
744 | onclick="<%="Menu.openUrl('"+root+"admin/users/index.jsp?ID="+ID+"')"%>" |
---|
745 | tooltip="<%=hasUsers ? "Administrate users" : "You do not have permission to administrate users"%>" |
---|
746 | enabled="<%=hasUsers%>" |
---|
747 | /> |
---|
748 | <m:menuitem |
---|
749 | title="Groups" |
---|
750 | onclick="<%="Menu.openUrl('"+root+"admin/groups/index.jsp?ID="+ID+"')"%>" |
---|
751 | tooltip="<%=hasGroups ? "Administrate groups" : "You do not have permission to administrate groups"%>" |
---|
752 | enabled="<%=hasGroups%>" |
---|
753 | /> |
---|
754 | <m:menuitem |
---|
755 | title="Roles" |
---|
756 | onclick="<%="Menu.openUrl('"+root+"admin/roles/index.jsp?ID="+ID+"')"%>" |
---|
757 | tooltip="<%=hasRoles ? "Administrate roles" : "You do not have permission to administrate roles"%>" |
---|
758 | enabled="<%=hasRoles%>" |
---|
759 | /> |
---|
760 | <m:menuseparator /> |
---|
761 | <m:submenu |
---|
762 | subid="plugins" |
---|
763 | title="Plugins" |
---|
764 | tooltip="Administrate plugin definitions and configurations" |
---|
765 | enabled="<%=hasPlugins%>" |
---|
766 | /> |
---|
767 | <m:menuseparator /> |
---|
768 | <m:menuitem |
---|
769 | title="Quota" |
---|
770 | onclick="<%="Menu.openUrl('"+root+"admin/quota/index.jsp?ID="+ID+"')"%>" |
---|
771 | tooltip="<%=hasQuota ? "Administrate quota" : "You do not have permission to administrate quota"%>" |
---|
772 | enabled="<%=hasQuota%>" |
---|
773 | /> |
---|
774 | <m:menuitem |
---|
775 | title="Software" |
---|
776 | onclick="<%="Menu.openUrl('"+root+"admin/software/index.jsp?ID="+ID+"')"%>" |
---|
777 | tooltip="<%=hasSoftware ? "Administrate software" : "You do not have permission to administrate software"%>" |
---|
778 | enabled="<%=hasSoftware%>" |
---|
779 | /> |
---|
780 | <m:menuitem |
---|
781 | title="Hardware" |
---|
782 | onclick="<%="Menu.openUrl('"+root+"admin/hardware/index.jsp?ID="+ID+"')"%>" |
---|
783 | tooltip="<%=hasHardware ? "Administrate hardware" : "You do not have permission to administrate hardware"%>" |
---|
784 | enabled="<%=hasHardware%>" |
---|
785 | /> |
---|
786 | <m:menuitem |
---|
787 | title="Protocols" |
---|
788 | onclick="<%="Menu.openUrl('"+root+"admin/protocols/index.jsp?ID="+ID+"')"%>" |
---|
789 | tooltip="<%=hasProtocols ? "Administrate protocols" : "You do not have permission to administrate protocols"%>" |
---|
790 | enabled="<%=hasProtocols%>" |
---|
791 | /> |
---|
792 | <m:menuitem |
---|
793 | title="Clients" |
---|
794 | onclick="<%="Menu.openUrl('"+root+"admin/clients/index.jsp?ID="+ID+"')"%>" |
---|
795 | tooltip="<%=hasClients ? "Administrate client applications" : "You do not have permission to administrate client applications"%>" |
---|
796 | enabled="<%=hasClients%>" |
---|
797 | /> |
---|
798 | <m:menuitem |
---|
799 | title="News" |
---|
800 | onclick="<%="Menu.openUrl('"+root+"admin/news/index.jsp?ID="+ID+"')"%>" |
---|
801 | tooltip="<%=hasNews ? "Administrate news" : "You do not have permission to administrate news"%>" |
---|
802 | enabled="<%=hasNews%>" |
---|
803 | /> |
---|
804 | <m:menuseparator /> |
---|
805 | <m:submenu |
---|
806 | subid="types" |
---|
807 | title="Types" |
---|
808 | tooltip="Administrate quota, file, hardware and software types" |
---|
809 | enabled="<%=hasTypes%>" |
---|
810 | /> |
---|
811 | <m:menuseparator /> |
---|
812 | <m:menuitem |
---|
813 | title="Disk usage" |
---|
814 | onclick="<%="Menu.openUrl('"+root+"admin/diskusage/index.jsp?ID="+ID+"')"%>" |
---|
815 | tooltip="<%=hasDiskUsage ? "Check disk usage" : "You do not have permission to check disk usage"%>" |
---|
816 | enabled="<%=hasDiskUsage%>" |
---|
817 | /> |
---|
818 | <m:menuitem |
---|
819 | title="Server settings…" |
---|
820 | onclick="<%="Main.openPopup('"+root+"admin/server/configure.jsp?ID="+ID+"', 'ServerSettings', 500, 400);"%>" |
---|
821 | tooltip="<%=hasServer ? "Configure the server" : "You do not have permission to configure the server"%>" |
---|
822 | enabled="<%=hasServer%>" |
---|
823 | /> |
---|
824 | <m:menuitem |
---|
825 | title="Restart BASE…" |
---|
826 | onclick="<%="Main.openPopup('"+root+"admin/server/restart.jsp?ID="+ID+"', 'RestartServer', 360, 200);"%>" |
---|
827 | tooltip="<%=hasServer ? "Restart the server" : "You do not have permission to restart the server"%>" |
---|
828 | enabled="<%=hasServer%>" |
---|
829 | /> |
---|
830 | </m:menu> |
---|
831 | <% |
---|
832 | } |
---|
833 | %> |
---|
834 | <% |
---|
835 | // Help menu |
---|
836 | final String helplink = Values.getStringOrNull(sc.getClientDefaultSetting("server.links.help")); |
---|
837 | final String faqlink = Values.getStringOrNull(sc.getClientDefaultSetting("server.links.faq")); |
---|
838 | final String reportbuglink = Values.getStringOrNull(sc.getClientDefaultSetting("server.links.reportbug")); |
---|
839 | %> |
---|
840 | <m:menu id="help" style="display: none"> |
---|
841 | <m:menuitem |
---|
842 | visible="<%=HTML.isValidUrl(helplink)%>" |
---|
843 | title="Help&hellip" |
---|
844 | onclick="<%="window.open('"+helplink+"','Help')"%>" |
---|
845 | /> |
---|
846 | <m:menuitem |
---|
847 | visible="<%=HTML.isValidUrl(faqlink)%>" |
---|
848 | title="FAQ&hellip" |
---|
849 | onclick="<%="window.open('"+faqlink+"','FAQ')"%>" |
---|
850 | /> |
---|
851 | <m:menuseparator /> |
---|
852 | |
---|
853 | <m:menuitem |
---|
854 | title="About…" |
---|
855 | onclick="<%="Main.openPopup('"+root+"info/about.jsp?ID="+ID+"&page=about', 'About', 500, 350)"%>" |
---|
856 | /> |
---|
857 | |
---|
858 | <m:menuitem |
---|
859 | title="License…" |
---|
860 | onclick="<%="Main.openPopup('"+root+"info/about.jsp?ID="+ID+"&page=license', 'About', 500, 350)"%>" |
---|
861 | |
---|
862 | /> |
---|
863 | <m:menuitem |
---|
864 | visible="<%=HTML.isValidUrl(reportbuglink)%>" |
---|
865 | title="Report a bug&hellip" |
---|
866 | onclick="<%="window.open('"+reportbuglink+"','Reportbug')"%>" |
---|
867 | /> |
---|
868 | <m:menuseparator /> |
---|
869 | <m:menuitem |
---|
870 | title="Base project site" onclick="<%="Menu.openUrl('http://base.thep.lu.se', 'basesite')"%>" |
---|
871 | /> |
---|
872 | </m:menu> |
---|
873 | |
---|
874 | <% |
---|
875 | //Switch user/logout menu |
---|
876 | final boolean hasImpersonate = |
---|
877 | !sc.isImpersonated() && sc.hasSystemPermission(Permission.ACT_AS_ANOTHER_USER); |
---|
878 | %> |
---|
879 | <m:menu |
---|
880 | id="switchuser" |
---|
881 | style="display: none;" |
---|
882 | > |
---|
883 | <m:menuitem |
---|
884 | title="Switch user…" |
---|
885 | onclick="<%="Main.openPopup('"+root+"switch.jsp?ID="+ID+"', 'Switch', 360, 200);"%>" |
---|
886 | tooltip="Login as another user" |
---|
887 | /> |
---|
888 | <m:menuitem |
---|
889 | title="Impersonate…" |
---|
890 | onclick="<%="Main.openPopup('"+root+"impersonate.jsp?ID="+ID+"', 'Impersonate', 480, 240);"%>" |
---|
891 | tooltip="Login as another user without knowing the password" |
---|
892 | visible="<%=hasImpersonate%>" |
---|
893 | /> |
---|
894 | <m:menuitem |
---|
895 | title="Logout…" |
---|
896 | onclick="<%="Main.openPopup('"+root+"logout.jsp?ID="+ID+"', 'Logout', 360, 200);"%>" |
---|
897 | tooltip="Exit from BASE" |
---|
898 | /> |
---|
899 | </m:menu> |
---|
900 | <% |
---|
901 | // Main menu |
---|
902 | %> |
---|
903 | <m:menu |
---|
904 | type="horizontal" |
---|
905 | clazz="menu_horizontal" |
---|
906 | id="menubar" |
---|
907 | style="top: 10px; left: 8px; width: 98%" |
---|
908 | open="click" |
---|
909 | filltext="<%=fillText.toString()%>" |
---|
910 | > |
---|
911 | |
---|
912 | <m:submenu |
---|
913 | subid="file" |
---|
914 | title="File" |
---|
915 | /> |
---|
916 | <m:submenu |
---|
917 | subid="view" |
---|
918 | title="View" |
---|
919 | /> |
---|
920 | <m:submenu |
---|
921 | subid="lims" |
---|
922 | title="Array LIMS" |
---|
923 | /> |
---|
924 | <m:submenu |
---|
925 | subid="administrate" |
---|
926 | title="Administrate" |
---|
927 | visible="<%=hasAdministrate%>" |
---|
928 | /> |
---|
929 | <m:submenu |
---|
930 | subid="help" |
---|
931 | title="Help" |
---|
932 | /> |
---|
933 | </m:menu> |
---|
934 | <br><br> |
---|
935 | <% |
---|
936 | } |
---|
937 | finally |
---|
938 | { |
---|
939 | if (dc != null) dc.close(); |
---|
940 | } |
---|
941 | |
---|
942 | } |
---|
943 | %> |
---|
944 | |
---|
945 | |
---|
946 | |
---|