From f3fa820f61b6453ed8eb2bdc2b8a45a7c4e52f63 Mon Sep 17 00:00:00 2001 From: pines Date: Wed, 2 May 2007 20:02:22 +0000 Subject: [PATCH] more consistent persist handling for Trim List/Strict Barcode checkboxes in item status git-svn-id: svn://svn.open-ils.org/ILS/trunk@7186 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/server/cat/copy_buckets.js | 5 ++++- Open-ILS/xul/staff_client/server/circ/copy_status.xul | 15 ++++++++++++--- .../xul/staff_client/server/circ/copy_status_overlay.xul | 4 ++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/cat/copy_buckets.js b/Open-ILS/xul/staff_client/server/cat/copy_buckets.js index 2aba992400..21c716945e 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_buckets.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_buckets.js @@ -644,7 +644,10 @@ cat.copy_buckets.prototype = { obj.list2.dump_retrieve_ids(), function(o) { return JSON2js(o)[1]; } ); - var url = urls.XUL_COPY_STATUS + '?barcodes=' + window.escape( js2JSON(barcodes) ); + var url = urls.XUL_COPY_STATUS; // + '?barcodes=' + window.escape( js2JSON(barcodes) ); + JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.stash_retrieve(); + data.temp_barcodes_for_copy_status = barcodes; + data.stash('temp_barcodes_for_copy_status'); xulG.new_tab( url, {}, {}); } catch(E) { obj.error.standard_unexpected_error_alert('Copy Status from Copy Buckets',E); diff --git a/Open-ILS/xul/staff_client/server/circ/copy_status.xul b/Open-ILS/xul/staff_client/server/circ/copy_status.xul index 21e4161abf..c012f87868 100644 --- a/Open-ILS/xul/staff_client/server/circ/copy_status.xul +++ b/Open-ILS/xul/staff_client/server/circ/copy_status.xul @@ -53,17 +53,26 @@ try { window.xulG.set_tab_name('Item Status'); } catch(E) { alert(E); } } + g.barcodes = []; if (g.cgi.param('barcodes')) { - var barcodes = JSON2js(g.cgi.param('barcodes')); + g.barcodes = g.barcodes.concat( JSON2js(g.cgi.param('barcodes')) ); + } + JSAN.use('OpenILS.data'); g.data = new OpenILS.data(); g.data.stash_retrieve(); + if (g.data.temp_barcodes_for_copy_status) { + g.barcodes = g.barcodes.concat( g.data.temp_barcodes_for_copy_status ); + g.data.temp_barcodes_for_copy_status = null; g.data.stash('temp_barcodes_for_copy_status'); + } + + if (g.barcodes.length > 0) { JSAN.use('util.exec'); var exec = new util.exec(); var funcs = []; - for (var i = 0; i < barcodes.length; i++) { + for (var i = 0; i < g.barcodes.length; i++) { funcs.push( function(b){ return function() { g.copy_status.copy_status(b); } - }(barcodes[i]) + }(g.barcodes[i]) ); } exec.chain( funcs ); diff --git a/Open-ILS/xul/staff_client/server/circ/copy_status_overlay.xul b/Open-ILS/xul/staff_client/server/circ/copy_status_overlay.xul index 7ec17fd19e..16460e70f9 100644 --- a/Open-ILS/xul/staff_client/server/circ/copy_status_overlay.xul +++ b/Open-ILS/xul/staff_client/server/circ/copy_status_overlay.xul @@ -164,8 +164,8 @@