Changeset 4003
- Timestamp:
- Nov 26, 2007, 2:22:16 PM (16 years ago)
- Location:
- trunk/www
- Files:
-
- 1 added
- 98 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/admin/annotationtypecategories/list_categories.jsp
r3990 r4003 148 148 frm.submit(); 149 149 } 150 function deleteItemPermanently(itemId) 151 { 152 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 153 } 150 154 function takeOwnership() 151 155 { … … 374 378 String openSharePopup = "shareItem("+itemId+")"; 375 379 String name = HTML.encodeTags(item.getName()); 380 String deletePermanently = "deleteItemPermanently("+itemId+")"; 381 boolean deletePermission = item.hasPermission(Permission.DELETE); 376 382 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 377 383 boolean writePermission = item.hasPermission(Permission.WRITE); … … 409 415 visible="<%=mode.hasIcons()%>" 410 416 ><base:icon 411 image="deleted.gif" 417 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 418 onclick="<%=deletePermission ? deletePermanently : null%>" 412 419 tooltip="This item has been scheduled for deletion" 413 420 visible="<%=item.isRemoved()%>" -
trunk/www/admin/annotationtypecategories/view_category.jsp
r3990 r4003 83 83 final boolean setOwnerPermission = annotationTypeCategory.hasPermission(Permission.SET_OWNER); 84 84 final boolean isOwner = annotationTypeCategory.isOwner(); 85 final boolean isRemoved = annotationTypeCategory.isRemoved(); 86 final boolean isUsed = isRemoved && annotationTypeCategory.isUsed(); 87 final boolean deletePermanentlyPermission = deletePermission && !isUsed; 85 88 %> 86 89 <base:page title="<%=title%>"> … … 98 101 { 99 102 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%>); 100 115 } 101 116 function restoreItem() … … 200 215 %> 201 216 <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> 204 226 <base:icon image="shared.gif" 205 227 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 174 174 frm.submit(); 175 175 } 176 function deleteItemPermanently(itemId) 177 { 178 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 179 } 176 180 function takeOwnership() 177 181 { … … 473 477 int itemId = item.getId(); 474 478 String openSharePopup = "shareItem("+itemId+")"; 479 String deletePermanently = "deleteItemPermanently("+itemId+")"; 480 boolean deletePermission = item.hasPermission(Permission.DELETE); 475 481 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 476 482 boolean writePermission = item.hasPermission(Permission.WRITE); … … 510 516 visible="<%=mode.hasIcons()%>" 511 517 ><base:icon 512 image="deleted.gif" 518 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 519 onclick="<%=deletePermission ? deletePermanently : null%>" 513 520 tooltip="This item has been scheduled for deletion" 514 521 visible="<%=item.isRemoved()%>" -
trunk/www/admin/annotationtypes/view_annotationtype.jsp
r3990 r4003 88 88 final boolean setOwnerPermission = annotationType.hasPermission(Permission.SET_OWNER); 89 89 final boolean isOwner = annotationType.isOwner(); 90 final boolean isRemoved = annotationType.isRemoved(); 91 final boolean isUsed = isRemoved && annotationType.isUsed(); 92 final boolean deletePermanentlyPermission = deletePermission && !isUsed; 90 93 Formatter dateFormatter = FormatterFactory.getDateFormatter(sc); 91 94 %> … … 108 111 { 109 112 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%>); 110 125 } 111 126 function takeOwnership() … … 207 222 %> 208 223 <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> 211 233 <base:icon image="shared.gif" 212 234 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 131 131 frm.submit(); 132 132 } 133 function deleteItemPermanently(itemId) 134 { 135 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 136 } 133 137 function takeOwnership() 134 138 { … … 360 364 int itemId = item.getId(); 361 365 String openSharePopup = "shareItem("+itemId+")"; 366 String deletePermanently = "deleteItemPermanently("+itemId+")"; 367 boolean deletePermission = item.hasPermission(Permission.DELETE); 362 368 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 363 369 boolean writePermission = item.hasPermission(Permission.WRITE); … … 396 402 visible="<%=mode.hasIcons()%>" 397 403 ><base:icon 398 image="deleted.gif" 404 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 405 onclick="<%=deletePermission ? deletePermanently : null%>" 399 406 tooltip="This item has been scheduled for deletion" 400 407 visible="<%=item.isRemoved()%>" -
trunk/www/admin/clients/view_client.jsp
r3990 r4003 78 78 final boolean setOwnerPermission = client.hasPermission(Permission.SET_OWNER); 79 79 final boolean isOwner = client.isOwner(); 80 final boolean isRemoved = client.isRemoved(); 81 final boolean isUsed = isRemoved && client.isUsed(); 82 final boolean deletePermanentlyPermission = deletePermission && !isUsed; 80 83 %> 81 84 <base:page title="<%=title%>"> … … 97 100 { 98 101 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%>); 99 114 } 100 115 function takeOwnership() … … 211 226 %> 212 227 <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> 215 237 <base:icon image="shared.gif" 216 238 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 $ 2 2 ------------------------------------------------------------------ 3 3 Copyright (C) 2007 Nicklas Nordborg … … 164 164 frm.submit(); 165 165 } 166 function deleteItemPermanently(itemId) 167 { 168 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 169 } 166 170 function configureColumns() 167 171 { … … 398 402 String tooltip = mode.isSelectionMode() ? 399 403 "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); 404 String deletePermanently = "deleteItemPermanently("+itemId+")"; 400 405 index++; 401 406 numListed++; … … 429 434 visible="<%=mode.hasIcons()%>" 430 435 ><base:icon 431 image="deleted.gif" 436 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 437 onclick="<%=deletePermission ? deletePermanently : null%>" 432 438 tooltip="This item has been scheduled for deletion" 433 439 visible="<%=item.isRemoved()%>" -
trunk/www/admin/datafiletypes/view_filetype.jsp
r3890 r4003 76 76 final boolean writePermission = fileType.hasPermission(Permission.WRITE); 77 77 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; 78 81 %> 79 82 … … 94 97 { 95 98 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%>); 96 111 } 97 112 function runPlugin(cmd) … … 174 189 %> 175 190 <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> 178 200 </div> 179 201 <% -
trunk/www/admin/extravaluetypes/list_extravaluetypes.jsp
r3675 r4003 144 144 frm.cmd.value = 'RestoreItems'; 145 145 frm.submit(); 146 } 147 function deleteItemPermanently(itemId) 148 { 149 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 146 150 } 147 151 function configureColumns() … … 391 395 String tooltip = mode.isSelectionMode() ? 392 396 "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); 397 String deletePermanently = "deleteItemPermanently("+itemId+")"; 393 398 index++; 394 399 numListed++; … … 422 427 visible="<%=mode.hasIcons()%>" 423 428 ><base:icon 424 image="deleted.gif" 429 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 430 onclick="<%=deletePermission ? deletePermanently : null%>" 425 431 tooltip="This item has been scheduled for deletion" 426 432 visible="<%=item.isRemoved()%>" -
trunk/www/admin/extravaluetypes/view_extravaluetype.jsp
r3675 r4003 69 69 final boolean writePermission = extraValueType.hasPermission(Permission.WRITE); 70 70 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; 71 74 %> 72 75 … … 85 88 { 86 89 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%>); 87 102 } 88 103 function runPlugin(cmd) … … 162 177 %> 163 178 <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> 166 188 </div> 167 189 <% -
trunk/www/admin/groups/list_groups.jsp
r3679 r4003 147 147 frm.submit(); 148 148 } 149 function deleteItemPermanently(itemId) 150 { 151 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 152 } 149 153 function configureColumns() 150 154 { … … 354 358 String tooltip = mode.isSelectionMode() ? 355 359 "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); 360 String deletePermanently = "deleteItemPermanently("+itemId+")"; 356 361 index++; 357 362 numListed++; … … 385 390 visible="<%=mode.hasIcons()%>" 386 391 ><base:icon 387 image="deleted.gif" 392 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 393 onclick="<%=deletePermission ? deletePermanently : null%>" 388 394 tooltip="This item has been scheduled for deletion" 389 395 visible="<%=item.isRemoved()%>" -
trunk/www/admin/groups/view_group.jsp
r3890 r4003 75 75 final boolean writePermission = group.hasPermission(Permission.WRITE); 76 76 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; 77 80 %> 78 81 … … 91 94 { 92 95 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%>); 93 108 } 94 109 function runPlugin(cmd) … … 168 183 %> 169 184 <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> 172 194 </div> 173 195 <% -
trunk/www/admin/hardware/list_hardware.jsp
r3990 r4003 136 136 frm.submit(); 137 137 } 138 function deleteItemPermanently(itemId) 139 { 140 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 141 } 138 142 function takeOwnership() 139 143 { … … 384 388 int itemId = item.getId(); 385 389 String openSharePopup = "shareItem("+itemId+")"; 390 String deletePermanently = "deleteItemPermanently("+itemId+")"; 391 boolean deletePermission = item.hasPermission(Permission.DELETE); 386 392 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 387 393 boolean writePermission = item.hasPermission(Permission.WRITE); … … 420 426 visible="<%=mode.hasIcons()%>" 421 427 ><base:icon 422 image="deleted.gif" 428 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 429 onclick="<%=deletePermission ? deletePermanently : null%>" 423 430 tooltip="This item has been scheduled for deletion" 424 431 visible="<%=item.isRemoved()%>" -
trunk/www/admin/hardware/view_hardware.jsp
r3990 r4003 79 79 final boolean setOwnerPermission = hardware.hasPermission(Permission.SET_OWNER); 80 80 final boolean isOwner = hardware.isOwner(); 81 final boolean isRemoved = hardware.isRemoved(); 82 final boolean isUsed = isRemoved && hardware.isUsed(); 83 final boolean deletePermanentlyPermission = deletePermission && !isUsed; 81 84 %> 82 85 <base:page title="<%=title%>"> … … 98 101 { 99 102 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%>); 100 115 } 101 116 function takeOwnership() … … 197 212 %> 198 213 <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> 201 223 <base:icon image="shared.gif" 202 224 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 142 142 frm.submit(); 143 143 } 144 function deleteItemPermanently(itemId) 145 { 146 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 147 } 144 148 function configureColumns() 145 149 { … … 323 327 int itemId = item.getId(); 324 328 String name = HTML.encodeTags(item.getName()); 329 String deletePermanently = "deleteItemPermanently("+itemId+")"; 325 330 boolean usePermission = item.hasPermission(Permission.USE); 326 331 String tooltip = mode.isSelectionMode() ? … … 357 362 visible="<%=mode.hasIcons()%>" 358 363 ><base:icon 359 image="deleted.gif" 364 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 365 onclick="<%=deletePermission ? deletePermanently : null%>" 360 366 tooltip="This item has been scheduled for deletion" 361 367 visible="<%=item.isRemoved()%>" -
trunk/www/admin/hardwaretypes/view_hardwaretype.jsp
r3890 r4003 74 74 final boolean writePermission = hardwareType.hasPermission(Permission.WRITE); 75 75 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; 76 79 %> 77 80 … … 90 93 { 91 94 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%>); 92 107 } 93 108 function runPlugin(cmd) … … 171 186 %> 172 187 <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> 175 197 </div> 176 198 <% -
trunk/www/admin/jobagents/list_agents.jsp
r3990 r4003 141 141 frm.submit(); 142 142 } 143 function deleteItemPermanently(itemId) 144 { 145 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 146 } 143 147 function takeOwnership() 144 148 { … … 428 432 int itemId = item.getId(); 429 433 String openSharePopup = "shareItem("+itemId+")"; 434 String deletePermanently = "deleteItemPermanently("+itemId+")"; 435 boolean deletePermission = item.hasPermission(Permission.DELETE); 430 436 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 431 437 boolean writePermission = item.hasPermission(Permission.WRITE); … … 464 470 visible="<%=mode.hasIcons()%>" 465 471 ><base:icon 466 image="deleted.gif" 472 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 473 onclick="<%=deletePermission ? deletePermanently : null%>" 467 474 tooltip="This item has been scheduled for deletion" 468 475 visible="<%=item.isRemoved()%>" -
trunk/www/admin/jobagents/view_agent.jsp
r3990 r4003 94 94 final boolean setOwnerPermission = agent.hasPermission(Permission.SET_OWNER); 95 95 final boolean isOwner = agent.isOwner(); 96 final boolean isRemoved = agent.isRemoved(); 97 final boolean isUsed = isRemoved && agent.isUsed(); 98 final boolean deletePermanentlyPermission = deletePermission && !isUsed; 96 99 %> 97 100 <base:page title="<%=title%>"> … … 113 116 { 114 117 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%>); 115 130 } 116 131 function takeOwnership() … … 236 251 <div class="itemstatus">Permissions on this item: <i><%=PermissionUtil.getFullPermissionNames(agent)%></i></div> 237 252 <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> 240 262 <base:icon image="shared.gif" 241 263 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 136 136 frm.submit(); 137 137 } 138 function deleteItemPermanently(itemId) 139 { 140 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 141 } 138 142 function configureColumns() 139 143 { … … 346 350 String tooltip = mode.isSelectionMode() ? 347 351 "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); 352 String deletePermanently = "deleteItemPermanently("+itemId+")"; 348 353 index++; 349 354 numListed++; … … 377 382 visible="<%=mode.hasIcons()%>" 378 383 ><base:icon 379 image="deleted.gif" 384 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 385 onclick="<%=deletePermission ? deletePermanently : null%>" 380 386 tooltip="This item has been scheduled for deletion" 381 387 visible="<%=item.isRemoved()%>" -
trunk/www/admin/mimetypes/view_mimetype.jsp
r3719 r4003 67 67 final boolean writePermission = mimeType.hasPermission(Permission.WRITE); 68 68 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; 69 72 %> 70 73 … … 83 86 { 84 87 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%>); 85 100 } 86 101 function runPlugin(cmd) … … 160 175 %> 161 176 <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> 164 186 </div> 165 187 <% -
trunk/www/admin/news/list_news.jsp
r3679 r4003 134 134 frm.submit(); 135 135 } 136 function deleteItemPermanently(itemId) 137 { 138 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 139 } 136 140 function configureColumns() 137 141 { … … 336 340 String tooltip = mode.isSelectionMode() ? 337 341 "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); 342 String deletePermanently = "deleteItemPermanently("+itemId+")"; 338 343 index++; 339 344 numListed++; … … 367 372 visible="<%=mode.hasIcons()%>" 368 373 ><base:icon 369 image="deleted.gif" 374 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 375 onclick="<%=deletePermission ? deletePermanently : null%>" 370 376 tooltip="This item has been scheduled for deletion" 371 377 visible="<%=item.isRemoved()%>" -
trunk/www/admin/news/view_news.jsp
r3679 r4003 70 70 final boolean writePermission = news.hasPermission(Permission.WRITE); 71 71 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; 72 75 Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); 73 76 %> … … 87 90 { 88 91 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%>); 89 104 } 90 105 function runPlugin(cmd) … … 164 179 %> 165 180 <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> 168 190 </div> 169 191 <% -
trunk/www/admin/platforms/list_platforms.jsp
r3820 r4003 1 <%-- $Id $1 <%-- $Id:list_platforms.jsp 3820 2007-10-12 10:03:18Z nicklas $ 2 2 ------------------------------------------------------------------ 3 3 Copyright (C) 2007 Nicklas Nordborg … … 143 143 frm.submit(); 144 144 } 145 function deleteItemPermanently(itemId) 146 { 147 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 148 } 145 149 function configureColumns() 146 150 { … … 360 364 String tooltip = mode.isSelectionMode() ? 361 365 "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); 366 String deletePermanently = "deleteItemPermanently("+itemId+")"; 362 367 index++; 363 368 numListed++; … … 391 396 visible="<%=mode.hasIcons()%>" 392 397 ><base:icon 393 image="deleted.gif" 398 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 399 onclick="<%=deletePermission ? deletePermanently : null%>" 394 400 tooltip="This item has been scheduled for deletion" 395 401 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 $ 2 2 ------------------------------------------------------------------ 3 3 Copyright (C) 2006 Jari Hakkinen, Nicklas Nordborg, Martin Svensson … … 136 136 frm.submit(); 137 137 } 138 function deleteItemPermanently(itemId) 139 { 140 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 141 } 138 142 function configureColumns() 139 143 { … … 371 375 String tooltip = mode.isSelectionMode() ? 372 376 "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); 377 String deletePermanently = "deleteItemPermanently("+itemId+")"; 373 378 index++; 374 379 numListed++; … … 402 407 visible="<%=mode.hasIcons()%>" 403 408 ><base:icon 404 image="deleted.gif" 409 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 410 onclick="<%=deletePermission ? deletePermanently : null%>" 405 411 tooltip="This item has been scheduled for deletion" 406 412 visible="<%=item.isRemoved()%>" -
trunk/www/admin/platforms/variants/view_variant.jsp
r3890 r4003 79 79 final boolean writePermission = variant.hasPermission(Permission.WRITE); 80 80 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; 81 84 %> 82 85 … … 96 99 { 97 100 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%>); 98 113 } 99 114 function runPlugin(cmd) … … 176 191 %> 177 192 <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> 180 202 </div> 181 203 <% -
trunk/www/admin/platforms/view_platform.jsp
r3890 r4003 78 78 final boolean writePermission = platform.hasPermission(Permission.WRITE); 79 79 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; 80 83 %> 81 84 … … 95 98 { 96 99 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%>); 97 112 } 98 113 function runPlugin(cmd) … … 198 213 %> 199 214 <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> 202 224 </div> 203 225 <% -
trunk/www/admin/pluginconfigurations/list_configurations.jsp
r3990 r4003 159 159 frm.cmd.value = 'RestoreItems'; 160 160 frm.submit(); 161 } 162 function deleteItemPermanently(itemId) 163 { 164 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 161 165 } 162 166 function unloadItems() … … 442 446 String openSharePopup = "shareItem("+itemId+")"; 443 447 String openCopyPopup = "copyItem("+itemId+")"; 448 String deletePermanently = "deleteItemPermanently("+itemId+")"; 449 boolean deletePermission = item.hasPermission(Permission.DELETE); 444 450 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 445 451 boolean writePermission = item.hasPermission(Permission.WRITE); … … 478 484 visible="<%=mode.hasIcons()%>" 479 485 ><base:icon 480 image="deleted.gif" 486 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 487 onclick="<%=deletePermission ? deletePermanently : null%>" 481 488 tooltip="This item has been scheduled for deletion" 482 489 visible="<%=item.isRemoved()%>" -
trunk/www/admin/pluginconfigurations/view_configuration.jsp
r3990 r4003 93 93 final boolean sharePermission = configuration.hasPermission(Permission.SET_PERMISSION); 94 94 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; 95 98 final boolean isOwner = configuration.isOwner(); 96 99 … … 136 139 location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>'); 137 140 } 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 } 138 153 function takeOwnership() 139 154 { … … 251 266 %> 252 267 <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> 255 277 <base:icon image="shared.gif" 256 278 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 164 164 frm.submit(); 165 165 } 166 function deleteItemPermanently(itemId) 167 { 168 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 169 } 166 170 function takeOwnership() 167 171 { … … 572 576 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 573 577 String name = HTML.encodeTags(item.getName()); 578 String deletePermanently = "deleteItemPermanently("+itemId+")"; 579 boolean deletePermission = item.hasPermission(Permission.DELETE); 574 580 boolean usePermission = item.hasPermission(Permission.USE); 575 581 boolean writePermission = item.hasPermission(Permission.WRITE); … … 607 613 visible="<%=mode.hasIcons()%>" 608 614 ><base:icon 609 image="deleted.gif" 615 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 616 onclick="<%=deletePermission ? deletePermanently : null%>" 610 617 tooltip="This item has been scheduled for deletion" 611 618 visible="<%=item.isRemoved()%>" -
trunk/www/admin/plugindefinitions/view_plugin.jsp
r3990 r4003 112 112 final boolean sharePermission = plugin.hasPermission(Permission.SET_PERMISSION); 113 113 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; 114 117 final boolean isOwner = plugin.isOwner(); 115 118 … … 141 144 { 142 145 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%>); 143 158 } 144 159 function takeOwnership() … … 269 284 %> 270 285 <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> 273 295 <base:icon image="shared.gif" 274 296 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 141 141 frm.submit(); 142 142 } 143 function deleteItemPermanently(itemId) 144 { 145 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 146 } 143 147 function configureColumns() 144 148 { … … 335 339 String tooltip = mode.isSelectionMode() ? 336 340 "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); 341 String deletePermanently = "deleteItemPermanently("+itemId+")"; 337 342 index++; 338 343 numListed++; … … 366 371 visible="<%=mode.hasIcons()%>" 367 372 ><base:icon 368 image="deleted.gif" 373 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 374 onclick="<%=deletePermission ? deletePermanently : null%>" 369 375 tooltip="This item has been scheduled for deletion" 370 376 visible="<%=item.isRemoved()%>" -
trunk/www/admin/plugintypes/view_plugintype.jsp
r3890 r4003 74 74 final boolean writePermission = pluginType.hasPermission(Permission.WRITE); 75 75 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; 76 79 %> 77 80 … … 90 93 { 91 94 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%>); 92 107 } 93 108 function runPlugin(cmd) … … 167 182 %> 168 183 <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> 171 193 </div> 172 194 <% -
trunk/www/admin/protocols/list_protocol.jsp
r3990 r4003 136 136 frm.submit(); 137 137 } 138 function deleteItemPermanently(itemId) 139 { 140 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 141 } 138 142 function takeOwnership() 139 143 { … … 384 388 int itemId = item.getId(); 385 389 String openSharePopup = "shareItem("+itemId+")"; 390 String deletePermanently = "deleteItemPermanently("+itemId+")"; 391 boolean deletePermission = item.hasPermission(Permission.DELETE); 386 392 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 387 393 boolean writePermission = item.hasPermission(Permission.WRITE); … … 420 426 visible="<%=mode.hasIcons()%>" 421 427 ><base:icon 422 image="deleted.gif" 428 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 429 onclick="<%=deletePermission ? deletePermanently : null%>" 423 430 tooltip="This item has been scheduled for deletion" 424 431 visible="<%=item.isRemoved()%>" -
trunk/www/admin/protocols/view_protocol.jsp
r3990 r4003 85 85 final boolean sharePermission = protocol.hasPermission(Permission.SET_PERMISSION); 86 86 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; 87 90 final boolean isOwner = protocol.isOwner(); 88 91 %> … … 105 108 { 106 109 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%>); 107 122 } 108 123 function takeOwnership() … … 204 219 %> 205 220 <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> 208 230 <base:icon image="shared.gif" 209 231 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 141 141 frm.submit(); 142 142 } 143 function deleteItemPermanently(itemId) 144 { 145 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 146 } 143 147 function configureColumns() 144 148 { … … 331 335 String tooltip = mode.isSelectionMode() ? 332 336 "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); 337 String deletePermanently = "deleteItemPermanently("+itemId+")"; 333 338 index++; 334 339 numListed++; … … 362 367 visible="<%=mode.hasIcons()%>" 363 368 ><base:icon 364 image="deleted.gif" 369 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 370 onclick="<%=deletePermission ? deletePermanently : null%>" 365 371 tooltip="This item has been scheduled for deletion" 366 372 visible="<%=item.isRemoved()%>" -
trunk/www/admin/protocoltypes/view_protocoltype.jsp
r3890 r4003 74 74 final boolean writePermission = protocolType.hasPermission(Permission.WRITE); 75 75 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; 76 79 %> 77 80 … … 90 93 { 91 94 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%>); 92 107 } 93 108 function runPlugin(cmd) … … 178 193 %> 179 194 <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> 182 204 </div> 183 205 <% -
trunk/www/admin/quota/list_quota.jsp
r3679 r4003 134 134 frm.submit(); 135 135 } 136 function deleteItemPermanently(itemId) 137 { 138 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 139 } 136 140 function configureColumns() 137 141 { … … 319 323 String tooltip = mode.isSelectionMode() ? 320 324 "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); 325 String deletePermanently = "deleteItemPermanently("+itemId+")"; 321 326 index++; 322 327 numListed++; … … 351 356 visible="<%=mode.hasIcons()%>" 352 357 ><base:icon 353 image="deleted.gif" 358 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 359 onclick="<%=deletePermission ? deletePermanently : null%>" 354 360 tooltip="This item has been scheduled for deletion" 355 361 visible="<%=item.isRemoved()%>" -
trunk/www/admin/quota/view_quota.jsp
r3679 r4003 90 90 final boolean writePermission = quota.hasPermission(Permission.WRITE); 91 91 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; 92 95 93 96 final QuotaType total = QuotaType.getById(dc, SystemItems.getId(QuotaType.TOTAL)); … … 119 122 { 120 123 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%>); 121 136 } 122 137 function runPlugin(cmd) … … 196 211 %> 197 212 <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> 200 222 </div> 201 223 <% -
trunk/www/admin/reportertypes/list_reportertypes.jsp
r3679 r4003 130 130 frm.submit(); 131 131 } 132 function deleteItemPermanently(itemId) 133 { 134 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 135 } 132 136 function configureColumns() 133 137 { … … 302 306 String tooltip = mode.isSelectionMode() ? 303 307 "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); 308 String deletePermanently = "deleteItemPermanently("+itemId+")"; 304 309 index++; 305 310 numListed++; … … 333 338 visible="<%=mode.hasIcons()%>" 334 339 ><base:icon 335 image="deleted.gif" 340 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 341 onclick="<%=deletePermission ? deletePermanently : null%>" 336 342 tooltip="This item has been scheduled for deletion" 337 343 visible="<%=item.isRemoved()%>" -
trunk/www/admin/reportertypes/view_reportertype.jsp
r3679 r4003 67 67 final boolean writePermission = reporterType.hasPermission(Permission.WRITE); 68 68 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; 69 72 %> 70 73 … … 83 86 { 84 87 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%>); 85 100 } 86 101 function runPlugin(cmd) … … 160 175 %> 161 176 <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> 164 186 </div> 165 187 <% -
trunk/www/admin/roles/list_roles.jsp
r3679 r4003 140 140 frm.submit(); 141 141 } 142 function deleteItemPermanently(itemId) 143 { 144 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 145 } 142 146 function configureColumns() 143 147 { … … 334 338 String tooltip = mode.isSelectionMode() ? 335 339 "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); 340 String deletePermanently = "deleteItemPermanently("+itemId+")"; 336 341 index++; 337 342 numListed++; … … 365 370 visible="<%=mode.hasIcons()%>" 366 371 ><base:icon 367 image="deleted.gif" 372 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 373 onclick="<%=deletePermission ? deletePermanently : null%>" 368 374 tooltip="This item has been scheduled for deletion" 369 375 visible="<%=item.isRemoved()%>" -
trunk/www/admin/roles/view_role.jsp
r3890 r4003 95 95 final boolean writePermission = role.hasPermission(Permission.WRITE); 96 96 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; 97 100 %> 98 101 … … 111 114 { 112 115 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%>); 113 140 } 114 141 function runPlugin(cmd) … … 188 215 %> 189 216 <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> 192 226 </div> 193 227 <% -
trunk/www/admin/software/list_software.jsp
r3990 r4003 136 136 frm.submit(); 137 137 } 138 function deleteItemPermanently(itemId) 139 { 140 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 141 } 138 142 function takeOwnership() 139 143 { … … 384 388 int itemId = item.getId(); 385 389 String openSharePopup = "shareItem("+itemId+")"; 390 String deletePermanently = "deleteItemPermanently("+itemId+")"; 391 boolean deletePermission = item.hasPermission(Permission.DELETE); 386 392 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 387 393 boolean writePermission = item.hasPermission(Permission.WRITE); … … 420 426 visible="<%=mode.hasIcons()%>" 421 427 ><base:icon 422 image="deleted.gif" 428 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 429 onclick="<%=deletePermission ? deletePermanently : null%>" 423 430 tooltip="This item has been scheduled for deletion" 424 431 visible="<%=item.isRemoved()%>" -
trunk/www/admin/software/view_software.jsp
r3990 r4003 78 78 final boolean sharePermission = software.hasPermission(Permission.SET_PERMISSION); 79 79 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; 80 83 final boolean isOwner = software.isOwner(); 81 84 %> … … 98 101 { 99 102 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%>); 100 115 } 101 116 function takeOwnership() … … 196 211 %> 197 212 <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> 200 222 <base:icon image="shared.gif" 201 223 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 158 158 frm.submit(); 159 159 } 160 function deleteItemPermanently(itemId) 161 { 162 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 163 } 160 164 function configureColumns() 161 165 { … … 520 524 String tooltip = mode.isSelectionMode() ? 521 525 "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); 526 String deletePermanently = "deleteItemPermanently("+itemId+")"; 522 527 index++; 523 528 numListed++; … … 551 556 visible="<%=mode.hasIcons()%>" 552 557 ><base:icon 553 image="deleted.gif" 558 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 559 onclick="<%=deletePermission ? deletePermanently : null%>" 554 560 tooltip="This item has been scheduled for deletion" 555 561 visible="<%=item.isRemoved()%>" -
trunk/www/admin/users/view_user.jsp
r3890 r4003 84 84 final boolean writePermission = user.hasPermission(Permission.WRITE); 85 85 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; 86 89 %> 87 90 … … 100 103 { 101 104 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%>); 102 117 } 103 118 function runPlugin(cmd) … … 177 192 %> 178 193 <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> 181 203 </div> 182 204 <% -
trunk/www/biomaterials/biosources/list_biosources.jsp
r3990 r4003 149 149 frm.submit(); 150 150 } 151 function deleteItemPermanently(itemId) 152 { 153 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 154 } 151 155 function takeOwnership() 152 156 { … … 418 422 boolean usePermission = item.hasPermission(Permission.USE); 419 423 String openSharePopup = "shareItem("+itemId+")"; 424 String deletePermanently = "deleteItemPermanently("+itemId+")"; 425 boolean deletePermission = item.hasPermission(Permission.DELETE); 420 426 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 421 427 boolean writePermission = item.hasPermission(Permission.WRITE); … … 454 460 visible="<%=mode.hasIcons()%>" 455 461 ><base:icon 456 image="deleted.gif" 462 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 463 onclick="<%=deletePermission ? deletePermanently : null%>" 457 464 tooltip="This item has been scheduled for deletion" 458 465 visible="<%=item.isRemoved()%>" -
trunk/www/biomaterials/biosources/view_biosource.jsp
r3990 r4003 91 91 final boolean sharePermission = bioSource.hasPermission(Permission.SET_PERMISSION); 92 92 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; 93 96 final boolean isOwner = bioSource.isOwner(); 94 97 %> … … 112 115 { 113 116 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%>); 114 129 } 115 130 function takeOwnership() … … 222 237 %> 223 238 <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> 226 248 <base:icon image="shared.gif" 227 249 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 159 159 frm.submit(); 160 160 } 161 function deleteItemPermanently(itemId) 162 { 163 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 164 } 161 165 function takeOwnership() 162 166 { … … 495 499 boolean usePermission = item.hasPermission(Permission.USE); 496 500 String openSharePopup = "shareItem("+itemId+")"; 501 String deletePermanently = "deleteItemPermanently("+itemId+")"; 502 boolean deletePermission = item.hasPermission(Permission.DELETE); 497 503 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 498 504 boolean writePermission = item.hasPermission(Permission.WRITE); … … 531 537 visible="<%=mode.hasIcons()%>" 532 538 ><base:icon 533 image="deleted.gif" 539 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 540 onclick="<%=deletePermission ? deletePermanently : null%>" 534 541 tooltip="This item has been scheduled for deletion" 535 542 visible="<%=item.isRemoved()%>" -
trunk/www/biomaterials/extracts/view_extract.jsp
r3990 r4003 97 97 final boolean usePermission = extract.hasPermission(Permission.USE); 98 98 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; 99 102 final boolean isOwner = extract.isOwner(); 100 103 %> … … 118 121 { 119 122 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%>); 120 135 } 121 136 function takeOwnership() … … 243 258 %> 244 259 <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> 247 269 <base:icon image="shared.gif" 248 270 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 155 155 frm.submit(); 156 156 } 157 function deleteItemPermanently(itemId) 158 { 159 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 160 } 157 161 function takeOwnership() 158 162 { … … 509 513 int itemId = item.getId(); 510 514 String openSharePopup = "shareItem("+itemId+")"; 515 String deletePermanently = "deleteItemPermanently("+itemId+")"; 516 boolean deletePermission = item.hasPermission(Permission.DELETE); 511 517 boolean usePermission = item.hasPermission(Permission.USE); 512 518 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); … … 546 552 visible="<%=mode.hasIcons()%>" 547 553 ><base:icon 548 image="deleted.gif" 554 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 555 onclick="<%=deletePermission ? deletePermanently : null%>" 549 556 tooltip="This item has been scheduled for deletion" 550 557 visible="<%=item.isRemoved()%>" -
trunk/www/biomaterials/labeledextracts/view_labeledextract.jsp
r3990 r4003 95 95 final boolean usePermission = extract.hasPermission(Permission.USE); 96 96 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; 97 100 final boolean isOwner = extract.isOwner(); 98 101 %> … … 116 119 { 117 120 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%>); 118 133 } 119 134 function takeOwnership() … … 241 256 %> 242 257 <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> 245 267 <base:icon image="shared.gif" 246 268 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 129 129 frm.submit(); 130 130 } 131 function deleteItemPermanently(itemId) 132 { 133 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 134 } 131 135 function takeOwnership() 132 136 { … … 356 360 labeledExtractQuery.order(Orders.asc(Hql.property("name"))); 357 361 String openSharePopup = "shareItem("+itemId+")"; 362 String deletePermanently = "deleteItemPermanently("+itemId+")"; 363 boolean deletePermission = item.hasPermission(Permission.DELETE); 358 364 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 359 365 boolean usePermission = item.hasPermission(Permission.USE); … … 393 399 visible="<%=mode.hasIcons()%>" 394 400 ><base:icon 395 image="deleted.gif" 401 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 402 onclick="<%=deletePermission ? deletePermanently : null%>" 396 403 tooltip="This item has been scheduled for deletion" 397 404 visible="<%=item.isRemoved()%>" -
trunk/www/biomaterials/labels/view_label.jsp
r3990 r4003 84 84 final boolean usePermission = label.hasPermission(Permission.USE); 85 85 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; 86 89 final boolean isOwner = label.isOwner(); 87 90 %> … … 104 107 { 105 108 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%>); 106 121 } 107 122 function takeOwnership() … … 213 228 %> 214 229 <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> 217 239 <base:icon image="shared.gif" 218 240 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 160 160 frm.submit(); 161 161 } 162 function deleteItemPermanently(itemId) 163 { 164 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 165 } 162 166 function takeOwnership() 163 167 { … … 496 500 boolean usePermission = item.hasPermission(Permission.USE); 497 501 String openSharePopup = "shareItem("+itemId+")"; 502 String deletePermanently = "deleteItemPermanently("+itemId+")"; 503 boolean deletePermission = item.hasPermission(Permission.DELETE); 498 504 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 499 505 boolean writePermission = item.hasPermission(Permission.WRITE); … … 532 538 visible="<%=mode.hasIcons()%>" 533 539 ><base:icon 534 image="deleted.gif" 540 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 541 onclick="<%=deletePermission ? deletePermanently : null%>" 535 542 tooltip="This item has been scheduled for deletion" 536 543 visible="<%=item.isRemoved()%>" -
trunk/www/biomaterials/samples/view_sample.jsp
r3990 r4003 94 94 final boolean sharePermission = sample.hasPermission(Permission.SET_PERMISSION); 95 95 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; 96 99 final boolean isOwner = sample.isOwner(); 97 100 %> … … 119 122 { 120 123 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%>); 121 136 } 122 137 function takeOwnership() … … 240 255 %> 241 256 <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> 244 266 <base:icon image="shared.gif" 245 267 visible="<%=sample.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon> -
trunk/www/common/close_popup.jsp
r3679 r4003 36 36 specified 1200 is used. 37 37 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 38 42 @param redirect_opener 39 43 If specified the window that opened the popup will be redirected 40 to this URL. 44 to this URL. Ignored if callback is specified. 41 45 42 46 @param redirect_main 43 47 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. 45 49 46 50 @param refresh_opener 47 51 If specified with a non-zero value the window that opened 48 the popup will be reloaded. Ignored if redirect_main or49 redirect_opener is specified.52 the popup will be reloaded. Ignored if redirect_main, 53 redirect_opener or callback is specified. 50 54 51 55 @author Nicklas … … 64 68 String refreshOpener = request.getParameter("refresh_opener"); 65 69 String reopenOpener = request.getParameter("reopen_opener"); 70 String callback = request.getParameter("callback"); 66 71 67 72 %> … … 86 91 var topWindow = window.top; 87 92 <% 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) 89 101 { 90 102 %> -
trunk/www/filemanager/files/list_files.jsp
r3990 r4003 211 211 frm.submit(); 212 212 } 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 } 213 221 function takeOwnership() 214 222 { … … 667 675 int itemId = item.getId(); 668 676 String openSharePopup = "shareDirectory("+itemId+")"; 677 String deletePermanently = "deleteDirectoryPermanently("+itemId+")"; 678 boolean deletePermission = item.hasPermission(Permission.DELETE); 669 679 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 670 680 String name = HTML.encodeTags(item.getName()); … … 697 707 visible="<%=mode.hasIcons()%>" 698 708 ><base:icon 699 image="deleted.gif" 709 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 710 onclick="<%=deletePermission ? deletePermanently : null%>" 700 711 tooltip="This item has been scheduled for deletion" 701 712 visible="<%=item.isRemoved()%>" … … 747 758 int itemId = item.getId(); 748 759 String openSharePopup = "shareFile("+itemId+")"; 760 String deletePermanently = "deleteFilePermanently("+itemId+")"; 761 boolean deletePermission = item.hasPermission(Permission.DELETE); 749 762 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 750 763 boolean writePermission = item.hasPermission(Permission.WRITE); … … 791 804 visible="<%=mode.hasIcons()%>" 792 805 ><base:icon 793 image="deleted.gif" 806 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 807 onclick="<%=deletePermission ? deletePermanently : null%>" 794 808 tooltip="This item has been scheduled for deletion" 795 809 visible="<%=item.isRemoved()%>" -
trunk/www/filemanager/files/view_file.jsp
r3990 r4003 83 83 final boolean sharePermission = file.hasPermission(Permission.SET_PERMISSION); 84 84 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; 85 88 final boolean isOwner = file.isOwner(); 86 89 Formatter<Date> dateTimeFormatter = FormatterFactory.getDateTimeFormatter(sc); … … 104 107 { 105 108 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%>); 106 121 } 107 122 function takeOwnership() … … 232 247 %> 233 248 <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> 236 258 <base:icon image="shared.gif" 237 259 visible="<%=file.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon> -
trunk/www/include/scripts/main.js
r3990 r4003 460 460 } 461 461 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 462 470 this.viewOrEditItem = function(ID, itemType, itemId, edit, extraUrl, popupOptions) 463 471 { … … 470 478 471 479 var cmd = itemId == 0 ? 'NewItem' : (edit ? 'EditItem' : 'ViewItem'); 472 var url = getRoot();473 474 480 var url = getRoot() + controller.url + '?ID='+ID+'&cmd='+cmd; 475 481 if (itemId) url += '&item_id='+itemId; … … 536 542 if (extraUrl) url += extraUrl; 537 543 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; 538 568 } 539 569 -
trunk/www/lims/arraybatches/list_batches.jsp
r3990 r4003 151 151 frm.submit(); 152 152 } 153 function deleteItemPermanently(itemId) 154 { 155 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 156 } 153 157 function takeOwnership() 154 158 { … … 441 445 int itemId = item.getId(); 442 446 String openSharePopup = "shareItem("+itemId+")"; 447 String deletePermanently = "deleteItemPermanently("+itemId+")"; 448 boolean deletePermission = item.hasPermission(Permission.DELETE); 443 449 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 444 450 boolean usePermission = item.hasPermission(Permission.USE); … … 478 484 visible="<%=mode.hasIcons()%>" 479 485 ><base:icon 480 image="deleted.gif" 486 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 487 onclick="<%=deletePermission ? deletePermanently : null%>" 481 488 tooltip="This item has been scheduled for deletion" 482 489 visible="<%=item.isRemoved()%>" -
trunk/www/lims/arraybatches/view_batch.jsp
r3990 r4003 92 92 final boolean sharePermission = batch.hasPermission(Permission.SET_PERMISSION); 93 93 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; 94 97 final boolean isOwner = batch.isOwner(); 95 98 %> … … 113 116 { 114 117 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%>); 115 130 } 116 131 function takeOwnership() … … 233 248 %> 234 249 <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> 237 259 <base:icon image="shared.gif" 238 260 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 167 167 frm.submit(); 168 168 } 169 function deleteItemPermanently(itemId) 170 { 171 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 172 } 169 173 function takeOwnership() 170 174 { … … 474 478 int itemId = item.getId(); 475 479 String openSharePopup = "shareItem("+itemId+")"; 480 String deletePermanently = "deleteItemPermanently("+itemId+")"; 481 boolean deletePermission = item.hasPermission(Permission.DELETE); 476 482 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 477 483 boolean usePermission = item.hasPermission(Permission.USE); … … 511 517 visible="<%=mode.hasIcons()%>" 512 518 ><base:icon 513 image="deleted.gif" 519 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 520 onclick="<%=deletePermission ? deletePermanently : null%>" 514 521 tooltip="This item has been scheduled for deletion" 515 522 visible="<%=item.isRemoved()%>" -
trunk/www/lims/arraydesigns/view_design.jsp
r3990 r4003 97 97 final boolean sharePermission = design.hasPermission(Permission.SET_PERMISSION); 98 98 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; 99 102 final boolean isOwner = design.isOwner(); 100 103 %> … … 118 121 { 119 122 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%>); 120 135 } 121 136 function takeOwnership() … … 257 272 %> 258 273 <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> 261 283 <base:icon image="shared.gif" 262 284 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 144 144 frm.submit(); 145 145 } 146 function deleteItemPermanently(itemId) 147 { 148 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 149 } 146 150 function takeOwnership() 147 151 { … … 456 460 int itemId = item.getId(); 457 461 String openSharePopup = "shareItem("+itemId+")"; 462 String deletePermanently = "deleteItemPermanently("+itemId+")"; 463 boolean deletePermission = item.hasPermission(Permission.DELETE); 458 464 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 459 465 boolean writePermission = item.hasPermission(Permission.WRITE); … … 492 498 visible="<%=mode.hasIcons()%>" 493 499 ><base:icon 494 image="deleted.gif" 500 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 501 onclick="<%=deletePermission ? deletePermanently : null%>" 495 502 tooltip="This item has been scheduled for deletion" 496 503 visible="<%=item.isRemoved()%>" -
trunk/www/lims/arrayslides/view_slide.jsp
r3990 r4003 90 90 final boolean sharePermission = slide.hasPermission(Permission.SET_PERMISSION); 91 91 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; 92 95 final boolean isOwner = slide.isOwner(); 93 96 %> … … 111 114 { 112 115 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%>); 113 128 } 114 129 function takeOwnership() … … 209 224 %> 210 225 <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> 213 235 <base:icon image="shared.gif" 214 236 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 65 65 final String ID = sc.getId(); 66 66 final boolean createPermission = sc.hasPermission(Permission.CREATE, itemType); 67 final boolean deletePermission = sc.hasPermission(Permission.DELETE, itemType); 67 68 final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); 68 69 … … 138 139 frm.cmd.value = 'RestoreItems'; 139 140 frm.submit(); 141 } 142 function deleteItemPermanently(itemId) 143 { 144 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 140 145 } 141 146 function configureColumns() … … 335 340 boolean usePermission = item.hasPermission(Permission.USE); 336 341 boolean writePermission = item.hasPermission(Permission.WRITE); 342 String deletePermanently = "deleteItemPermanently("+itemId+")"; 337 343 String tooltip = mode.isSelectionMode() ? 338 344 "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); … … 368 374 visible="<%=mode.hasIcons()%>" 369 375 ><base:icon 370 image="deleted.gif" 376 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 377 onclick="<%=deletePermission ? deletePermanently : null%>" 371 378 tooltip="This item has been scheduled for deletion" 372 379 visible="<%=item.isRemoved()%>" -
trunk/www/lims/geometries/view_geometry.jsp
r3888 r4003 78 78 final boolean deletePermission = geometry.hasPermission(Permission.DELETE); 79 79 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; 80 83 %> 81 84 … … 94 97 { 95 98 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%>); 96 111 } 97 112 function runPlugin(cmd) … … 182 197 %> 183 198 <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> 186 208 </div> 187 209 <% -
trunk/www/lims/platemappings/list_mappings.jsp
r3990 r4003 139 139 frm.submit(); 140 140 } 141 function deleteItemPermanently(itemId) 142 { 143 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 144 } 141 145 function takeOwnership() 142 146 { … … 411 415 int itemId = item.getId(); 412 416 String openSharePopup = "shareItem("+itemId+")"; 417 String deletePermanently = "deleteItemPermanently("+itemId+")"; 418 boolean deletePermission = item.hasPermission(Permission.DELETE); 413 419 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 414 420 boolean writePermission = item.hasPermission(Permission.WRITE); … … 447 453 visible="<%=mode.hasIcons()%>" 448 454 ><base:icon 449 image="deleted.gif" 455 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 456 onclick="<%=deletePermission ? deletePermanently : null%>" 450 457 tooltip="This item has been scheduled for deletion" 451 458 visible="<%=item.isRemoved()%>" -
trunk/www/lims/platemappings/view_mapping.jsp
r3990 r4003 93 93 final boolean sharePermission = mapping.hasPermission(Permission.SET_PERMISSION); 94 94 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; 95 98 final boolean isOwner = mapping.isOwner(); 96 99 %> … … 114 117 { 115 118 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%>); 116 131 } 117 132 function takeOwnership() … … 212 227 %> 213 228 <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> 216 238 <base:icon image="shared.gif" 217 239 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 161 161 frm.submit(); 162 162 } 163 function deleteItemPermanently(itemId) 164 { 165 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 166 } 163 167 function takeOwnership() 164 168 { … … 480 484 int itemId = item.getId(); 481 485 String openSharePopup = "shareItem("+itemId+")"; 486 String deletePermanently = "deleteItemPermanently("+itemId+")"; 487 boolean deletePermission = item.hasPermission(Permission.DELETE); 482 488 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 483 489 boolean writePermission = item.hasPermission(Permission.WRITE); … … 516 522 visible="<%=mode.hasIcons()%>" 517 523 ><base:icon 518 image="deleted.gif" 524 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 525 onclick="<%=deletePermission ? deletePermanently : null%>" 519 526 tooltip="This item has been scheduled for deletion" 520 527 visible="<%=item.isRemoved()%>" -
trunk/www/lims/plates/view_plate.jsp
r3990 r4003 98 98 final boolean sharePermission = plate.hasPermission(Permission.SET_PERMISSION); 99 99 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; 100 103 final boolean isOwner = plate.isOwner(); 101 104 %> … … 118 121 { 119 122 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%>); 120 135 } 121 136 function takeOwnership() … … 239 254 %> 240 255 <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> 243 265 <base:icon image="shared.gif" 244 266 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 148 148 frm.submit(); 149 149 } 150 function deleteItemPermanently(itemId) 151 { 152 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 153 } 150 154 function takeOwnership() 151 155 { … … 388 392 int itemId = item.getId(); 389 393 String openSharePopup = "shareItem("+itemId+")"; 394 String deletePermanently = "deleteItemPermanently("+itemId+")"; 395 boolean deletePermission = item.hasPermission(Permission.DELETE); 390 396 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 391 397 boolean usePermission = item.hasPermission(Permission.USE); … … 425 431 visible="<%=mode.hasIcons()%>" 426 432 ><base:icon 427 image="deleted.gif" 433 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 434 onclick="<%=deletePermission ? deletePermanently : null%>" 428 435 tooltip="This item has been scheduled for deletion" 429 436 visible="<%=item.isRemoved()%>" -
trunk/www/lims/platetypes/view_platetype.jsp
r3990 r4003 87 87 final boolean sharePermission = plateType.hasPermission(Permission.SET_PERMISSION); 88 88 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; 89 92 final boolean isOwner = plateType.isOwner(); 90 93 %> … … 108 111 { 109 112 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%>); 110 125 } 111 126 function takeOwnership() … … 222 237 %> 223 238 <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> 226 248 <base:icon image="shared.gif" 227 249 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 140 140 frm.submit(); 141 141 } 142 function deleteItemPermanently(itemId) 143 { 144 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 145 } 142 146 function configureColumns() 143 147 { … … 342 346 int itemId = item.getId(); 343 347 String name = HTML.encodeTags(item.getName()); 348 String deletePermanently = "deleteItemPermanently("+itemId+")"; 349 boolean deletePermission = item.hasPermission(Permission.DELETE); 344 350 index++; 345 351 numListed++; … … 379 385 visible="<%=!item.isRead()%>" 380 386 /><base:icon 381 image="deleted.gif" 387 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 388 onclick="<%=deletePermission ? deletePermanently : null%>" 382 389 tooltip="This item has been scheduled for deletion" 383 390 visible="<%=item.isRemoved()%>" -
trunk/www/my_base/messages/view_message.jsp
r3679 r4003 106 106 final boolean writePermission = message.hasPermission(Permission.WRITE); 107 107 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; 108 111 %> 109 112 110 113 <base:page type="popup" title="<%=title%>"> 111 114 <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> 112 129 </base:head> 113 130 <base:body> … … 122 139 %> 123 140 <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> 126 150 </div> 127 151 <% -
trunk/www/my_base/projects/items/list_items.jsp
r3990 r4003 125 125 frm.submit(); 126 126 } 127 function deleteItemPermanently(itemType, itemId) 128 { 129 Main.deleteItemPermanently('<%=ID%>', true, itemType, itemId); 130 } 127 131 function takeOwnership() 128 132 { … … 327 331 int itemId = item.getId(); 328 332 boolean removed = item instanceof Removable && ((Removable)item).isRemoved(); 333 String deletePermanently = "deleteItemPermanently('" + item.getType().name() + "', "+itemId+")"; 334 boolean deletePermission = item.hasPermission(Permission.DELETE); 329 335 String name = ""; 330 336 String description = ""; … … 369 375 clazz="icons" 370 376 ><base:icon 371 image="deleted.gif" 377 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 378 onclick="<%=deletePermission ? deletePermanently : null%>" 372 379 tooltip="This item has been scheduled for deletion" 373 380 visible="<%=removed%>" -
trunk/www/my_base/projects/list_projects.jsp
r3679 r4003 129 129 frm.submit(); 130 130 } 131 function deleteItemPermanently(itemId) 132 { 133 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 134 } 131 135 function takeOwnership() 132 136 { … … 342 346 String name = HTML.encodeTags(item.getName()); 343 347 boolean writePermission = item.hasPermission(Permission.WRITE); 348 String deletePermanently = "deleteItemPermanently("+itemId+")"; 349 boolean deletePermission = item.hasPermission(Permission.DELETE); 344 350 String tooltip = mode.isSelectionMode() ? 345 351 "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); … … 375 381 visible="<%=mode.hasIcons()%>" 376 382 ><base:icon 377 image="deleted.gif" 383 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 384 onclick="<%=deletePermission ? deletePermanently : null%>" 378 385 tooltip="This item has been scheduled for deletion" 379 386 visible="<%=item.isRemoved()%>" -
trunk/www/my_base/projects/view_project.jsp
r3888 r4003 83 83 final boolean deletePermission = project.hasPermission(Permission.DELETE); 84 84 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; 85 88 final boolean isOwner = project.isOwner(); 86 89 %> … … 100 103 { 101 104 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%>); 102 117 } 103 118 function takeOwnership() … … 217 232 %> 218 233 <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> 221 243 </div> 222 244 <% -
trunk/www/views/experiments/bioassaysets/analysis_tree.jsp
r3679 r4003 344 344 frm.cmd.value = 'RestoreItems'; 345 345 frm.submit(); 346 } 347 function deleteItemPermanently(itemType, itemId) 348 { 349 Main.deleteItemPermanently('<%=ID%>', true, itemType, itemId); 346 350 } 347 351 function configureColumns() … … 735 739 String tooltip = mode.isSelectionMode() ? 736 740 "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); 741 String deletePermanently = "deleteItemPermanently('" + item.getType().name() + "', "+itemId+")"; 737 742 boolean removed = false; 738 743 Transformation t = null; … … 833 838 visible="<%=mode.hasIcons()%>" 834 839 ><base:icon 835 image="deleted.gif" 840 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 841 onclick="<%=deletePermission ? deletePermanently : null%>" 836 842 tooltip="This item has been scheduled for deletion" 837 843 visible="<%=removed%>" -
trunk/www/views/experiments/list_experiments.jsp
r3990 r4003 152 152 } 153 153 } 154 function deleteItemPermanently(itemId) 155 { 156 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 157 } 154 158 function shareItem(itemId) 155 159 { … … 479 483 int itemId = item.getId(); 480 484 String openSharePopup = "shareItem("+itemId+")"; 485 String deletePermanently = "deleteItemPermanently("+itemId+")"; 486 boolean deletePermission = item.hasPermission(Permission.DELETE); 481 487 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 482 488 boolean writePermission = item.hasPermission(Permission.WRITE); … … 515 521 visible="<%=mode.hasIcons()%>" 516 522 ><base:icon 517 image="deleted.gif" 523 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 524 onclick="<%=deletePermission ? deletePermanently : null%>" 518 525 tooltip="This item has been scheduled for deletion" 519 526 visible="<%=item.isRemoved()%>" -
trunk/www/views/experiments/view_experiment.jsp
r3990 r4003 98 98 final boolean setOwnerPermission = experiment.hasPermission(Permission.SET_OWNER); 99 99 final boolean isOwner = experiment.isOwner(); 100 final boolean isRemoved = experiment.isRemoved(); 101 final boolean isUsed = isRemoved && experiment.isUsed(); 102 final boolean deletePermanentlyPermission = deletePermission && !isUsed; 100 103 101 104 Map<AnnotationType, Set<Object>> usedFactorValues = … … 122 125 location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>'); 123 126 } 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 124 140 function takeOwnership() 125 141 { … … 270 286 %> 271 287 <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> 274 297 <base:icon image="shared.gif" 275 298 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 152 152 frm.submit(); 153 153 } 154 function deleteItemPermanently(itemId) 155 { 156 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 157 } 154 158 function takeOwnership() 155 159 { … … 477 481 int itemId = item.getId(); 478 482 String openSharePopup = "shareItem("+itemId+")"; 483 String deletePermanently = "deleteItemPermanently("+itemId+")"; 484 boolean deletePermission = item.hasPermission(Permission.DELETE); 479 485 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 480 486 boolean writePermission = item.hasPermission(Permission.WRITE); … … 513 519 visible="<%=mode.hasIcons()%>" 514 520 ><base:icon 515 image="deleted.gif" 521 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 522 onclick="<%=deletePermission ? deletePermanently : null%>" 516 523 tooltip="This item has been scheduled for deletion" 517 524 visible="<%=item.isRemoved()%>" -
trunk/www/views/formulas/view_formula.jsp
r3990 r4003 83 83 final boolean sharePermission = formula.hasPermission(Permission.SET_PERMISSION); 84 84 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; 85 88 final boolean isOwner = formula.isOwner(); 86 89 %> … … 104 107 { 105 108 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%>); 106 121 } 107 122 function takeOwnership() … … 202 217 %> 203 218 <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> 206 228 <base:icon image="shared.gif" 207 229 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 163 163 frm.submit(); 164 164 } 165 function deleteItemPermanently(itemId) 166 { 167 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 168 } 165 169 function takeOwnership() 166 170 { … … 478 482 boolean usePermission = item.hasPermission(Permission.USE); 479 483 String openSharePopup = "shareItem("+itemId+")"; 484 String deletePermanently = "deleteItemPermanently("+itemId+")"; 485 boolean deletePermission = item.hasPermission(Permission.DELETE); 480 486 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 481 487 boolean writePermission = item.hasPermission(Permission.WRITE); … … 514 520 visible="<%=mode.hasIcons()%>" 515 521 ><base:icon 516 image="deleted.gif" 522 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 523 onclick="<%=deletePermission ? deletePermanently : null%>" 517 524 tooltip="This item has been scheduled for deletion" 518 525 visible="<%=item.isRemoved()%>" -
trunk/www/views/hybridizations/view_hybridization.jsp
r3990 r4003 99 99 final boolean sharePermission = hyb.hasPermission(Permission.SET_PERMISSION); 100 100 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; 101 104 final boolean isOwner = hyb.isOwner(); 102 105 %> … … 120 123 { 121 124 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%>); 122 137 } 123 138 function takeOwnership() … … 230 245 %> 231 246 <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> 234 256 <base:icon image="shared.gif" 235 257 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 136 136 frm.submit(); 137 137 } 138 function deleteItemPermanently(itemType, itemId) 139 { 140 Main.deleteItemPermanently('<%=ID%>', true, itemType, itemId); 141 } 138 142 function shareItem(itemType, itemId) 139 143 { … … 269 273 int itemId = item.getId(); 270 274 String openSharePopup = "shareItem('" + item.getType().name() + "', "+itemId+")"; 275 String deletePermanently = "deleteItemPermanently('" + item.getType().name() + "', "+itemId+")"; 276 boolean deletePermission = item.hasPermission(Permission.DELETE); 271 277 String name = ""; 272 278 String description = ""; … … 319 325 clazz="icons" 320 326 ><base:icon 321 image="deleted.gif" 327 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 328 onclick="<%=deletePermission ? deletePermanently : null%>" 322 329 tooltip="This item has been marked for deletion" 323 330 visible="<%=isRemoved%>" -
trunk/www/views/jobs/list_jobs.jsp
r3880 r4003 144 144 frm.submit(); 145 145 } 146 function deleteItemPermanently(itemId) 147 { 148 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 149 } 146 150 function takeOwnership() 147 151 { … … 479 483 int itemId = item.getId(); 480 484 String name = HTML.encodeTags(item.getName()); 485 String deletePermanently = "deleteItemPermanently("+itemId+")"; 486 boolean deletePermission = item.hasPermission(Permission.DELETE); 481 487 index++; 482 488 numListed++; … … 520 526 visible="<%=mode.hasIcons()%>" 521 527 ><base:icon 522 image="deleted.gif" 528 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 529 onclick="<%=deletePermission ? deletePermanently : null%>" 523 530 tooltip="This item has been scheduled for deletion" 524 531 visible="<%=item.isRemoved()%>" -
trunk/www/views/jobs/view_job.jsp
r3880 r4003 80 80 final boolean writePermission = job.hasPermission(Permission.WRITE); 81 81 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; 82 85 83 86 boolean readCurrentConfig = true; … … 129 132 location.href = 'index.jsp?ID=<%=ID%>&cmd=RestartJob&item_id=<%=itemId%>&useLatestConfiguration='+useLatestConfiguration; 130 133 } 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 } 131 146 </script> 132 147 </base:head> … … 142 157 %> 143 158 <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> 146 168 </div> 147 169 <% -
trunk/www/views/rawbioassays/list_rawbioassays.jsp
r3990 r4003 168 168 frm.submit(); 169 169 } 170 function deleteItemPermanently(itemId) 171 { 172 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 173 } 170 174 function takeOwnership() 171 175 { … … 552 556 int itemId = item.getId(); 553 557 String openSharePopup = "shareItem("+itemId+")"; 558 String deletePermanently = "deleteItemPermanently("+itemId+")"; 559 boolean deletePermission = item.hasPermission(Permission.DELETE); 554 560 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 555 561 boolean writePermission = item.hasPermission(Permission.WRITE); … … 588 594 visible="<%=mode.hasIcons()%>" 589 595 ><base:icon 590 image="deleted.gif" 596 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 597 onclick="<%=deletePermission ? deletePermanently : null%>" 591 598 tooltip="This item has been scheduled for deletion" 592 599 visible="<%=item.isRemoved()%>" -
trunk/www/views/rawbioassays/view_rawbioassay.jsp
r3990 r4003 101 101 final boolean sharePermission = rawBioAssay.hasPermission(Permission.SET_PERMISSION); 102 102 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; 103 106 final boolean isOwner = rawBioAssay.isOwner(); 104 107 %> … … 122 125 { 123 126 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%>); 124 139 } 125 140 function takeOwnership() … … 246 261 %> 247 262 <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> 250 272 <base:icon image="shared.gif" 251 273 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 128 128 frm.submit(); 129 129 } 130 function deleteItemPermanently(itemId) 131 { 132 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 133 } 130 134 function takeOwnership() 131 135 { … … 370 374 int itemId = item.getId(); 371 375 String openSharePopup = "shareItem("+itemId+")"; 376 String deletePermanently = "deleteItemPermanently("+itemId+")"; 377 boolean deletePermission = item.hasPermission(Permission.DELETE); 372 378 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 373 379 boolean writePermission = item.hasPermission(Permission.WRITE); … … 406 412 visible="<%=mode.hasIcons()%>" 407 413 ><base:icon 408 image="deleted.gif" 414 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 415 onclick="<%=deletePermission ? deletePermanently : null%>" 409 416 tooltip="This item has been scheduled for deletion" 410 417 visible="<%=item.isRemoved()%>" -
trunk/www/views/reporterlists/view_reporterlist.jsp
r3990 r4003 79 79 final boolean sharePermission = reporterList.hasPermission(Permission.SET_PERMISSION); 80 80 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; 81 84 final boolean isOwner = reporterList.isOwner(); 82 85 %> … … 99 102 { 100 103 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%>); 101 116 } 102 117 function takeOwnership() … … 212 227 %> 213 228 <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> 216 238 <base:icon image="shared.gif" 217 239 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 140 140 frm.submit(); 141 141 } 142 function deleteItemPermanently(itemId) 143 { 144 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 145 } 142 146 function configureColumns() 143 147 { … … 374 378 String tooltip = mode.isSelectionMode() ? 375 379 "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); 380 String deletePermanently = "deleteItemPermanently("+itemId+")"; 376 381 String name = HTML.encodeTags(item.getName()); 377 382 index++; … … 405 410 clazz="icons" 406 411 visible="<%=mode.hasIcons()%>" 407 > </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 /> </tbl:header> 408 418 <tbl:cell column="name"><div class="link" 409 419 onclick="itemOnClick(<%=writePermission ? "event" : null%>, <%=itemId%>)" -
trunk/www/views/scans/images/view_image.jsp
r3679 r4003 74 74 final boolean writePermission = image.hasPermission(Permission.WRITE); 75 75 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; 76 79 %> 77 80 … … 90 93 { 91 94 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%>); 92 107 } 93 108 function runPlugin(cmd) … … 171 186 %> 172 187 <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> 175 197 </div> 176 198 <% -
trunk/www/views/scans/list_scans.jsp
r3990 r4003 150 150 frm.submit(); 151 151 } 152 function deleteItemPermanently(itemId) 153 { 154 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 155 } 152 156 function takeOwnership() 153 157 { … … 441 445 boolean usePermission = item.hasPermission(Permission.USE); 442 446 String openSharePopup = "shareItem("+itemId+")"; 447 String deletePermanently = "deleteItemPermanently("+itemId+")"; 448 boolean deletePermission = item.hasPermission(Permission.DELETE); 443 449 boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); 444 450 boolean writePermission = item.hasPermission(Permission.WRITE); … … 477 483 visible="<%=mode.hasIcons()%>" 478 484 ><base:icon 479 image="deleted.gif" 485 image="<%=deletePermission ? "deleted.gif" : "deleted_disabled.gif"%>" 486 onclick="<%=deletePermission ? deletePermanently : null%>" 480 487 tooltip="This item has been scheduled for deletion" 481 488 visible="<%=item.isRemoved()%>" -
trunk/www/views/scans/view_scan.jsp
r3990 r4003 92 92 final boolean sharePermission = scan.hasPermission(Permission.SET_PERMISSION); 93 93 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; 94 97 final boolean isOwner = scan.isOwner(); 95 98 %> … … 113 116 { 114 117 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%>); 115 130 } 116 131 function takeOwnership() … … 238 253 %> 239 254 <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> 242 264 <base:icon image="shared.gif" 243 265 visible="<%=scan.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon> -
trunk/www/views/trashcan/index.jsp
r3675 r4003 67 67 String redirect = null; 68 68 String message = null; 69 String callback = request.getParameter("callback"); 69 70 DbControl dc = null; 70 71 … … 239 240 dc.deleteItem(item); 240 241 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 } 242 250 } 243 251 else if ("DeleteAllPermanently".equals(cmd)) … … 281 289 else if (message == null) 282 290 { 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) : "")); 284 293 } 285 294 else 286 295 { 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) : "")); 288 298 } 289 299 %>
Note: See TracChangeset
for help on using the changeset viewer.