From 65fcb074a6d8d5643f0694bf7152b23278aa05b7 Mon Sep 17 00:00:00 2001 From: phasefx Date: Wed, 26 Jul 2006 12:22:58 +0000 Subject: [PATCH] volume transfer, waiting for middle layer git-svn-id: svn://svn.open-ils.org/ILS/trunk@5109 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../staff_client/chrome/content/main/constants.js | 1 + .../xul/staff_client/server/cat/copy_browser.js | 103 +++++++++++++++++++++ .../xul/staff_client/server/cat/copy_browser.xul | 8 ++ 3 files changed, 112 insertions(+) diff --git a/Open-ILS/xul/staff_client/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js index 9c29e42289..982ccc94c7 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js @@ -24,6 +24,7 @@ const api = { 'FM_ACN_RETRIEVE' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.callnumber.retrieve' }, 'FM_ACN_TREE_UPDATE' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.asset.volume.fleshed.batch.update' }, 'FM_ACN_TREE_LIST_RETRIEVE_VIA_RECORD_ID_AND_ORG_IDS' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.asset.copy_tree.retrieve' }, + 'FM_ACN_TRANSFER' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.asset.volume.batch.transfer' }, 'FM_ACP_RETRIEVE' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.asset.copy.fleshed.retrieve' }, 'FM_ACP_RETRIEVE_VIA_BARCODE' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.asset.copy.find_by_barcode' }, 'FM_ACP_FLESHED_BATCH_RETRIEVE' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.asset.copy.fleshed.batch.retrieve' }, 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 e8d9ced57b..8bcc6fda35 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_browser.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_browser.js @@ -513,6 +513,37 @@ cat.copy_browser.prototype = { } ], + 'cmd_mark_library' : [ + ['command'], + function() { + try { + var list = util.functional.filter_list( + obj.sel_list, + function (o) { + return o.split(/_/)[0] == 'aou'; + } + ); + + list = util.functional.map_list( + list, + function (o) { + return o.split(/_/)[1]; + } + ); + + if (list.length == 1) { + obj.data.marked_library = { 'lib' : list[0], 'docid' : obj.docid }; + obj.data.stash('marked_library'); + alert('Library + Record marked as Volume Transfer Destination'); + } else { + obj.error.yns_alert('Choose just one Library to mark as Volume Transfer Destination','Limit Selection','OK',null,null,'Check here to confirm this dialog'); + } + } catch(E) { + obj.error.standard_unexpected_error_alert('copy browser -> mark library',E); + } + } + ], + 'cmd_mark_volume' : [ ['command'], function() { @@ -549,6 +580,74 @@ cat.copy_browser.prototype = { obj.refresh_list(); } ], + 'cmd_transfer_volume' : [ + ['command'], + function() { + try { + obj.data.stash_retrieve(); + if (!obj.data.marked_library) { + alert('Please mark a library as the destination from within the copy browser and then try this again.'); + return; + } + + JSAN.use('util.functional'); + + var list = util.functional.filter_list( + obj.sel_list, + function (o) { + return o.split(/_/)[0] == 'acn'; + } + ); + + list = util.functional.map_list( + list, + function (o) { + return o.split(/_/)[1]; + } + ); + + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserWrite'); + var xml = ''; + xml += 'Transfer volumes '; + + xml += util.functional.map_list( + list, + function (o) { + return obj.map_acn[ 'acn_' + o ].label(); + } + ).join(", "); + + xml += ' to library ' + obj.data.hash.aou[ obj.data.marked_library.lib ].shortname(); + xml += ' on the following record?'; + xml += '