From e26ef1fe9ab76999283c1e16d05f5e7145bdb09a Mon Sep 17 00:00:00 2001 From: pines Date: Wed, 8 Nov 2006 19:54:04 +0000 Subject: [PATCH] COPY_DELETE_WARNING for deleting items of magical statuses git-svn-id: svn://svn.open-ils.org/ILS/trunk@6568 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../xul/staff_client/server/cat/copy_browser.js | 5 +++-- Open-ILS/xul/staff_client/server/cat/util.js | 1 + .../xul/staff_client/server/circ/copy_status.js | 26 ++++++++++++++++++++-- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/cat/copy_browser.js b/Open-ILS/xul/staff_client/server/cat/copy_browser.js index 525fbc68ad..f2bd5c4a9c 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_browser.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_browser.js @@ -371,13 +371,14 @@ cat.copy_browser.prototype = { { 'title' : 'Override Delete Failure?', 'overridable_events' : [ - 1208 /* TITLE_LAST_COPY */ + 1208 /* TITLE_LAST_COPY */, + 1227 /* COPY_DELETE_WARNING */, ] } ); if (robj == null) throw(robj); if (typeof robj.ilsevent != 'undefined') { - if ( (robj.ilsevent != 0) && (robj.ilsevent != 1208 /* TITLE_LAST_COPY */) ) throw(robj); + if ( (robj.ilsevent != 0) && (robj.ilsevent != 1227 /* COPY_DELETE_WARNING */) && (robj.ilsevent != 1208 /* TITLE_LAST_COPY */) ) throw(robj); } alert('Action complete.'); obj.refresh_list(); diff --git a/Open-ILS/xul/staff_client/server/cat/util.js b/Open-ILS/xul/staff_client/server/cat/util.js index 6230b619ef..d3e22b271a 100644 --- a/Open-ILS/xul/staff_client/server/cat/util.js +++ b/Open-ILS/xul/staff_client/server/cat/util.js @@ -98,6 +98,7 @@ cat.util.transfer_copies = function(params) { 'title' : 'Override Transfer Failure?', 'overridable_events' : [ 1208 /* TITLE_LAST_COPY */, + 1227 /* COPY_DELETE_WARNING */, ] } ); diff --git a/Open-ILS/xul/staff_client/server/circ/copy_status.js b/Open-ILS/xul/staff_client/server/circ/copy_status.js index 13afe0ed92..d25ddac4d7 100644 --- a/Open-ILS/xul/staff_client/server/circ/copy_status.js +++ b/Open-ILS/xul/staff_client/server/circ/copy_status.js @@ -428,7 +428,29 @@ circ.copy_status.prototype = { if (! window.confirm('Are you sure sure you want to delete these items? ' + util.functional.map_list( copies, function(o) { return o.barcode(); }).join(", ")) ) return; var robj = obj.network.simple_request('FM_ACP_FLESHED_BATCH_UPDATE',[ ses(), copies, true]); - if (typeof robj.ilsevent != 'undefined') obj.error.standard_unexpected_error_alert('Batch Item Deletion',robj); else { alert('Items Deleted'); } + var robj = obj.network.simple_request( + 'FM_ACP_FLESHED_BATCH_UPDATE', + [ ses(), copies, true ], + null, + { + 'title' : 'Override Delete Failure?', + 'overridable_events' : [ + 1208 /* TITLE_LAST_COPY */, + 1227 /* COPY_DELETE_WARNING */, + ] + } + ); + + if (typeof robj.ilsevent != 'undefined') { + switch(robj.ilsevent) { + case 1208 /* TITLE_LAST_COPY */: + case 1227 /* COPY_DELETE_WARNING */: + break; + default: + obj.error.standard_unexpected_error_alert('Batch Item Deletion',robj); + break; + } + } else { alert('Items Deleted'); } } catch(E) { obj.error.standard_unexpected_error_alert('copy status -> delete items',E); @@ -441,7 +463,7 @@ circ.copy_status.prototype = { try { obj.data.stash_retrieve(); if (!obj.data.marked_volume) { - alert('Please mark a volume as the destination from within holdings maintenance and then try this again.'); + alert('Please mark a volume as the destination and then try this again.'); return; } -- 2.11.0