Changeset 4003


Ignore:
Timestamp:
Nov 26, 2007, 2:22:16 PM (16 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #608: Delete 'removed' items directly from list views

Location:
trunk/www
Files:
1 added
98 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/admin/annotationtypecategories/list_categories.jsp

    r3990 r4003  
    148148      frm.submit();
    149149    }
     150    function deleteItemPermanently(itemId)
     151    {
     152      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     153    }
    150154    function takeOwnership()
    151155    {
     
    374378              String openSharePopup = "shareItem("+itemId+")";
    375379              String name = HTML.encodeTags(item.getName());
     380              String deletePermanently = "deleteItemPermanently("+itemId+")";
     381              boolean deletePermission = item.hasPermission(Permission.DELETE);
    376382              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
    377383              boolean writePermission = item.hasPermission(Permission.WRITE);
     
    409415                  visible="<%=mode.hasIcons()%>"
    410416                  ><base:icon
    411                     image="deleted.gif"
     417                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     418                    onclick="<%=deletePermission ? deletePermanently : null%>"
    412419                    tooltip="This item has been scheduled for deletion"
    413420                    visible="<%=item.isRemoved()%>"
  • trunk/www/admin/annotationtypecategories/view_category.jsp

    r3990 r4003  
    8383  final boolean setOwnerPermission = annotationTypeCategory.hasPermission(Permission.SET_OWNER);
    8484  final boolean isOwner = annotationTypeCategory.isOwner();
     85  final boolean isRemoved = annotationTypeCategory.isRemoved();
     86  final boolean isUsed = isRemoved && annotationTypeCategory.isUsed();
     87  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    8588  %>
    8689  <base:page title="<%=title%>">
     
    98101    {
    99102      location.replace('index.jsp?ID=<%=ID%>&cmd=DeleteItem&item_id=<%=itemId%>');
     103    }
     104    function deleteItemPermanently()
     105    {
     106      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     107    }
     108    function itemDeleted()
     109    {
     110      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     111    }
     112    function showUsingItems()
     113    {
     114      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    100115    }
    101116    function restoreItem()
     
    200215        %>
    201216        <div class="itemstatus">
    202           <base:icon image="deleted.gif"
    203             visible="<%=annotationTypeCategory.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     217          <base:icon
     218            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     219            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     220            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     221            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     222          <base:icon image="used.gif"
     223            onclick="showUsingItems()"
     224            tooltip="Show the items that are using this one"
     225            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    204226          <base:icon image="shared.gif"
    205227            visible="<%=annotationTypeCategory.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
  • trunk/www/admin/annotationtypes/list_annotationtypes.jsp

    r3990 r4003  
    174174      frm.submit();
    175175    }
     176    function deleteItemPermanently(itemId)
     177    {
     178      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     179    }
    176180    function takeOwnership()
    177181    {
     
    473477              int itemId = item.getId();
    474478              String openSharePopup = "shareItem("+itemId+")";
     479              String deletePermanently = "deleteItemPermanently("+itemId+")";
     480              boolean deletePermission = item.hasPermission(Permission.DELETE);
    475481              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
    476482              boolean writePermission = item.hasPermission(Permission.WRITE);
     
    510516                  visible="<%=mode.hasIcons()%>"
    511517                  ><base:icon
    512                     image="deleted.gif"
     518                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     519                    onclick="<%=deletePermission ? deletePermanently : null%>"
    513520                    tooltip="This item has been scheduled for deletion"
    514521                    visible="<%=item.isRemoved()%>"
  • trunk/www/admin/annotationtypes/view_annotationtype.jsp

    r3990 r4003  
    8888  final boolean setOwnerPermission = annotationType.hasPermission(Permission.SET_OWNER);
    8989  final boolean isOwner = annotationType.isOwner();
     90  final boolean isRemoved = annotationType.isRemoved();
     91  final boolean isUsed = isRemoved && annotationType.isUsed();
     92  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    9093  Formatter dateFormatter = FormatterFactory.getDateFormatter(sc);
    9194  %>
     
    108111    {
    109112      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     113    }
     114    function deleteItemPermanently()
     115    {
     116      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     117    }
     118    function itemDeleted()
     119    {
     120      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     121    }
     122    function showUsingItems()
     123    {
     124      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    110125    }
    111126    function takeOwnership()
     
    207222        %>
    208223        <div class="itemstatus">
    209           <base:icon image="deleted.gif"
    210             visible="<%=annotationType.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     224          <base:icon
     225            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     226            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     227            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     228            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     229          <base:icon image="used.gif"
     230            onclick="showUsingItems()"
     231            tooltip="Show the items that are using this one"
     232            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    211233          <base:icon image="shared.gif"
    212234            visible="<%=annotationType.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
  • trunk/www/admin/clients/list_clients.jsp

    r3990 r4003  
    131131      frm.submit();
    132132    }
     133    function deleteItemPermanently(itemId)
     134    {
     135      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     136    }
    133137    function takeOwnership()
    134138    {
     
    360364              int itemId = item.getId();
    361365              String openSharePopup = "shareItem("+itemId+")";
     366              String deletePermanently = "deleteItemPermanently("+itemId+")";
     367              boolean deletePermission = item.hasPermission(Permission.DELETE);
    362368              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
    363369              boolean writePermission = item.hasPermission(Permission.WRITE);
     
    396402                  visible="<%=mode.hasIcons()%>"
    397403                  ><base:icon
    398                     image="deleted.gif"
     404                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     405                    onclick="<%=deletePermission ? deletePermanently : null%>"
    399406                    tooltip="This item has been scheduled for deletion"
    400407                    visible="<%=item.isRemoved()%>"
  • trunk/www/admin/clients/view_client.jsp

    r3990 r4003  
    7878  final boolean setOwnerPermission = client.hasPermission(Permission.SET_OWNER);
    7979  final boolean isOwner = client.isOwner();
     80  final boolean isRemoved = client.isRemoved();
     81  final boolean isUsed = isRemoved && client.isUsed();
     82  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    8083  %>
    8184  <base:page title="<%=title%>">
     
    97100    {
    98101      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     102    }
     103    function deleteItemPermanently()
     104    {
     105      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     106    }
     107    function itemDeleted()
     108    {
     109      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     110    }
     111    function showUsingItems()
     112    {
     113      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    99114    }
    100115    function takeOwnership()
     
    211226        %>
    212227        <div class="itemstatus">
    213           <base:icon image="deleted.gif"
    214             visible="<%=client.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     228          <base:icon
     229            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     230            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     231            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     232            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     233          <base:icon image="used.gif"
     234            onclick="showUsingItems()"
     235            tooltip="Show the items that are using this one"
     236            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    215237          <base:icon image="shared.gif"
    216238            visible="<%=client.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
  • trunk/www/admin/datafiletypes/list_filetypes.jsp

    r3820 r4003  
    1 <%-- $Id$
     1<%-- $Id:list_filetypes.jsp 3820 2007-10-12 10:03:18Z nicklas $
    22  ------------------------------------------------------------------
    33  Copyright (C) 2007 Nicklas Nordborg
     
    164164      frm.submit();
    165165    }
     166    function deleteItemPermanently(itemId)
     167    {
     168      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     169    }
    166170    function configureColumns()
    167171    {
     
    398402              String tooltip = mode.isSelectionMode() ?
    399403                  "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : "");
     404              String deletePermanently = "deleteItemPermanently("+itemId+")";
    400405              index++;
    401406              numListed++;
     
    429434                  visible="<%=mode.hasIcons()%>"
    430435                  ><base:icon
    431                     image="deleted.gif"
     436                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     437                    onclick="<%=deletePermission ? deletePermanently : null%>"
    432438                    tooltip="This item has been scheduled for deletion"
    433439                    visible="<%=item.isRemoved()%>"
  • trunk/www/admin/datafiletypes/view_filetype.jsp

    r3890 r4003  
    7676  final boolean writePermission = fileType.hasPermission(Permission.WRITE);
    7777  final boolean deletePermission = fileType.hasPermission(Permission.DELETE);
     78  final boolean isRemoved = fileType.isRemoved();
     79  final boolean isUsed = isRemoved && fileType.isUsed();
     80  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    7881  %>
    7982
     
    9497    {
    9598      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     99    }
     100    function deleteItemPermanently()
     101    {
     102      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     103    }
     104    function itemDeleted()
     105    {
     106      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     107    }
     108    function showUsingItems()
     109    {
     110      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    96111    }
    97112    function runPlugin(cmd)
     
    174189        %>
    175190        <div class="itemstatus">
    176           <base:icon image="deleted.gif"
    177             visible="<%=fileType.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     191          <base:icon
     192            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     193            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     194            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     195            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     196          <base:icon image="used.gif"
     197            onclick="showUsingItems()"
     198            tooltip="Show the items that are using this one"
     199            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    178200        </div>
    179201        <%
  • trunk/www/admin/extravaluetypes/list_extravaluetypes.jsp

    r3675 r4003  
    144144      frm.cmd.value = 'RestoreItems';
    145145      frm.submit();
     146    }
     147    function deleteItemPermanently(itemId)
     148    {
     149      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
    146150    }
    147151    function configureColumns()
     
    391395              String tooltip = mode.isSelectionMode() ?
    392396                  "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : "");
     397              String deletePermanently = "deleteItemPermanently("+itemId+")";
    393398              index++;
    394399              numListed++;
     
    422427                  visible="<%=mode.hasIcons()%>"
    423428                  ><base:icon
    424                     image="deleted.gif"
     429                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     430                    onclick="<%=deletePermission ? deletePermanently : null%>"
    425431                    tooltip="This item has been scheduled for deletion"
    426432                    visible="<%=item.isRemoved()%>"
  • trunk/www/admin/extravaluetypes/view_extravaluetype.jsp

    r3675 r4003  
    6969  final boolean writePermission = extraValueType.hasPermission(Permission.WRITE);
    7070  final boolean deletePermission = extraValueType.hasPermission(Permission.DELETE);
     71  final boolean isRemoved = extraValueType.isRemoved();
     72  final boolean isUsed = isRemoved && extraValueType.isUsed();
     73  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    7174  %>
    7275
     
    8588    {
    8689      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     90    }
     91    function deleteItemPermanently()
     92    {
     93      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     94    }
     95    function itemDeleted()
     96    {
     97      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     98    }
     99    function showUsingItems()
     100    {
     101      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    87102    }
    88103    function runPlugin(cmd)
     
    162177        %>
    163178        <div class="itemstatus">
    164           <base:icon image="deleted.gif"
    165             visible="<%=extraValueType.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     179          <base:icon
     180            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     181            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     182            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     183            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     184          <base:icon image="used.gif"
     185            onclick="showUsingItems()"
     186            tooltip="Show the items that are using this one"
     187            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    166188        </div>
    167189        <%
  • trunk/www/admin/groups/list_groups.jsp

    r3679 r4003  
    147147      frm.submit();
    148148    }
     149    function deleteItemPermanently(itemId)
     150    {
     151      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     152    }
    149153    function configureColumns()
    150154    {
     
    354358              String tooltip = mode.isSelectionMode() ?
    355359                  "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : "");
     360              String deletePermanently = "deleteItemPermanently("+itemId+")";
    356361              index++;
    357362              numListed++;
     
    385390                  visible="<%=mode.hasIcons()%>"
    386391                  ><base:icon
    387                     image="deleted.gif"
     392                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     393                    onclick="<%=deletePermission ? deletePermanently : null%>"
    388394                    tooltip="This item has been scheduled for deletion"
    389395                    visible="<%=item.isRemoved()%>"
  • trunk/www/admin/groups/view_group.jsp

    r3890 r4003  
    7575  final boolean writePermission = group.hasPermission(Permission.WRITE);
    7676  final boolean deletePermission = group.hasPermission(Permission.DELETE);
     77  final boolean isRemoved = group.isRemoved();
     78  final boolean isUsed = isRemoved && group.isUsed();
     79  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    7780  %>
    7881
     
    9194    {
    9295      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     96    }
     97    function deleteItemPermanently()
     98    {
     99      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     100    }
     101    function itemDeleted()
     102    {
     103      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     104    }
     105    function showUsingItems()
     106    {
     107      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    93108    }
    94109    function runPlugin(cmd)
     
    168183        %>
    169184        <div class="itemstatus">
    170           <base:icon image="deleted.gif"
    171             visible="<%=group.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     185          <base:icon
     186            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     187            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     188            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     189            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     190          <base:icon image="used.gif"
     191            onclick="showUsingItems()"
     192            tooltip="Show the items that are using this one"
     193            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    172194        </div>
    173195        <%
  • trunk/www/admin/hardware/list_hardware.jsp

    r3990 r4003  
    136136      frm.submit();
    137137    }
     138    function deleteItemPermanently(itemId)
     139    {
     140      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     141    }
    138142    function takeOwnership()
    139143    {
     
    384388              int itemId = item.getId();
    385389              String openSharePopup = "shareItem("+itemId+")";
     390              String deletePermanently = "deleteItemPermanently("+itemId+")";
     391              boolean deletePermission = item.hasPermission(Permission.DELETE);
    386392              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
    387393              boolean writePermission = item.hasPermission(Permission.WRITE);
     
    420426                  visible="<%=mode.hasIcons()%>"
    421427                  ><base:icon
    422                     image="deleted.gif"
     428                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     429                    onclick="<%=deletePermission ? deletePermanently : null%>"
    423430                    tooltip="This item has been scheduled for deletion"
    424431                    visible="<%=item.isRemoved()%>"
  • trunk/www/admin/hardware/view_hardware.jsp

    r3990 r4003  
    7979  final boolean setOwnerPermission = hardware.hasPermission(Permission.SET_OWNER);
    8080  final boolean isOwner = hardware.isOwner();
     81  final boolean isRemoved = hardware.isRemoved();
     82  final boolean isUsed = isRemoved && hardware.isUsed();
     83  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    8184  %>
    8285  <base:page title="<%=title%>">
     
    98101    {
    99102      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     103    }
     104    function deleteItemPermanently()
     105    {
     106      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     107    }
     108    function itemDeleted()
     109    {
     110      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     111    }
     112    function showUsingItems()
     113    {
     114      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    100115    }
    101116    function takeOwnership()
     
    197212        %>
    198213        <div class="itemstatus">
    199           <base:icon image="deleted.gif"
    200             visible="<%=hardware.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     214          <base:icon
     215            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     216            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     217            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     218            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     219          <base:icon image="used.gif"
     220            onclick="showUsingItems()"
     221            tooltip="Show the items that are using this one"
     222            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    201223          <base:icon image="shared.gif"
    202224            visible="<%=hardware.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
  • trunk/www/admin/hardwaretypes/list_hardwaretypes.jsp

    r3679 r4003  
    142142      frm.submit();
    143143    }
     144    function deleteItemPermanently(itemId)
     145    {
     146      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     147    }
    144148    function configureColumns()
    145149    {
     
    323327              int itemId = item.getId();
    324328              String name = HTML.encodeTags(item.getName());
     329              String deletePermanently = "deleteItemPermanently("+itemId+")";
    325330              boolean usePermission = item.hasPermission(Permission.USE);
    326331              String tooltip = mode.isSelectionMode() ?
     
    357362                  visible="<%=mode.hasIcons()%>"
    358363                  ><base:icon
    359                     image="deleted.gif"
     364                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     365                    onclick="<%=deletePermission ? deletePermanently : null%>"
    360366                    tooltip="This item has been scheduled for deletion"
    361367                    visible="<%=item.isRemoved()%>"
  • trunk/www/admin/hardwaretypes/view_hardwaretype.jsp

    r3890 r4003  
    7474  final boolean writePermission = hardwareType.hasPermission(Permission.WRITE);
    7575  final boolean deletePermission = hardwareType.hasPermission(Permission.DELETE);
     76  final boolean isRemoved = hardwareType.isRemoved();
     77  final boolean isUsed = isRemoved && hardwareType.isUsed();
     78  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    7679  %>
    7780
     
    9093    {
    9194      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     95    }
     96    function deleteItemPermanently()
     97    {
     98      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     99    }
     100    function itemDeleted()
     101    {
     102      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     103    }
     104    function showUsingItems()
     105    {
     106      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    92107    }
    93108    function runPlugin(cmd)
     
    171186        %>
    172187        <div class="itemstatus">
    173           <base:icon image="deleted.gif"
    174             visible="<%=hardwareType.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     188          <base:icon
     189            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     190            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     191            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     192            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     193          <base:icon image="used.gif"
     194            onclick="showUsingItems()"
     195            tooltip="Show the items that are using this one"
     196            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    175197        </div>
    176198        <%
  • trunk/www/admin/jobagents/list_agents.jsp

    r3990 r4003  
    141141      frm.submit();
    142142    }
     143    function deleteItemPermanently(itemId)
     144    {
     145      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     146    }
    143147    function takeOwnership()
    144148    {
     
    428432              int itemId = item.getId();
    429433              String openSharePopup = "shareItem("+itemId+")";
     434              String deletePermanently = "deleteItemPermanently("+itemId+")";
     435              boolean deletePermission = item.hasPermission(Permission.DELETE);
    430436              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
    431437              boolean writePermission = item.hasPermission(Permission.WRITE);
     
    464470                  visible="<%=mode.hasIcons()%>"
    465471                  ><base:icon
    466                     image="deleted.gif"
     472                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     473                    onclick="<%=deletePermission ? deletePermanently : null%>"
    467474                    tooltip="This item has been scheduled for deletion"
    468475                    visible="<%=item.isRemoved()%>"
  • trunk/www/admin/jobagents/view_agent.jsp

    r3990 r4003  
    9494  final boolean setOwnerPermission = agent.hasPermission(Permission.SET_OWNER);
    9595  final boolean isOwner = agent.isOwner();
     96  final boolean isRemoved = agent.isRemoved();
     97  final boolean isUsed = isRemoved && agent.isUsed();
     98  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    9699  %>
    97100  <base:page title="<%=title%>">
     
    113116    {
    114117      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     118    }
     119    function deleteItemPermanently()
     120    {
     121      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     122    }
     123    function itemDeleted()
     124    {
     125      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     126    }
     127    function showUsingItems()
     128    {
     129      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    115130    }
    116131    function takeOwnership()
     
    236251      <div class="itemstatus">Permissions on this item: <i><%=PermissionUtil.getFullPermissionNames(agent)%></i></div>
    237252      <div class="itemstatus">
    238         <base:icon image="deleted.gif"
    239           visible="<%=agent.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     253          <base:icon
     254            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     255            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     256            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     257            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     258          <base:icon image="used.gif"
     259            onclick="showUsingItems()"
     260            tooltip="Show the items that are using this one"
     261            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    240262        <base:icon image="shared.gif"
    241263          visible="<%=agent.isShared()%>"> This item is shared to other user, groups and/or projects</base:icon>
  • trunk/www/admin/mimetypes/list_mimetypes.jsp

    r3719 r4003  
    136136      frm.submit();
    137137    }
     138    function deleteItemPermanently(itemId)
     139    {
     140      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     141    }
    138142    function configureColumns()
    139143    {
     
    346350              String tooltip = mode.isSelectionMode() ?
    347351                  "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : "");
     352              String deletePermanently = "deleteItemPermanently("+itemId+")";
    348353              index++;
    349354              numListed++;
     
    377382                  visible="<%=mode.hasIcons()%>"
    378383                  ><base:icon
    379                     image="deleted.gif"
     384                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     385                    onclick="<%=deletePermission ? deletePermanently : null%>"
    380386                    tooltip="This item has been scheduled for deletion"
    381387                    visible="<%=item.isRemoved()%>"
  • trunk/www/admin/mimetypes/view_mimetype.jsp

    r3719 r4003  
    6767  final boolean writePermission = mimeType.hasPermission(Permission.WRITE);
    6868  final boolean deletePermission = mimeType.hasPermission(Permission.DELETE);
     69  final boolean isRemoved = mimeType.isRemoved();
     70  final boolean isUsed = isRemoved && mimeType.isUsed();
     71  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    6972  %>
    7073
     
    8386    {
    8487      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     88    }
     89    function deleteItemPermanently()
     90    {
     91      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     92    }
     93    function itemDeleted()
     94    {
     95      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     96    }
     97    function showUsingItems()
     98    {
     99      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    85100    }
    86101    function runPlugin(cmd)
     
    160175        %>
    161176        <div class="itemstatus">
    162           <base:icon image="deleted.gif"
    163             visible="<%=mimeType.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     177          <base:icon
     178            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     179            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     180            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     181            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     182          <base:icon image="used.gif"
     183            onclick="showUsingItems()"
     184            tooltip="Show the items that are using this one"
     185            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    164186        </div>
    165187        <%
  • trunk/www/admin/news/list_news.jsp

    r3679 r4003  
    134134      frm.submit();
    135135    }
     136    function deleteItemPermanently(itemId)
     137    {
     138      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     139    }
    136140    function configureColumns()
    137141    {
     
    336340              String tooltip = mode.isSelectionMode() ?
    337341                  "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : "");
     342              String deletePermanently = "deleteItemPermanently("+itemId+")";
    338343              index++;
    339344              numListed++;
     
    367372                  visible="<%=mode.hasIcons()%>"
    368373                  ><base:icon
    369                     image="deleted.gif"
     374                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     375                    onclick="<%=deletePermission ? deletePermanently : null%>"
    370376                    tooltip="This item has been scheduled for deletion"
    371377                    visible="<%=item.isRemoved()%>"
  • trunk/www/admin/news/view_news.jsp

    r3679 r4003  
    7070  final boolean writePermission = news.hasPermission(Permission.WRITE);
    7171  final boolean deletePermission = news.hasPermission(Permission.DELETE);
     72  final boolean isRemoved = news.isRemoved();
     73  final boolean isUsed = isRemoved && news.isUsed();
     74  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    7275  Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc);
    7376  %>
     
    8790    {
    8891      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     92    }
     93    function deleteItemPermanently()
     94    {
     95      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     96    }
     97    function itemDeleted()
     98    {
     99      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     100    }
     101    function showUsingItems()
     102    {
     103      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    89104    }
    90105    function runPlugin(cmd)
     
    164179        %>
    165180        <div class="itemstatus">
    166           <base:icon image="deleted.gif"
    167             visible="<%=news.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     181          <base:icon
     182            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     183            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     184            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     185            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     186          <base:icon image="used.gif"
     187            onclick="showUsingItems()"
     188            tooltip="Show the items that are using this one"
     189            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    168190        </div>
    169191        <%
  • trunk/www/admin/platforms/list_platforms.jsp

    r3820 r4003  
    1 <%-- $Id$
     1<%-- $Id:list_platforms.jsp 3820 2007-10-12 10:03:18Z nicklas $
    22  ------------------------------------------------------------------
    33  Copyright (C) 2007 Nicklas Nordborg
     
    143143      frm.submit();
    144144    }
     145    function deleteItemPermanently(itemId)
     146    {
     147      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     148    }
    145149    function configureColumns()
    146150    {
     
    360364              String tooltip = mode.isSelectionMode() ?
    361365                  "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : "");
     366              String deletePermanently = "deleteItemPermanently("+itemId+")";
    362367              index++;
    363368              numListed++;
     
    391396                  visible="<%=mode.hasIcons()%>"
    392397                  ><base:icon
    393                     image="deleted.gif"
     398                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     399                    onclick="<%=deletePermission ? deletePermanently : null%>"
    394400                    tooltip="This item has been scheduled for deletion"
    395401                    visible="<%=item.isRemoved()%>"
  • trunk/www/admin/platforms/variants/list_variants.jsp

    r3820 r4003  
    1 <%-- $Id$
     1<%-- $Id:list_variants.jsp 3820 2007-10-12 10:03:18Z nicklas $
    22  ------------------------------------------------------------------
    33  Copyright (C) 2006 Jari Hakkinen, Nicklas Nordborg, Martin Svensson
     
    136136      frm.submit();
    137137    }
     138    function deleteItemPermanently(itemId)
     139    {
     140      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     141    }
    138142    function configureColumns()
    139143    {
     
    371375              String tooltip = mode.isSelectionMode() ?
    372376                  "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : "");
     377              String deletePermanently = "deleteItemPermanently("+itemId+")";
    373378              index++;
    374379              numListed++;
     
    402407                  visible="<%=mode.hasIcons()%>"
    403408                  ><base:icon
    404                     image="deleted.gif"
     409                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     410                    onclick="<%=deletePermission ? deletePermanently : null%>"
    405411                    tooltip="This item has been scheduled for deletion"
    406412                    visible="<%=item.isRemoved()%>"
  • trunk/www/admin/platforms/variants/view_variant.jsp

    r3890 r4003  
    7979  final boolean writePermission = variant.hasPermission(Permission.WRITE);
    8080  final boolean deletePermission = variant.hasPermission(Permission.DELETE);
     81  final boolean isRemoved = variant.isRemoved();
     82  final boolean isUsed = isRemoved && variant.isUsed();
     83  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    8184  %>
    8285
     
    9699    {
    97100      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&platform_id=<%=platformId%>&item_id=<%=itemId%>');
     101    }
     102    function deleteItemPermanently()
     103    {
     104      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     105    }
     106    function itemDeleted()
     107    {
     108      Main.listItems('<%=ID%>', '<%=itemType.name()%>', '&platform_id=<%=platformId%>');
     109    }
     110    function showUsingItems()
     111    {
     112      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    98113    }
    99114    function runPlugin(cmd)
     
    176191        %>
    177192        <div class="itemstatus">
    178           <base:icon image="deleted.gif"
    179             visible="<%=variant.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     193          <base:icon
     194            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     195            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     196            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     197            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     198          <base:icon image="used.gif"
     199            onclick="showUsingItems()"
     200            tooltip="Show the items that are using this one"
     201            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    180202        </div>
    181203        <%
  • trunk/www/admin/platforms/view_platform.jsp

    r3890 r4003  
    7878  final boolean writePermission = platform.hasPermission(Permission.WRITE);
    7979  final boolean deletePermission = platform.hasPermission(Permission.DELETE);
     80  final boolean isRemoved = platform.isRemoved();
     81  final boolean isUsed = isRemoved && platform.isUsed();
     82  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    8083  %>
    8184
     
    9598    {
    9699      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     100    }
     101    function deleteItemPermanently()
     102    {
     103      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     104    }
     105    function itemDeleted()
     106    {
     107      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     108    }
     109    function showUsingItems()
     110    {
     111      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    97112    }
    98113    function runPlugin(cmd)
     
    198213        %>
    199214        <div class="itemstatus">
    200           <base:icon image="deleted.gif"
    201             visible="<%=platform.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     215          <base:icon
     216            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     217            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     218            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     219            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     220          <base:icon image="used.gif"
     221            onclick="showUsingItems()"
     222            tooltip="Show the items that are using this one"
     223            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    202224        </div>
    203225        <%
  • trunk/www/admin/pluginconfigurations/list_configurations.jsp

    r3990 r4003  
    159159      frm.cmd.value = 'RestoreItems';
    160160      frm.submit();
     161    }
     162    function deleteItemPermanently(itemId)
     163    {
     164      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
    161165    }
    162166    function unloadItems()
     
    442446              String openSharePopup = "shareItem("+itemId+")";
    443447              String openCopyPopup = "copyItem("+itemId+")";
     448              String deletePermanently = "deleteItemPermanently("+itemId+")";
     449              boolean deletePermission = item.hasPermission(Permission.DELETE);
    444450              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
    445451              boolean writePermission = item.hasPermission(Permission.WRITE);
     
    478484                  visible="<%=mode.hasIcons()%>"
    479485                  ><base:icon
    480                     image="deleted.gif"
     486                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     487                    onclick="<%=deletePermission ? deletePermanently : null%>"
    481488                    tooltip="This item has been scheduled for deletion"
    482489                    visible="<%=item.isRemoved()%>"
  • trunk/www/admin/pluginconfigurations/view_configuration.jsp

    r3990 r4003  
    9393  final boolean sharePermission = configuration.hasPermission(Permission.SET_PERMISSION);
    9494  final boolean setOwnerPermission = configuration.hasPermission(Permission.SET_OWNER);
     95  final boolean isRemoved = configuration.isRemoved();
     96  final boolean isUsed = isRemoved && configuration.isUsed();
     97  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    9598  final boolean isOwner = configuration.isOwner();
    9699
     
    136139      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
    137140    }
     141    function deleteItemPermanently()
     142    {
     143      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     144    }
     145    function itemDeleted()
     146    {
     147      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     148    }
     149    function showUsingItems()
     150    {
     151      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
     152    }
    138153    function takeOwnership()
    139154    {
     
    251266        %>
    252267        <div class="itemstatus">
    253           <base:icon image="deleted.gif"
    254             visible="<%=configuration.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     268          <base:icon
     269            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     270            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     271            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     272            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     273          <base:icon image="used.gif"
     274            onclick="showUsingItems()"
     275            tooltip="Show the items that are using this one"
     276            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    255277          <base:icon image="shared.gif"
    256278            visible="<%=configuration.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
  • trunk/www/admin/plugindefinitions/list_plugins.jsp

    r3990 r4003  
    164164      frm.submit();
    165165    }
     166    function deleteItemPermanently(itemId)
     167    {
     168      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     169    }
    166170    function takeOwnership()
    167171    {
     
    572576              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
    573577              String name = HTML.encodeTags(item.getName());
     578              String deletePermanently = "deleteItemPermanently("+itemId+")";
     579              boolean deletePermission = item.hasPermission(Permission.DELETE);
    574580              boolean usePermission = item.hasPermission(Permission.USE);
    575581              boolean writePermission = item.hasPermission(Permission.WRITE);
     
    607613                  visible="<%=mode.hasIcons()%>"
    608614                  ><base:icon
    609                     image="deleted.gif"
     615                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     616                    onclick="<%=deletePermission ? deletePermanently : null%>"
    610617                    tooltip="This item has been scheduled for deletion"
    611618                    visible="<%=item.isRemoved()%>"
  • trunk/www/admin/plugindefinitions/view_plugin.jsp

    r3990 r4003  
    112112  final boolean sharePermission = plugin.hasPermission(Permission.SET_PERMISSION);
    113113  final boolean setOwnerPermission = plugin.hasPermission(Permission.SET_OWNER);
     114  final boolean isRemoved = plugin.isRemoved();
     115  final boolean isUsed = isRemoved && plugin.isUsed();
     116  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    114117  final boolean isOwner = plugin.isOwner();
    115118 
     
    141144    {
    142145      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     146    }
     147    function deleteItemPermanently()
     148    {
     149      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     150    }
     151    function itemDeleted()
     152    {
     153      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     154    }
     155    function showUsingItems()
     156    {
     157      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    143158    }
    144159    function takeOwnership()
     
    269284        %>
    270285        <div class="itemstatus">
    271           <base:icon image="deleted.gif"
    272             visible="<%=plugin.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     286          <base:icon
     287            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     288            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     289            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     290            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     291          <base:icon image="used.gif"
     292            onclick="showUsingItems()"
     293            tooltip="Show the items that are using this one"
     294            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    273295          <base:icon image="shared.gif"
    274296            visible="<%=plugin.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
  • trunk/www/admin/plugintypes/list_plugintypes.jsp

    r3679 r4003  
    141141      frm.submit();
    142142    }
     143    function deleteItemPermanently(itemId)
     144    {
     145      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     146    }
    143147    function configureColumns()
    144148    {
     
    335339              String tooltip = mode.isSelectionMode() ?
    336340                  "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : "");
     341              String deletePermanently = "deleteItemPermanently("+itemId+")";
    337342              index++;
    338343              numListed++;
     
    366371                  visible="<%=mode.hasIcons()%>"
    367372                  ><base:icon
    368                     image="deleted.gif"
     373                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     374                    onclick="<%=deletePermission ? deletePermanently : null%>"
    369375                    tooltip="This item has been scheduled for deletion"
    370376                    visible="<%=item.isRemoved()%>"
  • trunk/www/admin/plugintypes/view_plugintype.jsp

    r3890 r4003  
    7474  final boolean writePermission = pluginType.hasPermission(Permission.WRITE);
    7575  final boolean deletePermission = pluginType.hasPermission(Permission.DELETE);
     76  final boolean isRemoved = pluginType.isRemoved();
     77  final boolean isUsed = isRemoved && pluginType.isUsed();
     78  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    7679  %>
    7780
     
    9093    {
    9194      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     95    }
     96    function deleteItemPermanently()
     97    {
     98      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     99    }
     100    function itemDeleted()
     101    {
     102      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     103    }
     104    function showUsingItems()
     105    {
     106      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    92107    }
    93108    function runPlugin(cmd)
     
    167182        %>
    168183        <div class="itemstatus">
    169           <base:icon image="deleted.gif"
    170             visible="<%=pluginType.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     184          <base:icon
     185            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     186            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     187            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     188            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     189          <base:icon image="used.gif"
     190            onclick="showUsingItems()"
     191            tooltip="Show the items that are using this one"
     192            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    171193        </div>
    172194        <%
  • trunk/www/admin/protocols/list_protocol.jsp

    r3990 r4003  
    136136      frm.submit();
    137137    }
     138    function deleteItemPermanently(itemId)
     139    {
     140      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     141    }
    138142    function takeOwnership()
    139143    {
     
    384388              int itemId = item.getId();
    385389              String openSharePopup = "shareItem("+itemId+")";
     390              String deletePermanently = "deleteItemPermanently("+itemId+")";
     391              boolean deletePermission = item.hasPermission(Permission.DELETE);
    386392              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
    387393              boolean writePermission = item.hasPermission(Permission.WRITE);
     
    420426                  visible="<%=mode.hasIcons()%>"
    421427                  ><base:icon
    422                     image="deleted.gif"
     428                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     429                    onclick="<%=deletePermission ? deletePermanently : null%>"
    423430                    tooltip="This item has been scheduled for deletion"
    424431                    visible="<%=item.isRemoved()%>"
  • trunk/www/admin/protocols/view_protocol.jsp

    r3990 r4003  
    8585  final boolean sharePermission = protocol.hasPermission(Permission.SET_PERMISSION);
    8686  final boolean setOwnerPermission = protocol.hasPermission(Permission.SET_OWNER);
     87  final boolean isRemoved = protocol.isRemoved();
     88  final boolean isUsed = isRemoved && protocol.isUsed();
     89  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    8790  final boolean isOwner = protocol.isOwner();
    8891  %>
     
    105108    {
    106109      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     110    }
     111    function deleteItemPermanently()
     112    {
     113      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     114    }
     115    function itemDeleted()
     116    {
     117      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     118    }
     119    function showUsingItems()
     120    {
     121      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    107122    }
    108123    function takeOwnership()
     
    204219        %>
    205220        <div class="itemstatus">
    206           <base:icon image="deleted.gif"
    207             visible="<%=protocol.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     221          <base:icon
     222            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     223            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     224            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     225            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     226          <base:icon image="used.gif"
     227            onclick="showUsingItems()"
     228            tooltip="Show the items that are using this one"
     229            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    208230          <base:icon image="shared.gif"
    209231            visible="<%=protocol.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
  • trunk/www/admin/protocoltypes/list_protocoltype.jsp

    r3679 r4003  
    141141      frm.submit();
    142142    }
     143    function deleteItemPermanently(itemId)
     144    {
     145      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     146    }
    143147    function configureColumns()
    144148    {
     
    331335              String tooltip = mode.isSelectionMode() ?
    332336                  "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : "");
     337              String deletePermanently = "deleteItemPermanently("+itemId+")";
    333338              index++;
    334339              numListed++;
     
    362367                  visible="<%=mode.hasIcons()%>"
    363368                  ><base:icon
    364                     image="deleted.gif"
     369                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     370                    onclick="<%=deletePermission ? deletePermanently : null%>"
    365371                    tooltip="This item has been scheduled for deletion"
    366372                    visible="<%=item.isRemoved()%>"
  • trunk/www/admin/protocoltypes/view_protocoltype.jsp

    r3890 r4003  
    7474  final boolean writePermission = protocolType.hasPermission(Permission.WRITE);
    7575  final boolean deletePermission = protocolType.hasPermission(Permission.DELETE);
     76  final boolean isRemoved = protocolType.isRemoved();
     77  final boolean isUsed = isRemoved && protocolType.isUsed();
     78  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    7679  %>
    7780
     
    9093    {
    9194      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     95    }
     96    function deleteItemPermanently()
     97    {
     98      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     99    }
     100    function itemDeleted()
     101    {
     102      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     103    }
     104    function showUsingItems()
     105    {
     106      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    92107    }
    93108    function runPlugin(cmd)
     
    178193        %>
    179194        <div class="itemstatus">
    180           <base:icon image="deleted.gif"
    181             visible="<%=protocolType.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     195          <base:icon
     196            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     197            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     198            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     199            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     200          <base:icon image="used.gif"
     201            onclick="showUsingItems()"
     202            tooltip="Show the items that are using this one"
     203            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    182204        </div>
    183205        <%
  • trunk/www/admin/quota/list_quota.jsp

    r3679 r4003  
    134134      frm.submit();
    135135    }
     136    function deleteItemPermanently(itemId)
     137    {
     138      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     139    }
    136140    function configureColumns()
    137141    {
     
    319323              String tooltip = mode.isSelectionMode() ?
    320324                  "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : "");
     325              String deletePermanently = "deleteItemPermanently("+itemId+")";
    321326              index++;
    322327              numListed++;
     
    351356                  visible="<%=mode.hasIcons()%>"
    352357                  ><base:icon
    353                     image="deleted.gif"
     358                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     359                    onclick="<%=deletePermission ? deletePermanently : null%>"
    354360                    tooltip="This item has been scheduled for deletion"
    355361                    visible="<%=item.isRemoved()%>"
  • trunk/www/admin/quota/view_quota.jsp

    r3679 r4003  
    9090  final boolean writePermission = quota.hasPermission(Permission.WRITE);
    9191  final boolean deletePermission = quota.hasPermission(Permission.DELETE);
     92  final boolean isRemoved = quota.isRemoved();
     93  final boolean isUsed = isRemoved && quota.isUsed();
     94  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    9295 
    9396  final QuotaType total = QuotaType.getById(dc, SystemItems.getId(QuotaType.TOTAL));
     
    119122    {
    120123      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     124    }
     125    function deleteItemPermanently()
     126    {
     127      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     128    }
     129    function itemDeleted()
     130    {
     131      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     132    }
     133    function showUsingItems()
     134    {
     135      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    121136    }
    122137    function runPlugin(cmd)
     
    196211        %>
    197212        <div class="itemstatus">
    198           <base:icon image="deleted.gif"
    199             visible="<%=quota.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     213          <base:icon
     214            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     215            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     216            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     217            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     218          <base:icon image="used.gif"
     219            onclick="showUsingItems()"
     220            tooltip="Show the items that are using this one"
     221            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    200222        </div>
    201223        <%
  • trunk/www/admin/reportertypes/list_reportertypes.jsp

    r3679 r4003  
    130130      frm.submit();
    131131    }
     132    function deleteItemPermanently(itemId)
     133    {
     134      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     135    }
    132136    function configureColumns()
    133137    {
     
    302306              String tooltip = mode.isSelectionMode() ?
    303307                  "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : "");
     308              String deletePermanently = "deleteItemPermanently("+itemId+")";
    304309              index++;
    305310              numListed++;
     
    333338                  visible="<%=mode.hasIcons()%>"
    334339                  ><base:icon
    335                     image="deleted.gif"
     340                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     341                    onclick="<%=deletePermission ? deletePermanently : null%>"
    336342                    tooltip="This item has been scheduled for deletion"
    337343                    visible="<%=item.isRemoved()%>"
  • trunk/www/admin/reportertypes/view_reportertype.jsp

    r3679 r4003  
    6767  final boolean writePermission = reporterType.hasPermission(Permission.WRITE);
    6868  final boolean deletePermission = reporterType.hasPermission(Permission.DELETE);
     69  final boolean isRemoved = reporterType.isRemoved();
     70  final boolean isUsed = isRemoved && reporterType.isUsed();
     71  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    6972  %>
    7073
     
    8386    {
    8487      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     88    }
     89    function deleteItemPermanently()
     90    {
     91      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     92    }
     93    function itemDeleted()
     94    {
     95      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     96    }
     97    function showUsingItems()
     98    {
     99      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    85100    }
    86101    function runPlugin(cmd)
     
    160175        %>
    161176        <div class="itemstatus">
    162           <base:icon image="deleted.gif"
    163             visible="<%=reporterType.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     177          <base:icon
     178            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     179            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     180            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     181            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     182          <base:icon image="used.gif"
     183            onclick="showUsingItems()"
     184            tooltip="Show the items that are using this one"
     185            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    164186        </div>
    165187        <%
  • trunk/www/admin/roles/list_roles.jsp

    r3679 r4003  
    140140      frm.submit();
    141141    }
     142    function deleteItemPermanently(itemId)
     143    {
     144      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     145    }
    142146    function configureColumns()
    143147    {
     
    334338              String tooltip = mode.isSelectionMode() ?
    335339                  "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : "");
     340              String deletePermanently = "deleteItemPermanently("+itemId+")";
    336341              index++;
    337342              numListed++;
     
    365370                  visible="<%=mode.hasIcons()%>"
    366371                  ><base:icon
    367                     image="deleted.gif"
     372                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     373                    onclick="<%=deletePermission ? deletePermanently : null%>"
    368374                    tooltip="This item has been scheduled for deletion"
    369375                    visible="<%=item.isRemoved()%>"
  • trunk/www/admin/roles/view_role.jsp

    r3890 r4003  
    9595  final boolean writePermission = role.hasPermission(Permission.WRITE);
    9696  final boolean deletePermission = role.hasPermission(Permission.DELETE);
     97  final boolean isRemoved = role.isRemoved();
     98  final boolean isUsed = isRemoved && role.isUsed();
     99  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    97100  %>
    98101
     
    111114    {
    112115      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     116    }
     117    function deleteItemPermanently()
     118    {
     119      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     120    }
     121    function itemDeleted()
     122    {
     123      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     124    }
     125    function showUsingItems()
     126    {
     127      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
     128    }
     129    function deleteItemPermanently()
     130    {
     131      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     132    }
     133    function itemDeleted()
     134    {
     135      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     136    }
     137    function showUsingItems()
     138    {
     139      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    113140    }
    114141    function runPlugin(cmd)
     
    188215        %>
    189216        <div class="itemstatus">
    190           <base:icon image="deleted.gif"
    191             visible="<%=role.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     217          <base:icon
     218            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     219            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     220            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     221            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     222          <base:icon image="used.gif"
     223            onclick="showUsingItems()"
     224            tooltip="Show the items that are using this one"
     225            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    192226        </div>
    193227        <%
  • trunk/www/admin/software/list_software.jsp

    r3990 r4003  
    136136      frm.submit();
    137137    }
     138    function deleteItemPermanently(itemId)
     139    {
     140      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     141    }
    138142    function takeOwnership()
    139143    {
     
    384388              int itemId = item.getId();
    385389              String openSharePopup = "shareItem("+itemId+")";
     390              String deletePermanently = "deleteItemPermanently("+itemId+")";
     391              boolean deletePermission = item.hasPermission(Permission.DELETE);
    386392              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
    387393              boolean writePermission = item.hasPermission(Permission.WRITE);
     
    420426                  visible="<%=mode.hasIcons()%>"
    421427                  ><base:icon
    422                     image="deleted.gif"
     428                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     429                    onclick="<%=deletePermission ? deletePermanently : null%>"
    423430                    tooltip="This item has been scheduled for deletion"
    424431                    visible="<%=item.isRemoved()%>"
  • trunk/www/admin/software/view_software.jsp

    r3990 r4003  
    7878  final boolean sharePermission = software.hasPermission(Permission.SET_PERMISSION);
    7979  final boolean setOwnerPermission = software.hasPermission(Permission.SET_OWNER);
     80  final boolean isRemoved = software.isRemoved();
     81  final boolean isUsed = isRemoved && software.isUsed();
     82  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    8083  final boolean isOwner = software.isOwner();
    8184  %>
     
    98101    {
    99102      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     103    }
     104    function deleteItemPermanently()
     105    {
     106      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     107    }
     108    function itemDeleted()
     109    {
     110      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     111    }
     112    function showUsingItems()
     113    {
     114      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    100115    }
    101116    function takeOwnership()
     
    196211        %>
    197212        <div class="itemstatus">
    198           <base:icon image="deleted.gif"
    199             visible="<%=software.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     213          <base:icon
     214            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     215            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     216            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     217            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     218          <base:icon image="used.gif"
     219            onclick="showUsingItems()"
     220            tooltip="Show the items that are using this one"
     221            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    200222          <base:icon image="shared.gif"
    201223            visible="<%=software.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
  • trunk/www/admin/users/list_users.jsp

    r3679 r4003  
    158158      frm.submit();
    159159    }
     160    function deleteItemPermanently(itemId)
     161    {
     162      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     163    }
    160164    function configureColumns()
    161165    {
     
    520524              String tooltip = mode.isSelectionMode() ?
    521525                  "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : "");
     526              String deletePermanently = "deleteItemPermanently("+itemId+")";
    522527              index++;
    523528              numListed++;
     
    551556                  visible="<%=mode.hasIcons()%>"
    552557                  ><base:icon
    553                     image="deleted.gif"
     558                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     559                    onclick="<%=deletePermission ? deletePermanently : null%>"
    554560                    tooltip="This item has been scheduled for deletion"
    555561                    visible="<%=item.isRemoved()%>"
  • trunk/www/admin/users/view_user.jsp

    r3890 r4003  
    8484  final boolean writePermission = user.hasPermission(Permission.WRITE);
    8585  final boolean deletePermission = user.hasPermission(Permission.DELETE);
     86  final boolean isRemoved = user.isRemoved();
     87  final boolean isUsed = isRemoved && user.isUsed();
     88  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    8689  %>
    8790
     
    100103    {
    101104      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     105    }
     106    function deleteItemPermanently()
     107    {
     108      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     109    }
     110    function itemDeleted()
     111    {
     112      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     113    }
     114    function showUsingItems()
     115    {
     116      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    102117    }
    103118    function runPlugin(cmd)
     
    177192        %>
    178193        <div class="itemstatus">
    179           <base:icon image="deleted.gif"
    180             visible="<%=user.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     194          <base:icon
     195            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     196            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     197            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     198            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     199          <base:icon image="used.gif"
     200            onclick="showUsingItems()"
     201            tooltip="Show the items that are using this one"
     202            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    181203        </div>
    182204        <%
  • trunk/www/biomaterials/biosources/list_biosources.jsp

    r3990 r4003  
    149149      frm.submit();
    150150    }
     151    function deleteItemPermanently(itemId)
     152    {
     153      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     154    }
    151155    function takeOwnership()
    152156    {
     
    418422              boolean usePermission = item.hasPermission(Permission.USE);
    419423              String openSharePopup = "shareItem("+itemId+")";
     424              String deletePermanently = "deleteItemPermanently("+itemId+")";
     425              boolean deletePermission = item.hasPermission(Permission.DELETE);
    420426              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
    421427              boolean writePermission = item.hasPermission(Permission.WRITE);
     
    454460                  visible="<%=mode.hasIcons()%>"
    455461                  ><base:icon
    456                     image="deleted.gif"
     462                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     463                    onclick="<%=deletePermission ? deletePermanently : null%>"
    457464                    tooltip="This item has been scheduled for deletion"
    458465                    visible="<%=item.isRemoved()%>"
  • trunk/www/biomaterials/biosources/view_biosource.jsp

    r3990 r4003  
    9191  final boolean sharePermission = bioSource.hasPermission(Permission.SET_PERMISSION);
    9292  final boolean setOwnerPermission = bioSource.hasPermission(Permission.SET_OWNER);
     93  final boolean isRemoved = bioSource.isRemoved();
     94  final boolean isUsed = isRemoved && bioSource.isUsed();
     95  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    9396  final boolean isOwner = bioSource.isOwner();
    9497  %>
     
    112115    {
    113116      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     117    }
     118    function deleteItemPermanently()
     119    {
     120      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     121    }
     122    function itemDeleted()
     123    {
     124      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     125    }
     126    function showUsingItems()
     127    {
     128      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    114129    }
    115130    function takeOwnership()
     
    222237        %>
    223238        <div class="itemstatus">
    224           <base:icon image="deleted.gif"
    225             visible="<%=bioSource.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     239          <base:icon
     240            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     241            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     242            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     243            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     244          <base:icon image="used.gif"
     245            onclick="showUsingItems()"
     246            tooltip="Show the items that are using this one"
     247            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    226248          <base:icon image="shared.gif"
    227249            visible="<%=bioSource.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
  • trunk/www/biomaterials/extracts/list_extracts.jsp

    r3990 r4003  
    159159      frm.submit();
    160160    }
     161    function deleteItemPermanently(itemId)
     162    {
     163      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     164    }
    161165    function takeOwnership()
    162166    {
     
    495499              boolean usePermission = item.hasPermission(Permission.USE);
    496500              String openSharePopup = "shareItem("+itemId+")";
     501              String deletePermanently = "deleteItemPermanently("+itemId+")";
     502              boolean deletePermission = item.hasPermission(Permission.DELETE);
    497503              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
    498504              boolean writePermission = item.hasPermission(Permission.WRITE);
     
    531537                  visible="<%=mode.hasIcons()%>"
    532538                  ><base:icon
    533                     image="deleted.gif"
     539                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     540                    onclick="<%=deletePermission ? deletePermanently : null%>"
    534541                    tooltip="This item has been scheduled for deletion"
    535542                    visible="<%=item.isRemoved()%>"
  • trunk/www/biomaterials/extracts/view_extract.jsp

    r3990 r4003  
    9797  final boolean usePermission = extract.hasPermission(Permission.USE);
    9898  final boolean setOwnerPermission = extract.hasPermission(Permission.SET_OWNER);
     99  final boolean isRemoved = extract.isRemoved();
     100  final boolean isUsed = isRemoved && extract.isUsed();
     101  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    99102  final boolean isOwner = extract.isOwner(); 
    100103  %>
     
    118121    {
    119122      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     123    }
     124    function deleteItemPermanently()
     125    {
     126      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     127    }
     128    function itemDeleted()
     129    {
     130      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     131    }
     132    function showUsingItems()
     133    {
     134      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    120135    }
    121136    function takeOwnership()
     
    243258        %>
    244259        <div class="itemstatus">
    245           <base:icon image="deleted.gif"
    246             visible="<%=extract.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     260          <base:icon
     261            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     262            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     263            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     264            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     265          <base:icon image="used.gif"
     266            onclick="showUsingItems()"
     267            tooltip="Show the items that are using this one"
     268            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    247269          <base:icon image="shared.gif"
    248270            visible="<%=extract.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
  • trunk/www/biomaterials/labeledextracts/list_labeledextracts.jsp

    r3990 r4003  
    155155      frm.submit();
    156156    }
     157    function deleteItemPermanently(itemId)
     158    {
     159      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     160    }
    157161    function takeOwnership()
    158162    {
     
    509513              int itemId = item.getId();
    510514              String openSharePopup = "shareItem("+itemId+")";
     515              String deletePermanently = "deleteItemPermanently("+itemId+")";
     516              boolean deletePermission = item.hasPermission(Permission.DELETE);
    511517              boolean usePermission = item.hasPermission(Permission.USE);
    512518              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);             
     
    546552                  visible="<%=mode.hasIcons()%>"
    547553                  ><base:icon
    548                     image="deleted.gif"
     554                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     555                    onclick="<%=deletePermission ? deletePermanently : null%>"
    549556                    tooltip="This item has been scheduled for deletion"
    550557                    visible="<%=item.isRemoved()%>"
  • trunk/www/biomaterials/labeledextracts/view_labeledextract.jsp

    r3990 r4003  
    9595  final boolean usePermission = extract.hasPermission(Permission.USE);
    9696  final boolean setOwnerPermission = extract.hasPermission(Permission.SET_OWNER);
     97  final boolean isRemoved = extract.isRemoved();
     98  final boolean isUsed = isRemoved && extract.isUsed();
     99  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    97100  final boolean isOwner = extract.isOwner();
    98101  %>
     
    116119    {
    117120      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     121    }
     122    function deleteItemPermanently()
     123    {
     124      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     125    }
     126    function itemDeleted()
     127    {
     128      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     129    }
     130    function showUsingItems()
     131    {
     132      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    118133    }
    119134    function takeOwnership()
     
    241256        %>
    242257        <div class="itemstatus">
    243           <base:icon image="deleted.gif"
    244             visible="<%=extract.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     258          <base:icon
     259            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     260            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     261            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     262            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     263          <base:icon image="used.gif"
     264            onclick="showUsingItems()"
     265            tooltip="Show the items that are using this one"
     266            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    245267          <base:icon image="shared.gif"
    246268            visible="<%=extract.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
  • trunk/www/biomaterials/labels/list_labels.jsp

    r3990 r4003  
    129129      frm.submit();
    130130    }
     131    function deleteItemPermanently(itemId)
     132    {
     133      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     134    }
    131135    function takeOwnership()
    132136    {
     
    356360              labeledExtractQuery.order(Orders.asc(Hql.property("name")));             
    357361              String openSharePopup = "shareItem("+itemId+")";
     362              String deletePermanently = "deleteItemPermanently("+itemId+")";
     363              boolean deletePermission = item.hasPermission(Permission.DELETE);
    358364              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 
    359365              boolean usePermission = item.hasPermission(Permission.USE);
     
    393399                  visible="<%=mode.hasIcons()%>"
    394400                  ><base:icon
    395                     image="deleted.gif"
     401                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     402                    onclick="<%=deletePermission ? deletePermanently : null%>"
    396403                    tooltip="This item has been scheduled for deletion"
    397404                    visible="<%=item.isRemoved()%>"
  • trunk/www/biomaterials/labels/view_label.jsp

    r3990 r4003  
    8484  final boolean usePermission = label.hasPermission(Permission.USE);
    8585  final boolean setOwnerPermission = label.hasPermission(Permission.SET_OWNER);
     86  final boolean isRemoved = label.isRemoved();
     87  final boolean isUsed = isRemoved && label.isUsed();
     88  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    8689  final boolean isOwner = label.isOwner();
    8790  %>
     
    104107    {
    105108      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     109    }
     110    function deleteItemPermanently()
     111    {
     112      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     113    }
     114    function itemDeleted()
     115    {
     116      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     117    }
     118    function showUsingItems()
     119    {
     120      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    106121    }
    107122    function takeOwnership()
     
    213228        %>
    214229        <div class="itemstatus">
    215           <base:icon image="deleted.gif"
    216             visible="<%=label.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     230          <base:icon
     231            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     232            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     233            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     234            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     235          <base:icon image="used.gif"
     236            onclick="showUsingItems()"
     237            tooltip="Show the items that are using this one"
     238            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    217239          <base:icon image="shared.gif"
    218240            visible="<%=label.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
  • trunk/www/biomaterials/samples/list_samples.jsp

    r3990 r4003  
    160160      frm.submit();
    161161    }
     162    function deleteItemPermanently(itemId)
     163    {
     164      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     165    }
    162166    function takeOwnership()
    163167    {
     
    496500              boolean usePermission = item.hasPermission(Permission.USE);
    497501              String openSharePopup = "shareItem("+itemId+")";
     502              String deletePermanently = "deleteItemPermanently("+itemId+")";
     503              boolean deletePermission = item.hasPermission(Permission.DELETE);
    498504              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
    499505              boolean writePermission = item.hasPermission(Permission.WRITE);
     
    532538                  visible="<%=mode.hasIcons()%>"
    533539                  ><base:icon
    534                     image="deleted.gif"
     540                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     541                    onclick="<%=deletePermission ? deletePermanently : null%>"
    535542                    tooltip="This item has been scheduled for deletion"
    536543                    visible="<%=item.isRemoved()%>"
  • trunk/www/biomaterials/samples/view_sample.jsp

    r3990 r4003  
    9494  final boolean sharePermission = sample.hasPermission(Permission.SET_PERMISSION);
    9595  final boolean setOwnerPermission = sample.hasPermission(Permission.SET_OWNER);
     96  final boolean isRemoved = sample.isRemoved();
     97  final boolean isUsed = isRemoved && sample.isUsed();
     98  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    9699  final boolean isOwner = sample.isOwner();
    97100  %>
     
    119122    {
    120123      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     124    }
     125    function deleteItemPermanently()
     126    {
     127      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     128    }
     129    function itemDeleted()
     130    {
     131      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     132    }
     133    function showUsingItems()
     134    {
     135      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    121136    }
    122137    function takeOwnership()
     
    240255        %>
    241256        <div class="itemstatus">
    242           <base:icon image="deleted.gif"
    243             visible="<%=sample.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     257          <base:icon
     258            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     259            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     260            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     261            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     262          <base:icon image="used.gif"
     263            onclick="showUsingItems()"
     264            tooltip="Show the items that are using this one"
     265            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    244266          <base:icon image="shared.gif"
    245267            visible="<%=sample.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
  • trunk/www/common/close_popup.jsp

    r3679 r4003  
    3636    specified 1200 is used.
    3737
     38  @param callback
     39    The name of a callback method that will be called on the
     40    opening window before the popup is closed.
     41
    3842  @param redirect_opener
    3943    If specified the window that opened the popup will be redirected
    40     to this URL.
     44    to this URL. Ignored if callback is specified.
    4145
    4246  @param redirect_main
    4347    If specified the main window will be redirected to this URL.
    44     Ignored if redirect_opener is specified.
     48    Ignored if redirect_opener or callback is specified.
    4549
    4650  @param refresh_opener
    4751    If specified with a non-zero value the window that opened
    48     the popup will be reloaded. Ignored if redirect_main or
    49     redirect_opener is specified.
     52    the popup will be reloaded. Ignored if redirect_main,
     53    redirect_opener or callback is specified.
    5054
    5155  @author Nicklas
     
    6468String refreshOpener = request.getParameter("refresh_opener");
    6569String reopenOpener = request.getParameter("reopen_opener");
     70String callback = request.getParameter("callback");
    6671
    6772%>
     
    8691    var topWindow = window.top;
    8792    <%
    88     if (redirectOpener != null)
     93    if (callback != null)
     94    {
     95      %>
     96      myOpener = topWindow.opener;
     97      if (myOpener.<%=callback%>) myOpener.<%=callback%>();
     98      <%
     99    }
     100    else if (redirectOpener != null)
    89101    {
    90102      %>
  • trunk/www/filemanager/files/list_files.jsp

    r3990 r4003  
    211211      frm.submit();
    212212    }
     213    function deleteFilePermanently(itemId)
     214    {
     215      Main.deleteItemPermanently('<%=ID%>', true, 'FILE', itemId);
     216    }
     217    function deleteDirectoryPermanently(itemId)
     218    {
     219      Main.deleteItemPermanently('<%=ID%>', true, 'DIRECTORY', itemId);
     220    }
    213221    function takeOwnership()
    214222    {
     
    667675              int itemId = item.getId();
    668676              String openSharePopup = "shareDirectory("+itemId+")";
     677              String deletePermanently = "deleteDirectoryPermanently("+itemId+")";
     678              boolean deletePermission = item.hasPermission(Permission.DELETE);
    669679              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
    670680              String name = HTML.encodeTags(item.getName());
     
    697707                  visible="<%=mode.hasIcons()%>"
    698708                  ><base:icon
    699                     image="deleted.gif"
     709                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     710                    onclick="<%=deletePermission ? deletePermanently : null%>"
    700711                    tooltip="This item has been scheduled for deletion"
    701712                    visible="<%=item.isRemoved()%>"
     
    747758              int itemId = item.getId();
    748759              String openSharePopup = "shareFile("+itemId+")";
     760              String deletePermanently = "deleteFilePermanently("+itemId+")";
     761              boolean deletePermission = item.hasPermission(Permission.DELETE);
    749762              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
    750763              boolean writePermission = item.hasPermission(Permission.WRITE);
     
    791804                  visible="<%=mode.hasIcons()%>"
    792805                  ><base:icon
    793                     image="deleted.gif"
     806                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     807                    onclick="<%=deletePermission ? deletePermanently : null%>"
    794808                    tooltip="This item has been scheduled for deletion"
    795809                    visible="<%=item.isRemoved()%>"
  • trunk/www/filemanager/files/view_file.jsp

    r3990 r4003  
    8383  final boolean sharePermission = file.hasPermission(Permission.SET_PERMISSION);
    8484  final boolean setOwnerPermission = file.hasPermission(Permission.SET_OWNER);
     85  final boolean isRemoved = file.isRemoved();
     86  final boolean isUsed = isRemoved && file.isUsed();
     87  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    8588  final boolean isOwner = file.isOwner();
    8689  Formatter<Date> dateTimeFormatter = FormatterFactory.getDateTimeFormatter(sc);
     
    104107    {
    105108      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     109    }
     110    function deleteItemPermanently()
     111    {
     112      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     113    }
     114    function itemDeleted()
     115    {
     116      location.replace(getRoot() + 'filemanager/files/index.jsp?ID=<%=ID%>');
     117    }
     118    function showUsingItems()
     119    {
     120      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    106121    }
    107122    function takeOwnership()
     
    232247        %>
    233248        <div class="itemstatus">
    234           <base:icon image="deleted.gif"
    235             visible="<%=file.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     249          <base:icon
     250            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     251            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     252            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     253            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     254          <base:icon image="used.gif"
     255            onclick="showUsingItems()"
     256            tooltip="Show the items that are using this one"
     257            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    236258          <base:icon image="shared.gif"
    237259            visible="<%=file.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
  • trunk/www/include/scripts/main.js

    r3990 r4003  
    460460  }
    461461 
     462  this.listItems = function(ID, itemType, extraUrl)
     463  {
     464    var controller = this.getController(itemType);
     465    var url = getRoot() + controller.url + '?ID='+ID+'&cmd=List';
     466    if (extraUrl) url += extraUrl;
     467    location.replace(url);
     468  }
     469 
    462470  this.viewOrEditItem = function(ID, itemType, itemId, edit, extraUrl, popupOptions)
    463471  {
     
    470478   
    471479    var cmd = itemId == 0 ? 'NewItem' : (edit ? 'EditItem' : 'ViewItem');
    472     var url = getRoot();
    473    
    474480    var url = getRoot() + controller.url + '?ID='+ID+'&cmd='+cmd;
    475481    if (itemId) url += '&item_id='+itemId;
     
    536542    if (extraUrl) url += extraUrl;
    537543    Main.openPopup(url, 'Select'+itemType, width, height, popupOptions);
     544  }
     545 
     546  this.deleteItemPermanently = function(ID, ask, itemType, itemId, extraUrl, popupOptions)
     547  {
     548    if (ask)
     549    {
     550      if (!confirm('Delete this item permanently?')) return;
     551    }
     552    var url = getRoot();
     553    url += 'views/trashcan/index.jsp?ID='+ID+'&cmd=DeleteItem&popup=1';
     554    url += '&item_type='+itemType+'&item_id=' + itemId;
     555    if (extraUrl) url += extraUrl;
     556    var width = 300;
     557    var height = 200;
     558    Main.openPopup(url, 'Delete'+itemType, width, height, popupOptions);
     559  }
     560
     561  this.showUsingItems = function(ID, itemType, itemId, extraUrl)
     562  {
     563    var url = getRoot();
     564    url += 'views/trashcan/index.jsp?ID='+ID+'&cmd=ViewUsingItems';
     565    url += '&item_type='+itemType+'&item_id='+itemId;
     566    if (extraUrl) url += extraUrl;
     567    location.href = url;
    538568  }
    539569 
  • trunk/www/lims/arraybatches/list_batches.jsp

    r3990 r4003  
    151151      frm.submit();
    152152    }
     153    function deleteItemPermanently(itemId)
     154    {
     155      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     156    }
    153157    function takeOwnership()
    154158    {
     
    441445              int itemId = item.getId();
    442446              String openSharePopup = "shareItem("+itemId+")";
     447              String deletePermanently = "deleteItemPermanently("+itemId+")";
     448              boolean deletePermission = item.hasPermission(Permission.DELETE);
    443449              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
    444450              boolean usePermission = item.hasPermission(Permission.USE);
     
    478484                  visible="<%=mode.hasIcons()%>"
    479485                  ><base:icon
    480                     image="deleted.gif"
     486                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     487                    onclick="<%=deletePermission ? deletePermanently : null%>"
    481488                    tooltip="This item has been scheduled for deletion"
    482489                    visible="<%=item.isRemoved()%>"
  • trunk/www/lims/arraybatches/view_batch.jsp

    r3990 r4003  
    9292  final boolean sharePermission = batch.hasPermission(Permission.SET_PERMISSION);
    9393  final boolean setOwnerPermission = batch.hasPermission(Permission.SET_OWNER);
     94  final boolean isRemoved = batch.isRemoved();
     95  final boolean isUsed = isRemoved && batch.isUsed();
     96  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    9497  final boolean isOwner = batch.isOwner();
    9598  %>
     
    113116    {
    114117      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     118    }
     119    function deleteItemPermanently()
     120    {
     121      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     122    }
     123    function itemDeleted()
     124    {
     125      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     126    }
     127    function showUsingItems()
     128    {
     129      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    115130    }
    116131    function takeOwnership()
     
    233248        %>
    234249        <div class="itemstatus">
    235           <base:icon image="deleted.gif"
    236             visible="<%=batch.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     250          <base:icon
     251            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     252            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     253            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     254            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     255          <base:icon image="used.gif"
     256            onclick="showUsingItems()"
     257            tooltip="Show the items that are using this one"
     258            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    237259          <base:icon image="shared.gif"
    238260            visible="<%=batch.isShared()%>"> This item is shared to other user, groups and/or projects</base:icon>
  • trunk/www/lims/arraydesigns/list_designs.jsp

    r3990 r4003  
    167167      frm.submit();
    168168    }
     169    function deleteItemPermanently(itemId)
     170    {
     171      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     172    }
    169173    function takeOwnership()
    170174    {
     
    474478              int itemId = item.getId();
    475479              String openSharePopup = "shareItem("+itemId+")";
     480              String deletePermanently = "deleteItemPermanently("+itemId+")";
     481              boolean deletePermission = item.hasPermission(Permission.DELETE);
    476482              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
    477483              boolean usePermission = item.hasPermission(Permission.USE);
     
    511517                  visible="<%=mode.hasIcons()%>"
    512518                  ><base:icon
    513                     image="deleted.gif"
     519                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     520                    onclick="<%=deletePermission ? deletePermanently : null%>"
    514521                    tooltip="This item has been scheduled for deletion"
    515522                    visible="<%=item.isRemoved()%>"
  • trunk/www/lims/arraydesigns/view_design.jsp

    r3990 r4003  
    9797  final boolean sharePermission = design.hasPermission(Permission.SET_PERMISSION);
    9898  final boolean setOwnerPermission = design.hasPermission(Permission.SET_OWNER);
     99  final boolean isRemoved = design.isRemoved();
     100  final boolean isUsed = isRemoved && design.isUsed();
     101  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    99102  final boolean isOwner = design.isOwner();
    100103  %>
     
    118121    {
    119122      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     123    }
     124    function deleteItemPermanently()
     125    {
     126      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     127    }
     128    function itemDeleted()
     129    {
     130      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     131    }
     132    function showUsingItems()
     133    {
     134      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    120135    }
    121136    function takeOwnership()
     
    257272        %>
    258273        <div class="itemstatus">
    259           <base:icon image="deleted.gif"
    260             visible="<%=design.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     274          <base:icon
     275            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     276            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     277            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     278            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     279          <base:icon image="used.gif"
     280            onclick="showUsingItems()"
     281            tooltip="Show the items that are using this one"
     282            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    261283          <base:icon image="shared.gif"
    262284            visible="<%=design.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
  • trunk/www/lims/arrayslides/list_slides.jsp

    r3990 r4003  
    144144      frm.submit();
    145145    }
     146    function deleteItemPermanently(itemId)
     147    {
     148      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     149    }
    146150    function takeOwnership()
    147151    {
     
    456460              int itemId = item.getId();
    457461              String openSharePopup = "shareItem("+itemId+")";
     462              String deletePermanently = "deleteItemPermanently("+itemId+")";
     463              boolean deletePermission = item.hasPermission(Permission.DELETE);
    458464              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
    459465              boolean writePermission = item.hasPermission(Permission.WRITE);
     
    492498                  visible="<%=mode.hasIcons()%>"
    493499                  ><base:icon
    494                     image="deleted.gif"
     500                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     501                    onclick="<%=deletePermission ? deletePermanently : null%>"
    495502                    tooltip="This item has been scheduled for deletion"
    496503                    visible="<%=item.isRemoved()%>"
  • trunk/www/lims/arrayslides/view_slide.jsp

    r3990 r4003  
    9090  final boolean sharePermission = slide.hasPermission(Permission.SET_PERMISSION);
    9191  final boolean setOwnerPermission = slide.hasPermission(Permission.SET_OWNER);
     92  final boolean isRemoved = slide.isRemoved();
     93  final boolean isUsed = isRemoved && slide.isUsed();
     94  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    9295  final boolean isOwner = slide.isOwner();
    9396  %>
     
    111114    {
    112115      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     116    }
     117    function deleteItemPermanently()
     118    {
     119      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     120    }
     121    function itemDeleted()
     122    {
     123      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     124    }
     125    function showUsingItems()
     126    {
     127      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    113128    }
    114129    function takeOwnership()
     
    209224        %>
    210225        <div class="itemstatus">
    211           <base:icon image="deleted.gif"
    212             visible="<%=slide.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     226          <base:icon
     227            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     228            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     229            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     230            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     231          <base:icon image="used.gif"
     232            onclick="showUsingItems()"
     233            tooltip="Show the items that are using this one"
     234            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    213235          <base:icon image="shared.gif"
    214236            visible="<%=slide.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
  • trunk/www/lims/geometries/list_geometries.jsp

    r3679 r4003  
    6565final String ID = sc.getId();
    6666final boolean createPermission = sc.hasPermission(Permission.CREATE, itemType);
     67final boolean deletePermission = sc.hasPermission(Permission.DELETE, itemType);
    6768final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null);
    6869
     
    138139      frm.cmd.value = 'RestoreItems';
    139140      frm.submit();
     141    }
     142    function deleteItemPermanently(itemId)
     143    {
     144      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
    140145    }
    141146    function configureColumns()
     
    335340              boolean usePermission = item.hasPermission(Permission.USE);
    336341              boolean writePermission = item.hasPermission(Permission.WRITE);
     342              String deletePermanently = "deleteItemPermanently("+itemId+")";
    337343              String tooltip = mode.isSelectionMode() ?
    338344                  "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : "");
     
    368374                  visible="<%=mode.hasIcons()%>"
    369375                  ><base:icon
    370                     image="deleted.gif"
     376                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     377                    onclick="<%=deletePermission ? deletePermanently : null%>"
    371378                    tooltip="This item has been scheduled for deletion"
    372379                    visible="<%=item.isRemoved()%>"
  • trunk/www/lims/geometries/view_geometry.jsp

    r3888 r4003  
    7878  final boolean deletePermission = geometry.hasPermission(Permission.DELETE);
    7979  final boolean sharePermission = geometry.hasPermission(Permission.SET_PERMISSION);
     80  final boolean isRemoved = geometry.isRemoved();
     81  final boolean isUsed = isRemoved && geometry.isUsed();
     82  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    8083  %>
    8184
     
    9497    {
    9598      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     99    }
     100    function deleteItemPermanently()
     101    {
     102      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     103    }
     104    function itemDeleted()
     105    {
     106      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     107    }
     108    function showUsingItems()
     109    {
     110      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    96111    }
    97112    function runPlugin(cmd)
     
    182197        %>
    183198        <div class="itemstatus">
    184           <base:icon image="deleted.gif"
    185             visible="<%=geometry.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     199          <base:icon
     200            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     201            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     202            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     203            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     204          <base:icon image="used.gif"
     205            onclick="showUsingItems()"
     206            tooltip="Show the items that are using this one"
     207            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    186208        </div>
    187209        <%
  • trunk/www/lims/platemappings/list_mappings.jsp

    r3990 r4003  
    139139      frm.submit();
    140140    }
     141    function deleteItemPermanently(itemId)
     142    {
     143      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     144    }
    141145    function takeOwnership()
    142146    {
     
    411415              int itemId = item.getId();
    412416              String openSharePopup = "shareItem("+itemId+")";
     417              String deletePermanently = "deleteItemPermanently("+itemId+")";
     418              boolean deletePermission = item.hasPermission(Permission.DELETE);
    413419              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
    414420              boolean writePermission = item.hasPermission(Permission.WRITE);
     
    447453                  visible="<%=mode.hasIcons()%>"
    448454                  ><base:icon
    449                     image="deleted.gif"
     455                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     456                    onclick="<%=deletePermission ? deletePermanently : null%>"
    450457                    tooltip="This item has been scheduled for deletion"
    451458                    visible="<%=item.isRemoved()%>"
  • trunk/www/lims/platemappings/view_mapping.jsp

    r3990 r4003  
    9393  final boolean sharePermission = mapping.hasPermission(Permission.SET_PERMISSION);
    9494  final boolean setOwnerPermission = mapping.hasPermission(Permission.SET_OWNER);
     95  final boolean isRemoved = mapping.isRemoved();
     96  final boolean isUsed = isRemoved && mapping.isUsed();
     97  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    9598  final boolean isOwner = mapping.isOwner();
    9699  %>
     
    114117    {
    115118      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     119    }
     120    function deleteItemPermanently()
     121    {
     122      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     123    }
     124    function itemDeleted()
     125    {
     126      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     127    }
     128    function showUsingItems()
     129    {
     130      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    116131    }
    117132    function takeOwnership()
     
    212227        %>
    213228        <div class="itemstatus">
    214           <base:icon image="deleted.gif"
    215             visible="<%=mapping.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     229          <base:icon
     230            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     231            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     232            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     233            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     234          <base:icon image="used.gif"
     235            onclick="showUsingItems()"
     236            tooltip="Show the items that are using this one"
     237            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    216238          <base:icon image="shared.gif"
    217239            visible="<%=mapping.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
  • trunk/www/lims/plates/list_plates.jsp

    r3990 r4003  
    161161      frm.submit();
    162162    }
     163    function deleteItemPermanently(itemId)
     164    {
     165      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     166    }
    163167    function takeOwnership()
    164168    {
     
    480484              int itemId = item.getId();
    481485              String openSharePopup = "shareItem("+itemId+")";
     486              String deletePermanently = "deleteItemPermanently("+itemId+")";
     487              boolean deletePermission = item.hasPermission(Permission.DELETE);
    482488              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
    483489              boolean writePermission = item.hasPermission(Permission.WRITE);
     
    516522                  visible="<%=mode.hasIcons()%>"
    517523                  ><base:icon
    518                     image="deleted.gif"
     524                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     525                    onclick="<%=deletePermission ? deletePermanently : null%>"
    519526                    tooltip="This item has been scheduled for deletion"
    520527                    visible="<%=item.isRemoved()%>"
  • trunk/www/lims/plates/view_plate.jsp

    r3990 r4003  
    9898  final boolean sharePermission = plate.hasPermission(Permission.SET_PERMISSION);
    9999  final boolean setOwnerPermission = plate.hasPermission(Permission.SET_OWNER);
     100  final boolean isRemoved = plate.isRemoved();
     101  final boolean isUsed = isRemoved && plate.isUsed();
     102  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    100103  final boolean isOwner = plate.isOwner();
    101104  %>
     
    118121    {
    119122      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     123    }
     124    function deleteItemPermanently()
     125    {
     126      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     127    }
     128    function itemDeleted()
     129    {
     130      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     131    }
     132    function showUsingItems()
     133    {
     134      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    120135    }
    121136    function takeOwnership()
     
    239254        %>
    240255        <div class="itemstatus">
    241           <base:icon image="deleted.gif"
    242             visible="<%=plate.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     256          <base:icon
     257            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     258            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     259            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     260            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     261          <base:icon image="used.gif"
     262            onclick="showUsingItems()"
     263            tooltip="Show the items that are using this one"
     264            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    243265          <base:icon image="shared.gif"
    244266            visible="<%=plate.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
  • trunk/www/lims/platetypes/list_platetypes.jsp

    r3990 r4003  
    148148      frm.submit();
    149149    }
     150    function deleteItemPermanently(itemId)
     151    {
     152      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     153    }
    150154    function takeOwnership()
    151155    {
     
    388392              int itemId = item.getId();
    389393              String openSharePopup = "shareItem("+itemId+")";
     394              String deletePermanently = "deleteItemPermanently("+itemId+")";
     395              boolean deletePermission = item.hasPermission(Permission.DELETE);
    390396              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
    391397              boolean usePermission = item.hasPermission(Permission.USE);
     
    425431                  visible="<%=mode.hasIcons()%>"
    426432                  ><base:icon
    427                     image="deleted.gif"
     433                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     434                    onclick="<%=deletePermission ? deletePermanently : null%>"
    428435                    tooltip="This item has been scheduled for deletion"
    429436                    visible="<%=item.isRemoved()%>"
  • trunk/www/lims/platetypes/view_platetype.jsp

    r3990 r4003  
    8787  final boolean sharePermission = plateType.hasPermission(Permission.SET_PERMISSION);
    8888  final boolean setOwnerPermission = plateType.hasPermission(Permission.SET_OWNER);
     89  final boolean isRemoved = plateType.isRemoved();
     90  final boolean isUsed = isRemoved && plateType.isUsed();
     91  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    8992  final boolean isOwner = plateType.isOwner();
    9093  %>
     
    108111    {
    109112      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     113    }
     114    function deleteItemPermanently()
     115    {
     116      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     117    }
     118    function itemDeleted()
     119    {
     120      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     121    }
     122    function showUsingItems()
     123    {
     124      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    110125    }
    111126    function takeOwnership()
     
    222237          %>
    223238          <div class="itemstatus">
    224             <base:icon image="deleted.gif"
    225               visible="<%=plateType.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     239          <base:icon
     240            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     241            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     242            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     243            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     244          <base:icon image="used.gif"
     245            onclick="showUsingItems()"
     246            tooltip="Show the items that are using this one"
     247            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    226248            <base:icon image="shared.gif"
    227249              visible="<%=plateType.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
  • trunk/www/my_base/messages/list_messages.jsp

    r3679 r4003  
    140140      frm.submit();
    141141    }
     142    function deleteItemPermanently(itemId)
     143    {
     144      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     145    }
    142146    function configureColumns()
    143147    {
     
    342346              int itemId = item.getId();
    343347              String name = HTML.encodeTags(item.getName());
     348              String deletePermanently = "deleteItemPermanently("+itemId+")";
     349              boolean deletePermission = item.hasPermission(Permission.DELETE);
    344350              index++;
    345351              numListed++;
     
    379385                    visible="<%=!item.isRead()%>"
    380386                  /><base:icon
    381                     image="deleted.gif"
     387                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     388                    onclick="<%=deletePermission ? deletePermanently : null%>"
    382389                    tooltip="This item has been scheduled for deletion"
    383390                    visible="<%=item.isRemoved()%>"
  • trunk/www/my_base/messages/view_message.jsp

    r3679 r4003  
    106106  final boolean writePermission = message.hasPermission(Permission.WRITE);
    107107  final boolean deletePermission = message.hasPermission(Permission.DELETE);
     108  final boolean isRemoved = message.isRemoved();
     109  final boolean isUsed = isRemoved && message.isUsed();
     110  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    108111  %>
    109112
    110113  <base:page type="popup" title="<%=title%>">
    111114  <base:head scripts="tabcontrol.js" styles="tabcontrol.css,progressbar.css">
     115  <script language="javascript">
     116    function deleteItemPermanently()
     117    {
     118      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     119    }
     120    function itemDeleted()
     121    {
     122      location.href = getRoot() + 'common/close_popup.jsp?ID=<%=ID%>&refresh_opener=1&wait=0';
     123    }
     124    function showUsingItems()
     125    {
     126      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
     127    }
     128  </script>
    112129  </base:head>
    113130  <base:body>
     
    122139        %>
    123140        <div class="itemstatus">
    124           <base:icon image="deleted.gif"
    125             visible="<%=message.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     141          <base:icon
     142            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     143            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     144            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     145            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     146          <base:icon image="used.gif"
     147            onclick="showUsingItems()"
     148            tooltip="Show the items that are using this one"
     149            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    126150        </div>
    127151        <%
  • trunk/www/my_base/projects/items/list_items.jsp

    r3990 r4003  
    125125      frm.submit();
    126126    }
     127    function deleteItemPermanently(itemType, itemId)
     128    {
     129      Main.deleteItemPermanently('<%=ID%>', true, itemType, itemId);
     130    }
    127131    function takeOwnership()
    128132    {
     
    327331              int itemId = item.getId();
    328332              boolean removed = item instanceof Removable && ((Removable)item).isRemoved();
     333              String deletePermanently = "deleteItemPermanently('" + item.getType().name() + "', "+itemId+")";
     334              boolean deletePermission = item.hasPermission(Permission.DELETE);
    329335              String name = "";
    330336              String description = "";
     
    369375                  clazz="icons"
    370376                  ><base:icon
    371                     image="deleted.gif"
     377                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     378                    onclick="<%=deletePermission ? deletePermanently : null%>"
    372379                    tooltip="This item has been scheduled for deletion"
    373380                    visible="<%=removed%>"
  • trunk/www/my_base/projects/list_projects.jsp

    r3679 r4003  
    129129      frm.submit();
    130130    }
     131    function deleteItemPermanently(itemId)
     132    {
     133      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     134    }
    131135    function takeOwnership()
    132136    {
     
    342346              String name = HTML.encodeTags(item.getName());
    343347              boolean writePermission = item.hasPermission(Permission.WRITE);
     348              String deletePermanently = "deleteItemPermanently("+itemId+")";
     349              boolean deletePermission = item.hasPermission(Permission.DELETE);
    344350              String tooltip = mode.isSelectionMode() ?
    345351                  "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : "");
     
    375381                  visible="<%=mode.hasIcons()%>"
    376382                  ><base:icon
    377                     image="deleted.gif"
     383                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     384                    onclick="<%=deletePermission ? deletePermanently : null%>"
    378385                    tooltip="This item has been scheduled for deletion"
    379386                    visible="<%=item.isRemoved()%>"
  • trunk/www/my_base/projects/view_project.jsp

    r3888 r4003  
    8383  final boolean deletePermission = project.hasPermission(Permission.DELETE);
    8484  final boolean setOwnerPermission = project.hasPermission(Permission.SET_OWNER);
     85  final boolean isRemoved = project.isRemoved();
     86  final boolean isUsed = isRemoved && project.isUsed();
     87  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    8588  final boolean isOwner = project.isOwner();
    8689  %>
     
    100103    {
    101104      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     105    }
     106    function deleteItemPermanently()
     107    {
     108      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     109    }
     110    function itemDeleted()
     111    {
     112      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     113    }
     114    function showUsingItems()
     115    {
     116      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    102117    }
    103118    function takeOwnership()
     
    217232        %>
    218233        <div class="itemstatus">
    219           <base:icon image="deleted.gif"
    220             visible="<%=project.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     234          <base:icon
     235            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     236            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     237            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     238            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     239          <base:icon image="used.gif"
     240            onclick="showUsingItems()"
     241            tooltip="Show the items that are using this one"
     242            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    221243        </div>
    222244        <%
  • trunk/www/views/experiments/bioassaysets/analysis_tree.jsp

    r3679 r4003  
    344344      frm.cmd.value = 'RestoreItems';
    345345      frm.submit();
     346    }
     347    function deleteItemPermanently(itemType, itemId)
     348    {
     349      Main.deleteItemPermanently('<%=ID%>', true, itemType, itemId);
    346350    }
    347351    function configureColumns()
     
    735739                String tooltip = mode.isSelectionMode() ?
    736740                    "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : "");
     741                String deletePermanently = "deleteItemPermanently('" + item.getType().name() + "', "+itemId+")";
    737742                boolean removed = false;
    738743                Transformation t = null;
     
    833838                    visible="<%=mode.hasIcons()%>"
    834839                    ><base:icon
    835                       image="deleted.gif"
     840                      image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     841                      onclick="<%=deletePermission ? deletePermanently : null%>"
    836842                      tooltip="This item has been scheduled for deletion"
    837843                      visible="<%=removed%>"
  • trunk/www/views/experiments/list_experiments.jsp

    r3990 r4003  
    152152      }
    153153    }
     154    function deleteItemPermanently(itemId)
     155    {
     156      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     157    }
    154158    function shareItem(itemId)
    155159    {
     
    479483              int itemId = item.getId();
    480484              String openSharePopup = "shareItem("+itemId+")";
     485              String deletePermanently = "deleteItemPermanently("+itemId+")";
     486              boolean deletePermission = item.hasPermission(Permission.DELETE);
    481487              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
    482488              boolean writePermission = item.hasPermission(Permission.WRITE);
     
    515521                  visible="<%=mode.hasIcons()%>"
    516522                  ><base:icon
    517                     image="deleted.gif"
     523                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     524                    onclick="<%=deletePermission ? deletePermanently : null%>"
    518525                    tooltip="This item has been scheduled for deletion"
    519526                    visible="<%=item.isRemoved()%>"
  • trunk/www/views/experiments/view_experiment.jsp

    r3990 r4003  
    9898  final boolean setOwnerPermission = experiment.hasPermission(Permission.SET_OWNER);
    9999  final boolean isOwner = experiment.isOwner();
     100  final boolean isRemoved = experiment.isRemoved();
     101  final boolean isUsed = isRemoved && experiment.isUsed();
     102  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    100103 
    101104  Map<AnnotationType, Set<Object>> usedFactorValues =
     
    122125      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
    123126    }
     127    function deleteItemPermanently()
     128    {
     129      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     130    }
     131    function itemDeleted()
     132    {
     133      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     134    }
     135    function showUsingItems()
     136    {
     137      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
     138    }
     139   
    124140    function takeOwnership()
    125141    {
     
    270286        %>
    271287        <div class="itemstatus">
    272           <base:icon image="deleted.gif"
    273             visible="<%=experiment.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     288          <base:icon
     289            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     290            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     291            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     292            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     293          <base:icon image="used.gif"
     294            onclick="showUsingItems()"
     295            tooltip="Show the items that are using this one"
     296            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    274297          <base:icon image="shared.gif"
    275298            visible="<%=experiment.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
  • trunk/www/views/formulas/list_formulas.jsp

    r3990 r4003  
    152152      frm.submit();
    153153    }
     154    function deleteItemPermanently(itemId)
     155    {
     156      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     157    }
    154158    function takeOwnership()
    155159    {
     
    477481              int itemId = item.getId();
    478482              String openSharePopup = "shareItem("+itemId+")";
     483              String deletePermanently = "deleteItemPermanently("+itemId+")";
     484              boolean deletePermission = item.hasPermission(Permission.DELETE);
    479485              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
    480486              boolean writePermission = item.hasPermission(Permission.WRITE);
     
    513519                  visible="<%=mode.hasIcons()%>"
    514520                  ><base:icon
    515                     image="deleted.gif"
     521                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     522                    onclick="<%=deletePermission ? deletePermanently : null%>"
    516523                    tooltip="This item has been scheduled for deletion"
    517524                    visible="<%=item.isRemoved()%>"
  • trunk/www/views/formulas/view_formula.jsp

    r3990 r4003  
    8383  final boolean sharePermission = formula.hasPermission(Permission.SET_PERMISSION);
    8484  final boolean setOwnerPermission = formula.hasPermission(Permission.SET_OWNER);
     85  final boolean isRemoved = formula.isRemoved();
     86  final boolean isUsed = isRemoved && formula.isUsed();
     87  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    8588  final boolean isOwner = formula.isOwner();
    8689  %>
     
    104107    {
    105108      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     109    }
     110    function deleteItemPermanently()
     111    {
     112      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     113    }
     114    function itemDeleted()
     115    {
     116      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     117    }
     118    function showUsingItems()
     119    {
     120      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    106121    }
    107122    function takeOwnership()
     
    202217        %>
    203218        <div class="itemstatus">
    204           <base:icon image="deleted.gif"
    205             visible="<%=formula.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     219          <base:icon
     220            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     221            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     222            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     223            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     224          <base:icon image="used.gif"
     225            onclick="showUsingItems()"
     226            tooltip="Show the items that are using this one"
     227            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    206228          <base:icon image="shared.gif"
    207229            visible="<%=formula.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
  • trunk/www/views/hybridizations/list_hybridizations.jsp

    r3990 r4003  
    163163      frm.submit();
    164164    }
     165    function deleteItemPermanently(itemId)
     166    {
     167      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     168    }
    165169    function takeOwnership()
    166170    {
     
    478482              boolean usePermission = item.hasPermission(Permission.USE);
    479483              String openSharePopup = "shareItem("+itemId+")";
     484              String deletePermanently = "deleteItemPermanently("+itemId+")";
     485              boolean deletePermission = item.hasPermission(Permission.DELETE);
    480486              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
    481487              boolean writePermission = item.hasPermission(Permission.WRITE);
     
    514520                  visible="<%=mode.hasIcons()%>"
    515521                  ><base:icon
    516                     image="deleted.gif"
     522                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     523                    onclick="<%=deletePermission ? deletePermanently : null%>"
    517524                    tooltip="This item has been scheduled for deletion"
    518525                    visible="<%=item.isRemoved()%>"
  • trunk/www/views/hybridizations/view_hybridization.jsp

    r3990 r4003  
    9999  final boolean sharePermission = hyb.hasPermission(Permission.SET_PERMISSION);
    100100  final boolean setOwnerPermission = hyb.hasPermission(Permission.SET_OWNER);
     101  final boolean isRemoved = hyb.isRemoved();
     102  final boolean isUsed = isRemoved && hyb.isUsed();
     103  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    101104  final boolean isOwner = hyb.isOwner();
    102105  %>
     
    120123    {
    121124      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     125    }
     126    function deleteItemPermanently()
     127    {
     128      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     129    }
     130    function itemDeleted()
     131    {
     132      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     133    }
     134    function showUsingItems()
     135    {
     136      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    122137    }
    123138    function takeOwnership()
     
    230245        %>
    231246        <div class="itemstatus">
    232           <base:icon image="deleted.gif"
    233             visible="<%=hyb.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     247          <base:icon
     248            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     249            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     250            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     251            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     252          <base:icon image="used.gif"
     253            onclick="showUsingItems()"
     254            tooltip="Show the items that are using this one"
     255            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    234256          <base:icon image="shared.gif"
    235257            visible="<%=hyb.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
  • trunk/www/views/items/list_items.jsp

    r3990 r4003  
    136136      frm.submit();
    137137    }
     138    function deleteItemPermanently(itemType, itemId)
     139    {
     140      Main.deleteItemPermanently('<%=ID%>', true, itemType, itemId);
     141    }
    138142    function shareItem(itemType, itemId)
    139143    {
     
    269273              int itemId = item.getId();
    270274              String openSharePopup = "shareItem('" + item.getType().name() + "', "+itemId+")";
     275              String deletePermanently = "deleteItemPermanently('" + item.getType().name() + "', "+itemId+")";
     276              boolean deletePermission = item.hasPermission(Permission.DELETE);
    271277              String name = "";
    272278              String description = "";
     
    319325                  clazz="icons"
    320326                  ><base:icon
    321                     image="deleted.gif"
     327                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     328                    onclick="<%=deletePermission ? deletePermanently : null%>"
    322329                    tooltip="This item has been marked for deletion"
    323330                    visible="<%=isRemoved%>"
  • trunk/www/views/jobs/list_jobs.jsp

    r3880 r4003  
    144144      frm.submit();
    145145    }
     146    function deleteItemPermanently(itemId)
     147    {
     148      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     149    }
    146150    function takeOwnership()
    147151    {
     
    479483              int itemId = item.getId();
    480484              String name = HTML.encodeTags(item.getName());
     485              String deletePermanently = "deleteItemPermanently("+itemId+")";
     486              boolean deletePermission = item.hasPermission(Permission.DELETE);
    481487              index++;
    482488              numListed++;
     
    520526                  visible="<%=mode.hasIcons()%>"
    521527                  ><base:icon
    522                     image="deleted.gif"
     528                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     529                    onclick="<%=deletePermission ? deletePermanently : null%>"
    523530                    tooltip="This item has been scheduled for deletion"
    524531                    visible="<%=item.isRemoved()%>"
  • trunk/www/views/jobs/view_job.jsp

    r3880 r4003  
    8080  final boolean writePermission = job.hasPermission(Permission.WRITE);
    8181  final boolean deletePermission = job.hasPermission(Permission.DELETE);
     82  final boolean isRemoved = job.isRemoved();
     83  final boolean isUsed = isRemoved && job.isUsed();
     84  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    8285 
    8386  boolean readCurrentConfig = true;
     
    129132    location.href = 'index.jsp?ID=<%=ID%>&cmd=RestartJob&item_id=<%=itemId%>&useLatestConfiguration='+useLatestConfiguration;
    130133  }
     134    function deleteItemPermanently()
     135    {
     136      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     137    }
     138    function itemDeleted()
     139    {
     140      location.href = getRoot() + 'common/close_popup.jsp?ID=<%=ID%>&refresh_opener=1&wait=0';
     141    }
     142    function showUsingItems()
     143    {
     144      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
     145    }
    131146  </script>
    132147  </base:head>
     
    142157        %>
    143158        <div class="itemstatus">
    144           <base:icon image="deleted.gif"
    145             visible="<%=job.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     159          <base:icon
     160            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     161            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     162            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     163            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     164          <base:icon image="used.gif"
     165            onclick="showUsingItems()"
     166            tooltip="Show the items that are using this one"
     167            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    146168        </div>
    147169        <%
  • trunk/www/views/rawbioassays/list_rawbioassays.jsp

    r3990 r4003  
    168168      frm.submit();
    169169    }
     170    function deleteItemPermanently(itemId)
     171    {
     172      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     173    }
    170174    function takeOwnership()
    171175    {
     
    552556              int itemId = item.getId();
    553557              String openSharePopup = "shareItem("+itemId+")";
     558              String deletePermanently = "deleteItemPermanently("+itemId+")";
     559              boolean deletePermission = item.hasPermission(Permission.DELETE);
    554560              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
    555561              boolean writePermission = item.hasPermission(Permission.WRITE);
     
    588594                  visible="<%=mode.hasIcons()%>"
    589595                  ><base:icon
    590                     image="deleted.gif"
     596                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     597                    onclick="<%=deletePermission ? deletePermanently : null%>"
    591598                    tooltip="This item has been scheduled for deletion"
    592599                    visible="<%=item.isRemoved()%>"
  • trunk/www/views/rawbioassays/view_rawbioassay.jsp

    r3990 r4003  
    101101  final boolean sharePermission = rawBioAssay.hasPermission(Permission.SET_PERMISSION);
    102102  final boolean setOwnerPermission = rawBioAssay.hasPermission(Permission.SET_OWNER);
     103  final boolean isRemoved = rawBioAssay.isRemoved();
     104  final boolean isUsed = isRemoved && rawBioAssay.isUsed();
     105  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    103106  final boolean isOwner = rawBioAssay.isOwner();
    104107  %>
     
    122125    {
    123126      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     127    }
     128    function deleteItemPermanently()
     129    {
     130      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     131    }
     132    function itemDeleted()
     133    {
     134      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     135    }
     136    function showUsingItems()
     137    {
     138      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    124139    }
    125140    function takeOwnership()
     
    246261        %>
    247262        <div class="itemstatus">
    248           <base:icon image="deleted.gif"
    249             visible="<%=rawBioAssay.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     263          <base:icon
     264            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     265            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     266            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     267            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     268          <base:icon image="used.gif"
     269            onclick="showUsingItems()"
     270            tooltip="Show the items that are using this one"
     271            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    250272          <base:icon image="shared.gif"
    251273            visible="<%=rawBioAssay.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
  • trunk/www/views/reporterlists/list_reporterlists.jsp

    r3990 r4003  
    128128      frm.submit();
    129129    }
     130    function deleteItemPermanently(itemId)
     131    {
     132      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     133    }
    130134    function takeOwnership()
    131135    {
     
    370374              int itemId = item.getId();
    371375              String openSharePopup = "shareItem("+itemId+")";
     376              String deletePermanently = "deleteItemPermanently("+itemId+")";
     377              boolean deletePermission = item.hasPermission(Permission.DELETE);
    372378              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
    373379              boolean writePermission = item.hasPermission(Permission.WRITE);
     
    406412                  visible="<%=mode.hasIcons()%>"
    407413                  ><base:icon
    408                     image="deleted.gif"
     414                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     415                    onclick="<%=deletePermission ? deletePermanently : null%>"
    409416                    tooltip="This item has been scheduled for deletion"
    410417                    visible="<%=item.isRemoved()%>"
  • trunk/www/views/reporterlists/view_reporterlist.jsp

    r3990 r4003  
    7979  final boolean sharePermission = reporterList.hasPermission(Permission.SET_PERMISSION);
    8080  final boolean setOwnerPermission = reporterList.hasPermission(Permission.SET_OWNER);
     81  final boolean isRemoved = reporterList.isRemoved();
     82  final boolean isUsed = isRemoved && reporterList.isUsed();
     83  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    8184  final boolean isOwner = reporterList.isOwner();
    8285  %>
     
    99102    {
    100103      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     104    }
     105    function deleteItemPermanently()
     106    {
     107      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     108    }
     109    function itemDeleted()
     110    {
     111      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     112    }
     113    function showUsingItems()
     114    {
     115      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    101116    }
    102117    function takeOwnership()
     
    212227        %>
    213228        <div class="itemstatus">
    214           <base:icon image="deleted.gif"
    215             visible="<%=reporterList.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     229          <base:icon
     230            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     231            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     232            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     233            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     234          <base:icon image="used.gif"
     235            onclick="showUsingItems()"
     236            tooltip="Show the items that are using this one"
     237            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    216238          <base:icon image="shared.gif"
    217239            visible="<%=reporterList.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
  • trunk/www/views/scans/images/list_images.jsp

    r3679 r4003  
    140140      frm.submit();
    141141    }
     142    function deleteItemPermanently(itemId)
     143    {
     144      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     145    }
    142146    function configureColumns()
    143147    {
     
    374378              String tooltip = mode.isSelectionMode() ?
    375379                  "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : "");
     380              String deletePermanently = "deleteItemPermanently("+itemId+")";
    376381              String name = HTML.encodeTags(item.getName());
    377382              index++;
     
    405410                  clazz="icons"
    406411                  visible="<%=mode.hasIcons()%>"
    407                   >&nbsp;</tbl:header>
     412                  ><base:icon
     413                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     414                    onclick="<%=deletePermission ? deletePermanently : null%>"
     415                    tooltip="This item has been scheduled for deletion"
     416                    visible="<%=item.isRemoved()%>"
     417                  />&nbsp;</tbl:header>
    408418                <tbl:cell column="name"><div class="link"
    409419                  onclick="itemOnClick(<%=writePermission ? "event" : null%>, <%=itemId%>)"
  • trunk/www/views/scans/images/view_image.jsp

    r3679 r4003  
    7474  final boolean writePermission = image.hasPermission(Permission.WRITE);
    7575  final boolean deletePermission = image.hasPermission(Permission.DELETE);
     76  final boolean isRemoved = image.isRemoved();
     77  final boolean isUsed = isRemoved && image.isUsed();
     78  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    7679  %>
    7780
     
    9093    {
    9194      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&scan_id=<%=scanId%>&item_id=<%=itemId%>');
     95    }
     96    function deleteItemPermanently()
     97    {
     98      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     99    }
     100    function itemDeleted()
     101    {
     102      Main.listItems('<%=ID%>', '<%=itemType.name()%>', '&scan_id=<%=scanId%>');
     103    }
     104    function showUsingItems()
     105    {
     106      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    92107    }
    93108    function runPlugin(cmd)
     
    171186        %>
    172187        <div class="itemstatus">
    173           <base:icon image="deleted.gif"
    174             visible="<%=image.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     188          <base:icon
     189            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     190            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     191            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     192            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     193          <base:icon image="used.gif"
     194            onclick="showUsingItems()"
     195            tooltip="Show the items that are using this one"
     196            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    175197        </div>
    176198        <%
  • trunk/www/views/scans/list_scans.jsp

    r3990 r4003  
    150150      frm.submit();
    151151    }
     152    function deleteItemPermanently(itemId)
     153    {
     154      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId);
     155    }
    152156    function takeOwnership()
    153157    {
     
    441445              boolean usePermission = item.hasPermission(Permission.USE);
    442446              String openSharePopup = "shareItem("+itemId+")";
     447              String deletePermanently = "deleteItemPermanently("+itemId+")";
     448              boolean deletePermission = item.hasPermission(Permission.DELETE);
    443449              boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION);
    444450              boolean writePermission = item.hasPermission(Permission.WRITE);
     
    477483                  visible="<%=mode.hasIcons()%>"
    478484                  ><base:icon
    479                     image="deleted.gif"
     485                    image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     486                    onclick="<%=deletePermission ? deletePermanently : null%>"
    480487                    tooltip="This item has been scheduled for deletion"
    481488                    visible="<%=item.isRemoved()%>"
  • trunk/www/views/scans/view_scan.jsp

    r3990 r4003  
    9292  final boolean sharePermission = scan.hasPermission(Permission.SET_PERMISSION);
    9393  final boolean setOwnerPermission = scan.hasPermission(Permission.SET_OWNER);
     94  final boolean isRemoved = scan.isRemoved();
     95  final boolean isUsed = isRemoved && scan.isUsed();
     96  final boolean deletePermanentlyPermission = deletePermission && !isUsed;
    9497  final boolean isOwner = scan.isOwner();
    9598  %>
     
    113116    {
    114117      location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');
     118    }
     119    function deleteItemPermanently()
     120    {
     121      Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');
     122    }
     123    function itemDeleted()
     124    {
     125      Main.listItems('<%=ID%>', '<%=itemType.name()%>');
     126    }
     127    function showUsingItems()
     128    {
     129      Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    115130    }
    116131    function takeOwnership()
     
    238253        %>
    239254        <div class="itemstatus">
    240           <base:icon image="deleted.gif"
    241             visible="<%=scan.isRemoved()%>"> This item has been flagged for deletion<br></base:icon>
     255          <base:icon
     256            image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>"
     257            onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>"
     258            tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>"
     259            visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon>
     260          <base:icon image="used.gif"
     261            onclick="showUsingItems()"
     262            tooltip="Show the items that are using this one"
     263            visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon>
    242264          <base:icon image="shared.gif"
    243265            visible="<%=scan.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>
  • trunk/www/views/trashcan/index.jsp

    r3675 r4003  
    6767String redirect = null;
    6868String message = null;
     69String callback = request.getParameter("callback");
    6970DbControl dc = null;
    7071
     
    239240    dc.deleteItem(item);
    240241    dc.commit();
    241     redirect = listPage;
     242    if (request.getParameter("popup") != null)
     243    {
     244      message = itemType.toString() + " deleted";
     245    }
     246    else
     247    {
     248      redirect = listPage;
     249    }
    242250  }
    243251  else if ("DeleteAllPermanently".equals(cmd))
     
    281289else if (message == null)
    282290{
    283   response.sendRedirect(root + "common/close_popup.jsp?refresh_opener=1&wait=0");
     291  response.sendRedirect(root + "common/close_popup.jsp?refresh_opener=1&wait=0" +
     292    (callback != null ? "&callback=" + HTML.urlEncode(callback) : ""));
    284293}
    285294else
    286295{
    287   response.sendRedirect(root + "common/close_popup.jsp?refresh_opener=1&message="+HTML.urlEncode(message));
     296  response.sendRedirect(root + "common/close_popup.jsp?refresh_opener=1&message="+
     297    HTML.urlEncode(message) + (callback != null ? "&callback=" + HTML.urlEncode(callback) : ""));
    288298}
    289299%>
Note: See TracChangeset for help on using the changeset viewer.