From 2a52f6d226ed79f5e9b9e4be47d16562200678f4 Mon Sep 17 00:00:00 2001 From: phasefx Date: Wed, 15 Aug 2007 13:59:36 +0000 Subject: [PATCH] Handle a VOLUME_LABEL_EXISTS event. We might want to consider offering a magic item transfer or volume merge when this happens. Dan, I apologize for not using messageCatalog here yet; I'm still tinkering with that. git-svn-id: svn://svn.open-ils.org/ILS/trunk@7666 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/server/cat/copy_browser.js | 12 ++++++++++-- Open-ILS/xul/staff_client/server/circ/copy_status.js | 12 ++++++++++-- 2 files changed, 20 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 d3376ed94b..f4b86ea2f0 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_browser.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_browser.js @@ -572,8 +572,16 @@ cat.copy_browser.prototype = { api.FM_ACN_TREE_UPDATE.method, [ ses(), volumes, true ] ); - if (typeof r.ilsevent != 'undefined') throw(r); - alert('Volumes modified.'); + if (typeof r.ilsevent != 'undefined') { + switch(r.ilsevent) { + case 1705 /* VOLUME_LABEL_EXISTS */ : + alert("Edit failed: You tried to change a volume's callnumber to one that is already in use for the given library. You should transfer the items to the desired callnumber instead."); + break; + default: throw(r); + } + } else { + alert('Volumes modified.'); + } } catch(E) { obj.error.standard_unexpected_error_alert('volume update error: ',E); } 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 9be6ee8899..b08c9f076e 100644 --- a/Open-ILS/xul/staff_client/server/circ/copy_status.js +++ b/Open-ILS/xul/staff_client/server/circ/copy_status.js @@ -721,8 +721,16 @@ circ.copy_status.prototype = { api.FM_ACN_TREE_UPDATE.method, [ ses(), volumes, false ] ); - if (typeof r.ilsevent != 'undefined') throw(r); - alert('Volumes modified.'); + if (typeof r.ilsevent != 'undefined') { + switch(r.ilsevent) { + case 1705 /* VOLUME_LABEL_EXISTS */ : + alert("Edit failed: You tried to change a volume's callnumber to one that is already in use for the given library. You should transfer the items to the desired callnumber instead."); + break; + default: throw(r); + } + } else { + alert('Volumes modified.'); + } } catch(E) { obj.error.standard_unexpected_error_alert('volume update error: ',E); } -- 2.11.0