source: trunk/www/biomaterials/bioplates/view_bioplate.jsp @ 5708

Last change on this file since 5708 was 5708, checked in by Nicklas Nordborg, 12 years ago

References #1590: Documentation cleanup

Biomaterials section. Added empty sections for biomaterial lists and bioplate events that hopefully will be written some day. All screen shots must be updated.

Fixed spelling of "bioplate" in a lot of jsp scripts.

Display well coordinates without brackets. A1 instead of [A,1].

Fixed an issue with the regular expression used to link different help texts in the web client.

Reorganized the biomaterial lims menu so that it is consistent with the documentation.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 22.5 KB
Line 
1<%-- $Id: view_bioplate.jsp 5708 2011-08-25 12:48:46Z nicklas $
2  ------------------------------------------------------------------
3  Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson
4  Copyright (C) 2007 Martin Svensson
5
6  This file is part of BASE - BioArray Software Environment.
7  Available at http://base.thep.lu.se/
8
9  BASE is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License
11  as published by the Free Software Foundation; either version 3
12  of the License, or (at your option) any later version.
13
14  BASE is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  GNU General Public License for more details.
18
19  You should have received a copy of the GNU General Public License
20  along with BASE. If not, see <http://www.gnu.org/licenses/>.
21  ------------------------------------------------------------------
22
23  @author Martin
24  @version 2.10
25--%>
26<%@ page pageEncoding="UTF-8" session="false"
27  import="net.sf.basedb.core.SessionControl"
28  import="net.sf.basedb.core.DbControl"
29  import="net.sf.basedb.core.SystemItems"
30  import="net.sf.basedb.core.Group"
31  import="net.sf.basedb.core.Item"
32  import="net.sf.basedb.core.ItemContext"
33  import="net.sf.basedb.core.Permission"
34  import="net.sf.basedb.core.AnnotationType"
35  import="net.sf.basedb.core.AnnotationSet"
36  import="net.sf.basedb.core.BioPlate"
37  import="net.sf.basedb.core.BioWell"
38  import="net.sf.basedb.core.MeasuredBioMaterial"
39  import="net.sf.basedb.core.PlateGeometry"
40  import="net.sf.basedb.core.User"
41  import="net.sf.basedb.core.ItemQuery"
42  import="net.sf.basedb.core.Include"
43  import="net.sf.basedb.core.ItemResultList"
44  import="net.sf.basedb.core.MultiPermissions"
45  import="net.sf.basedb.core.PermissionDeniedException"
46  import="net.sf.basedb.core.PluginDefinition"
47  import="net.sf.basedb.core.plugin.GuiContext"
48  import="net.sf.basedb.core.plugin.Plugin"
49  import="net.sf.basedb.core.Project"
50  import="net.sf.basedb.core.query.Orders"
51  import="net.sf.basedb.core.query.Hql"
52  import="net.sf.basedb.clients.web.Base"
53  import="net.sf.basedb.clients.web.ChangeHistoryUtil"
54  import="net.sf.basedb.clients.web.PermissionUtil"
55  import="net.sf.basedb.clients.web.util.HTML"
56  import="net.sf.basedb.util.Values"
57  import="net.sf.basedb.util.formatter.Formatter"
58  import="net.sf.basedb.util.formatter.WellCoordinateFormatter"
59  import="net.sf.basedb.clients.web.formatter.FormatterFactory"
60  import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
61  import="net.sf.basedb.clients.web.extensions.JspContext"
62  import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer"
63  import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil"
64  import="net.sf.basedb.util.extensions.ExtensionsInvoker"
65  import="java.util.Collections"
66  import="java.util.Date"
67  import="java.util.Map"
68  import="java.util.Set"
69  import="java.util.List"
70%>
71<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
72<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %>
73<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %>
74<%@ taglib prefix="p" uri="/WEB-INF/path.tld" %>
75<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %>
76<%!
77  private static final Item itemType = Item.BIOPLATE;
78  private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.ITEM);
79%>
80<%
81final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
82final String ID = sc.getId();
83final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null);
84final int itemId = cc.getId();
85final String tab = Values.getString(request.getParameter("tab"), "properties");
86final float scale = Base.getScale(sc);
87final DbControl dc = sc.newDbControl();
88try
89{
90  Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext);
91
92  String title = null;
93  BioPlate bioplate = BioPlate.getById(dc, itemId);
94  Item bioMaterialType = bioplate.getBioPlateType().getBioMaterialType();
95  PlateGeometry geometry = bioplate.getPlateGeometry();
96 
97  final boolean writePermission = bioplate.hasPermission(Permission.WRITE);
98  final boolean deletePermission = bioplate.hasPermission(Permission.DELETE);
99  final boolean sharePermission = bioplate.hasPermission(Permission.SET_PERMISSION);
100  final boolean setOwnerPermission = bioplate.hasPermission(Permission.SET_OWNER);
101  final boolean isRemoved = bioplate.isRemoved();
102  final boolean isUsed = isRemoved && bioplate.isUsed();
103  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
104  final boolean isOwner = bioplate.isOwner();
105  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, bioplate);
106  ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext);
107  Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc);
108  %>
109  <base:page title="<%=title%>">
110  <base:head scripts="tabcontrol.js,table.js,ajax.js,json2.js" 
111    styles="toolbar.css,table.css,headertabcontrol.css,path.css,plate.css">
112    <ext:scripts context="<%=jspContext%>" />
113    <ext:stylesheets context="<%=jspContext%>" />
114    <script language="JavaScript">
115    function editItem()
116    {
117      Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, true);
118    }
119    function shareItem()
120    {
121      Main.openPopup('index.jsp?ID=<%=ID%>&cmd=ShareItem&item_id=<%=itemId%>', 'SharePlate', 600, 400);
122    }
123    function deleteItem()
124    {
125      location.replace('index.jsp?ID=<%=ID%>&cmd=DeleteItem&item_id=<%=itemId%>');
126    }
127    function restoreItem()
128    {
129      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
130    }
131    function deleteItemPermanently()
132    {
133      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
134    }
135    function itemDeleted()
136    {
137      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
138    }
139    function showUsingItems()
140    {
141      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
142    }
143    function setOwner()
144    {
145      Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 150);
146    }
147    function runPlugin(cmd)
148    {
149      Main.openPopup('index.jsp?ID=<%=ID%>&cmd='+cmd+'&item_id=<%=itemId%>', 'RunPlugin'+cmd, 740, 540);
150    }
151    function viewWells()
152    {
153      location.href = 'wells/index.jsp?ID=<%=ID%>&bioplate_id=<%=itemId%>';
154    }
155    function viewEvents()
156    {
157      location.href = 'events/index.jsp?ID=<%=ID%>&bioplate_id=<%=itemId%>';
158    }
159    function switchTab(tabControlId, tabId)
160    {
161      if (tabId == 'history' && tabId != '<%=tab%>')
162      {
163        location.href = 'index.jsp?ID=<%=ID%>&cmd=ViewItem&item_id=<%=itemId%>&tab='+tabId;
164      }
165      else if (tabId == 'wells')
166      {
167        viewWells();
168      }
169      else if (tabId == 'events')
170      {
171        viewEvents();
172      }
173      else
174      {
175        TabControl.setActiveTab(tabControlId, tabId);
176      }
177    }
178    function editWell(wellId)
179    {
180      Main.viewOrEditItem('<%=ID%>', 'BIOWELL', wellId, true);
181    }
182    function showWellInfo(evt, coordinate, wellId)
183    {
184      // Display the 'wellInfo' postit note
185      var wellInfo = document.getElementById('wellInfo');
186      var wellTd = document.getElementById('well.' + wellId);
187      var pos = Main.getElementPosition(wellTd);
188      wellInfo.style.left = (pos.left + pos.width - 5) + 'px';
189      wellInfo.style.top = (pos.top + 15) + 'px';
190      Main.show('wellInfo');
191
192      // Get the well information
193      var info = wellInfoCache['well.'+wellId];
194      if (!info)
195      {
196        // Use Ajax to load the information
197        wellInfo.innerHTML = '[' + coordinate + '] loading, please wait...';
198        info = loadWellInfo(wellId);
199      }
200      var html;
201      var bioMaterial = info.bioMaterial;
202      if (bioMaterial)
203      {
204        if (bioMaterial.denied)
205        {
206          html = 'Denied';
207        }
208        else
209        {
210          var id = bioMaterial.id;
211          var type = bioMaterial.type;
212          html = '<b>' + type + '</b>: ';
213          html += Main.linkItem('<%=ID%>', type, id, bioMaterial.editable, bioMaterial.name);
214          html += '<br>'+bioMaterial.description;
215        }
216      }
217      else
218      {
219        html = 'Empty';
220      }
221      wellInfo.innerHTML = html;
222    }
223    function hideWellInfo()
224    {
225      Main.hide('wellInfo');
226    }
227    var wellInfoCache = new Array();
228    function loadWellInfo(wellId)
229    {
230      var request = Ajax.getXmlHttpRequest();
231      var url = 'wells/ajax.jsp?ID=<%=ID%>&cmd=WellInfo&encodeStrings=1&item_id=' + wellId;
232      request.open("GET", url, false);
233      // NOTE! 'false' causes code to wait for the response. aka. 'Synchronous AJAX' or SJAX.
234      request.send(null);
235      var response = Ajax.parseJsonResponse(request.responseText);
236      if (response.status != 'ok')
237      {
238        alert(response.message);
239        return false;
240      }
241
242      wellInfoCache['well.'+wellId] = response;
243      return response;
244    }
245    function viewOrEditWellItem(event, itemType, itemId, editable)
246    {
247      //Main.viewOrEditItem('<%=ID%>', itemType, itemId, editable);
248      Main.itemOnClick(event, '<%=ID%>', itemType, itemId, editable);
249    }
250    function moveBioMaterial()
251    {
252      Main.openPopup('index.jsp?ID=<%=ID%>&item_id=<%=itemId%>&cmd=MoveBioMaterial', 'MoveBioMaterial', 900, 600);
253    }
254    function createChildBioPlate()
255    {
256      Main.openPopup('index.jsp?ID=<%=ID%>&item_id=<%=itemId%>&cmd=CreateChildBioPlate', 'CreateChildBioPlate', 900, 600);
257    }
258    </script>
259  </base:head>
260  <base:body attributes="onmouseout='hideWellInfo()'">
261    <p>
262    <p:path>
263      <p:pathelement title="Bioplates" href="<%="index.jsp?ID="+ID%>" />
264      <p:pathelement title="<%=HTML.encodeTags(bioplate.getName())%>" />
265    </p:path>
266   
267    <t:tabcontrol id="main" active="<%=tab%>" switch="switchTab" remember="false">
268    <t:tab id="properties" title="Properties">
269    <tbl:toolbar
270      >
271      <tbl:button 
272        disabled="<%=writePermission ? false : true%>" 
273        image="<%=writePermission ? "edit.gif" : "edit_disabled.gif"%>" 
274        onclick="editItem()" 
275        title="Edit&hellip;" 
276        tooltip="<%=writePermission ? "Edit this bioplate" : "You do not have permission to edit this bioplate"%>" 
277      />
278      <tbl:button 
279        disabled="<%=deletePermission ? false : true%>" 
280        image="<%=deletePermission ? "delete.gif" : "delete_disabled.gif"%>" 
281        onclick="deleteItem()" 
282        title="Delete"
283        visible="<%=!bioplate.isRemoved()%>"
284        tooltip="<%=deletePermission ? "Delete this bioplate" : "You do not have permission to delete this bioplate"%>" 
285      />
286      <tbl:button 
287        disabled="<%=writePermission ? false : true%>" 
288        image="<%=writePermission ? "restore.gif" : "restore_disabled.gif"%>" 
289        onclick="restoreItem()" 
290        title="Restore"
291        visible="<%=bioplate.isRemoved()%>"
292        tooltip="<%=writePermission ? "Restore this bioplate" : "You do not have permission to restore this bioplate"%>" 
293      />
294      <tbl:button 
295        disabled="<%=sharePermission ? false : true%>"
296        image="<%=sharePermission ? "share.gif" : "share_disabled.gif"%>"
297        onclick="shareItem()" 
298        title="Share&hellip;" 
299        tooltip="<%=sharePermission ? "Share this bioplate to other user, groups and projects" : "You do not have permission to share this bioplate"%>"
300      />
301      <tbl:button 
302        disabled="<%=setOwnerPermission ? false : true%>"
303        image="<%=setOwnerPermission ? "take_ownership.png" : "take_ownership_disabled.png"%>"
304        onclick="setOwner()" 
305        title="Set owner&hellip;"
306        tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>"
307      />
308      <tbl:button 
309        image="move_to_plate.png" 
310        onclick="moveBioMaterial()" 
311        title="Move biomaterial&hellip;" 
312        tooltip="Move biomaterial on this plate to another plate" 
313      />
314      <tbl:button 
315        image="add.png" 
316        onclick="createChildBioPlate()" 
317        title="<%="Create child bioplate" + (bioMaterialType == Item.EXTRACT ? "/bioassay" : "") +"&hellip;"%>" 
318        tooltip="Create one or more child biomaterial plates" 
319        visible="<%=bioMaterialType != null%>"
320      />
321      <tbl:button 
322        image="import.gif" 
323        onclick="runPlugin('ImportItem')" 
324        title="Import&hellip;" 
325        tooltip="Import data" 
326        visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>"
327      />
328      <tbl:button 
329        image="export.gif" 
330        onclick="runPlugin('ExportItem')" 
331        title="Export&hellip;" 
332        tooltip="Export data" 
333        visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>"
334      />
335      <tbl:button 
336        image="runplugin.gif" 
337        onclick="runPlugin('RunPlugin')" 
338        title="Run plugin&hellip;" 
339        tooltip="Run a plugin" 
340        visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>"
341      />
342      <ext:render extensions="<%=invoker%>" context="<%=jspContext%>" 
343        wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>"/>
344      <tbl:button
345        image="help.gif"
346        onclick="<%="Main.openHelp('" + ID +"', 'plate.view.properties')"%>"
347        title="Help&hellip;"
348        tooltip="Get help about this page"
349      />
350      </tbl:toolbar>
351    <div class="boxedbottom">
352      <div class="itemstatus">Permissions on this item: <i><%=PermissionUtil.getFullPermissionNames(bioplate)%></i></div>
353      <%
354      if (bioplate.isRemoved() || bioplate.isShared())
355      {
356        %>
357        <div class="itemstatus">
358          <base:icon 
359            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
360            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
361            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
362            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
363          <base:icon image="used.gif" 
364            onclick="showUsingItems()"
365            tooltip="Show the items that are using this one"
366            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
367          <base:icon image="shared.gif" 
368            visible="<%=bioplate.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
369        </div>
370        <%
371      }
372      %>
373      <table class="form" cellspacing="0">
374      <tr>
375        <td class="prompt">Name</td>
376        <td><%=HTML.encodeTags(bioplate.getName())%></td>
377      </tr>
378      <tr>
379        <td class="prompt">Barcode</td>
380        <td><%=HTML.encodeTags(bioplate.getBarcode())%></td>
381      </tr>
382      <tr>
383        <td class="prompt">Destroyed</td>
384        <td><%=bioplate.isDestroyed() ? "yes" : "no"%></td>
385      </tr>
386      <tr>
387        <td class="prompt">Bioplate type</td>
388        <td><base:propertyvalue item="<%=bioplate%>" property="bioPlateType" /></td>
389      </tr>
390      <tr>
391        <td class="prompt">Geometry</td>
392        <td><base:propertyvalue item="<%=bioplate%>" property="plateGeometry" /></td>
393      </tr>
394      <tr>
395        <td class="prompt">Free (total) wells</td>
396        <td><%=bioplate.getFreeWells()%> (<%=bioplate.getTotalWells()%>)</td>
397      </tr>
398      <tr>
399        <td class="prompt">Freezer</td>
400        <td><base:propertyvalue item="<%=bioplate%>" property="freezer" /></td>
401      </tr>
402      <tr>
403        <td class="prompt">Owner</td>
404        <td><base:propertyvalue item="<%=bioplate%>" property="owner" /></td>
405      </tr>
406      <tr>
407        <td class="prompt">Description</td>
408        <td><%=HTML.niceFormat(bioplate.getDescription())%></td>
409      </tr>
410      </table>
411     
412      <base:section id="wells" title="Wells" context="<%=cc%>">
413        <table class="plate" cellspacing="0" cellpadding="0" onmouseout="event.cancelBubble=true">
414        <%
415        int columns = geometry.getColumns();
416        int rows = geometry.getRows();
417        WellCoordinateFormatter rowF = new WellCoordinateFormatter(true);
418        WellCoordinateFormatter colF = new WellCoordinateFormatter(false);
419        %>
420        <tr><td></td>
421        <%
422        for (int c = 0; c < columns; ++c)
423        {
424          %>
425          <td class="columnheader"><%=colF.format(c)%></td>
426          <%
427        }
428        %>
429        </tr>
430        <%
431        for (int r = 0; r < rows; ++r)
432        {
433          String row = rowF.format(r);
434          %>
435          <tr><td class="rowheader"><%=row%></td>
436          <%
437          for (int c = 0; c < columns; ++c)
438          {
439            BioWell well = bioplate.getBioWell(r, c);
440            boolean isEmpty = well.isEmpty();
441            boolean hasBeenUsed = well.hasBeenUsed();
442            boolean canAddBioMaterial = well.canAddBioMaterial();
443            boolean canClearBioMaterial = well.canClearBioMaterial();
444            boolean usePermission = well.hasPermission(Permission.USE);
445           
446            boolean deniedBioMaterial = false;
447           
448            String cls = "well";
449            String tooltip = "";
450            String onClick = null;
451            String onMouseOver = "hideWellInfo()";
452           
453            if (isEmpty)
454            {
455              cls += " empty";
456              if (usePermission && canAddBioMaterial)
457              {
458                // The used is allowed to add biomaterial to the empty well
459                cls += " editable";
460                onClick = "editWell(" + well.getId() + ")";
461                tooltip = "Add biomaterial to this well";
462              }
463              else if (hasBeenUsed) 
464              {
465                // The well has been used and it is not allowed to add biomaterial
466                cls += " used";
467                onMouseOver = "showWellInfo(event, '" + row + (c+1) + "', " + well.getId() + ")";
468                tooltip = "This well has already been used";
469              }
470              else
471              {
472                // The user doesn't have permission to add biomaterial
473                cls += " locked";
474                tooltip = "You are not allowed to add biomaterial to this well";
475              }
476            }
477            else
478            {
479              cls += " filled";
480              try
481              {
482                MeasuredBioMaterial bioMaterial = well.getBioMaterial();
483                onMouseOver = "showWellInfo(event, '" + row + (c+1) + "', " + well.getId() + ")";
484                if (usePermission && canClearBioMaterial && bioMaterial.hasPermission(Permission.WRITE))
485                {
486                  // The user is allowed to replace/remove the biomaterial in the well
487                  cls += " editable";
488                  onClick = "editWell(" + well.getId() + ")";
489                  if (canAddBioMaterial)
490                  {
491                    // Replace and/or remove
492                    tooltip = "Change biomaterial in this well";
493                  }
494                  else
495                  {
496                    // Remove only
497                    tooltip = "Remove the biomaterial from this well";
498                  }
499                }
500                else
501                {
502                  cls += " locked";
503                  tooltip = "This well is locked for modifications";
504                }
505              }
506              catch (PermissionDeniedException ex)
507              {
508                cls += " denied";
509                tooltip = "Access denied";
510              }
511            }
512            %>
513            <td class="<%=cls%>" id="well.<%=well.getId()%>"
514              <%=onClick != null ? "onclick=\"" + onClick + "\"" : ""%>
515              <%=onMouseOver != null ? "onmouseover=\"" + onMouseOver + "\"" : ""%>
516              title="<%=tooltip%>"></td>
517            <%
518          }
519          %>
520          </tr>
521          <%
522        }
523        %>
524        </table>
525        <div class="postit" id="wellInfo" style="display:none; width: 300px;" onmouseout="event.cancelBubble=true"></div>
526      </base:section>
527      <jsp:include page="../../common/anytoany/list_anytoany.jsp">
528        <jsp:param name="ID" value="<%=ID%>" />
529        <jsp:param name="item_type" value="<%=itemType.name()%>" />
530        <jsp:param name="item_id" value="<%=itemId%>" />
531        <jsp:param name="title" value="Other items related to this bioplate" />
532      </jsp:include>
533      <%
534      // Tables with users/groups/projects that this item is shared to
535      MultiPermissions mp = new MultiPermissions(Collections.singleton(bioplate));
536      ItemResultList<User> users = mp.getUsers().list(dc);
537      ItemResultList<Group> groups = mp.getGroups().list(dc);
538      ItemResultList<Project> projects = mp.getProjects().list(dc);
539      int totalShare = users.size() + groups.size() + projects.size();
540     
541      if (totalShare > 0)
542      {
543        %>
544        <base:section 
545          id="sharedTo" 
546          title="<%="Shared to (" + totalShare + ")"%>"
547          context="<%=cc%>"
548          >
549          <tbl:table 
550            id="itemsSharedTo"
551            clazz="itemlist"
552            columns="all"
553          >
554            <tbl:columndef 
555              id="itemType"
556              title="Item type"
557            />
558            <tbl:columndef 
559              id="name"
560              title="Name"
561            />
562            <tbl:columndef 
563              id="permissions"
564              title="Permissions"
565            />
566            <tbl:data>
567              <tbl:columns>
568              </tbl:columns>
569              <tbl:rows>
570              <%
571              for (Project project : projects)
572              {
573                Set<Permission> permissions = mp.getPermissions(project).values().iterator().next();
574                %>     
575                <tbl:row>
576                  <tbl:cell column="itemType"><%=project.getType()%></tbl:cell>
577                  <tbl:cell column="name"><base:icon 
578                    image="deleted.gif" 
579                    tooltip="This item has been scheduled for deletion" 
580                    visible="<%=project.isRemoved()%>"
581                  /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell>
582                  <tbl:cell column="permissions">
583                    <%=PermissionUtil.translatePermissionsToString(permissions)%>
584                  </tbl:cell>
585                </tbl:row>
586                <%
587              }
588              for (Group group : groups)
589              {
590                Set<Permission> permissions = mp.getPermissions(group).values().iterator().next();
591                %>
592                <tbl:row>             
593                  <tbl:cell column="itemType"><%=group.getType()%></tbl:cell>
594                  <tbl:cell column="name"><base:icon 
595                    image="deleted.gif" 
596                    tooltip="This item has been scheduled for deletion" 
597                    visible="<%=group.isRemoved()%>"
598                  /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell>
599                  <tbl:cell column="permissions">
600                    <%=PermissionUtil.translatePermissionsToString(permissions)%>
601                  </tbl:cell>
602                </tbl:row>
603                <% 
604              }
605              for (User user : users)
606              {
607                Set<Permission> permissions = mp.getPermissions(user).values().iterator().next();
608                %>
609                <tbl:row>             
610                  <tbl:cell column="itemType"><%=user.getType()%></tbl:cell>
611                  <tbl:cell column="name"><base:icon 
612                    image="deleted.gif" 
613                    tooltip="This item has been scheduled for deletion" 
614                    visible="<%=user.isRemoved()%>"
615                  /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell>
616                  <tbl:cell column="permissions">
617                    <%=PermissionUtil.translatePermissionsToString(permissions)%>
618                  </tbl:cell>
619                </tbl:row>
620                <%
621              }
622              %>
623              </tbl:rows>
624            </tbl:data>
625          </tbl:table>
626        </base:section>
627        <%
628      }
629      else
630      {
631        %>
632        <h4>Shared to</h4>
633        This bioplate is not shared
634        (or, you don't have permission to view the ones it is shared to).
635        <%
636      }
637      %>
638
639
640    </div>
641      </t:tab>
642     
643      <t:tab id="annotations" title="Annotations" >
644        <div class="boxed">
645        <jsp:include page="../../common/annotations/list_annotations.jsp">
646          <jsp:param name="item_type" value="<%=itemType.name()%>" />
647          <jsp:param name="item_id" value="<%=itemId%>" />
648          <jsp:param name="ID" value="<%=ID%>" />
649        </jsp:include>
650        </div>
651      </t:tab>
652      <t:tab id="wells" title="Wells" />
653      <t:tab id="events" title="Plate events" />
654      <t:tab id="history" title="Change history" 
655        tooltip="Displays a log of all modifications made to this item"
656        visible="<%=ChangeHistoryUtil.showChangeHistoryTab(sc)%>">
657        <%
658        if ("history".equals(tab))
659        {
660          %>
661          <jsp:include page="../../common/history/frameset.jsp">
662            <jsp:param name="source_type" value="<%=itemType.name()%>" />
663            <jsp:param name="source_id" value="<%=itemId%>" />
664            <jsp:param name="ID" value="<%=ID%>" />
665          </jsp:include>
666          <%
667        }
668        %>
669      </t:tab>
670      </t:tabcontrol>
671  </base:body>
672  </base:page>
673  <%
674}
675finally
676{
677  if (dc != null) dc.close();
678}
679%>
Note: See TracBrowser for help on using the repository browser.