more consistent persist handling for Trim List/Strict Barcode checkboxes in item...
authorpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 2 May 2007 20:02:22 +0000 (20:02 +0000)
committerpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 2 May 2007 20:02:22 +0000 (20:02 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_0@7186 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/cat/copy_buckets.js
Open-ILS/xul/staff_client/server/circ/copy_status.xul
Open-ILS/xul/staff_client/server/circ/copy_status_overlay.xul

index 2aba992..21c7169 100644 (file)
@@ -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);
index 21e4161..c012f87 100644 (file)
                                        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 );
index 7ec17fd..16460e7 100644 (file)
        <button id="copy_status_print" label="Print" command="cmd_copy_status_print" accesskey="P"/>
        <button id="copy_status_export" label="Export" command="cmd_copy_status_export" accesskey=""/>
        <button id="copy_status_export" label="Print Export" command="cmd_copy_status_print_export" accesskey=""/>
-       <checkbox id="trim_list" label="Trim List (20 rows)" checked="true" persist="checked"/> 
-       <checkbox id="strict_barcode" label="Strict Barcode" checked="false" persist="checked"/> 
+       <checkbox id="trim_list" label="Trim List (20 rows)" checked="true" persist="checked" oncommand="try{this.setAttribute('checked',this.checked);}catch(E){alert(E);}" /> 
+       <checkbox id="strict_barcode" label="Strict Barcode" checked="false" persist="checked" oncommand="try{this.setAttribute('checked',this.checked);}catch(E){alert(E);}" /> 
        <spacer flex="1"/>
 </hbox>