[open-ils-commits] r18841 - in trunk/Open-ILS/xul/staff_client: chrome/content/cat chrome/content/main server/cat server/circ (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Nov 23 16:52:06 EST 2010


Author: phasefx
Date: 2010-11-23 16:52:01 -0500 (Tue, 23 Nov 2010)
New Revision: 18841

Modified:
   trunk/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
   trunk/Open-ILS/xul/staff_client/chrome/content/main/menu.js
   trunk/Open-ILS/xul/staff_client/server/cat/copy_browser.js
   trunk/Open-ILS/xul/staff_client/server/cat/spine_labels.js
   trunk/Open-ILS/xul/staff_client/server/cat/util.js
   trunk/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
   trunk/Open-ILS/xul/staff_client/server/circ/copy_status.js
Log:
move all invocations of Volume/Copy Creator and Spine Label interfaces to tabs to workaround https://bugs.launchpad.net/evergreen/+bug/677628


Modified: trunk/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/cat/opac.js	2010-11-23 21:40:36 UTC (rev 18840)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/cat/opac.js	2010-11-23 21:52:01 UTC (rev 18841)
@@ -814,11 +814,9 @@
 
         var title = document.getElementById('offlineStrings').getFormattedString('staff.circ.copy_status.add_volumes.title', [docid]);
 
-        JSAN.use('util.window'); var win = new util.window();
-        var w = win.open(
+        var w = xulG.new_tab(
             window.xulG.url_prefix(urls.XUL_VOLUME_COPY_CREATOR),
-            title,
-            'chrome,resizable',
+            { 'tab_name' : title },
             { 'doc_id' : docid, 'ou_ids' : [ ses('ws_ou') ] }
         );
     } catch(E) {

Modified: trunk/Open-ILS/xul/staff_client/chrome/content/main/menu.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/main/menu.js	2010-11-23 21:40:36 UTC (rev 18840)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/main/menu.js	2010-11-23 21:52:01 UTC (rev 18841)
@@ -1543,11 +1543,9 @@
     },
     'volume_item_creator' : function(params) {
         var obj = this;
-        JSAN.use('util.window'); var win = new util.window();
-        var w = win.open(
+        var w = obj.new_tab(
             obj.url_prefix(urls.XUL_VOLUME_COPY_CREATOR),
-            document.getElementById('offlineStrings').getString('staff.cat.create_or_rebarcode_items'),
-            'chrome,resizable',
+            { 'tab_name' : document.getElementById('offlineStrings').getString('staff.cat.create_or_rebarcode_items') },
             params
         );
     },

Modified: trunk/Open-ILS/xul/staff_client/server/cat/copy_browser.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/copy_browser.js	2010-11-23 21:40:36 UTC (rev 18840)
+++ trunk/Open-ILS/xul/staff_client/server/cat/copy_browser.js	2010-11-23 21:52:01 UTC (rev 18841)
@@ -288,17 +288,16 @@
 
                                     var title = document.getElementById('catStrings').getString('staff.cat.copy_browser.add_item.title');
 
-                                    JSAN.use('util.window'); var win = new util.window();
-                                    var w = win.open(
+                                    var w = xulG.new_tab(
                                         window.xulG.url_prefix(urls.XUL_VOLUME_COPY_CREATOR),
-                                            //+'?doc_id=' + window.escape(obj.docid)
-                                            //+'&ou_ids=' + window.escape( js2JSON(list) )
-                                            //+'&copy_shortcut=' + window.escape( js2JSON(copy_shortcut) ),
-                                        title,
-                                        'chrome,resizable'
+                                        { 'tab_name' : title },
+                                        {
+                                            'doc_id' : obj.docid, 
+                                            'ou_ids' : list, 
+                                            'copy_shortcut' : copy_shortcut,
+                                            'refresh' : function() { obj.refresh_list(); }
+                                        }
                                     );
-                                    w.refresh = function() { obj.refresh_list(); }
-                                    w.xulG = { 'doc_id':obj.docid, 'ou_ids' : list, 'copy_shortcut' : copy_shortcut };
                                 } catch(E) {
                                     obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.add_item.error'),E);
                                 }
@@ -485,12 +484,12 @@
                                         }
                                     );
 
-                                    obj.data.temp_barcodes_for_labels = util.functional.map_list( list, function(o){return o.barcode();}) ; 
-                                    obj.data.stash('temp_barcodes_for_labels');
                                     xulG.new_tab(
                                         xulG.url_prefix( urls.XUL_SPINE_LABEL ),
                                         { 'tab_name' : document.getElementById('catStrings').getString('staff.cat.copy_browser.print_spine.tab') },
-                                        {}
+                                        {
+                                            'barcodes' : util.functional.map_list( list, function(o){return o.barcode();})
+                                        }
                                     );
                                 } catch(E) {
                                     obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.print_spine.error'),E);
@@ -537,17 +536,12 @@
 
                                     var title = document.getElementById('catStrings').getString('staff.cat.copy_browser.add_volume.title');
 
-                                    JSAN.use('util.window'); var win = new util.window();
-                                    var w = win.open(
+                                    var w = xulG.new_tab(
                                         window.xulG.url_prefix(urls.XUL_VOLUME_COPY_CREATOR),
-                                            //+'?doc_id=' + window.escape(obj.docid)
-                                            //+'&ou_ids=' + window.escape( js2JSON(list) ),
-                                        title,
-                                        'chrome,resizable'
+                                        { 'tab_name' : title },
+                                        { 'doc_id' : obj.docid, 'ou_ids' : list, 'refresh' : function() { obj.refresh_list(); } }
                                     );
 
-                                    w.refresh = function() { obj.refresh_list() };
-                                    w.xulG = { 'doc_id' : obj.docid, 'ou_ids' : list };
                                 } catch(E) {
                                     obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.add_volume.error'),E);
                                 }

Modified: trunk/Open-ILS/xul/staff_client/server/cat/spine_labels.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/spine_labels.js	2010-11-23 21:40:36 UTC (rev 18840)
+++ trunk/Open-ILS/xul/staff_client/server/cat/spine_labels.js	2010-11-23 21:52:01 UTC (rev 18841)
@@ -20,6 +20,9 @@
                     g.barcodes = g.barcodes.concat( g.data.temp_barcodes_for_labels );
                     g.data.temp_barcodes_for_labels = null; g.data.stash('temp_barcodes_for_labels');
                 }
+                if (xulG.barcodes) {
+                    g.barcodes = g.barcodes.concat( xulG.barcodes );
+                }
 
                 JSAN.use('circ.util');
                 g.cols = circ.util.columns( {} );
@@ -579,6 +582,7 @@
             var w = win.open( loc, 'spine_preview', 'chrome,resizable,width=750,height=550');
             w.xulG = { 
                 'url' : 'about:blank',
+                'url_prefix' : function (u) { return xulG.url_prefix(u); },
                 'show_print_button' : 1,
                 'printer_context' : 'label',
                 'alternate_print' : 1,

Modified: trunk/Open-ILS/xul/staff_client/server/cat/util.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/util.js	2010-11-23 21:40:36 UTC (rev 18840)
+++ trunk/Open-ILS/xul/staff_client/server/cat/util.js	2010-11-23 21:52:01 UTC (rev 18841)
@@ -189,13 +189,12 @@
     JSAN.use('util.error'); var error = new util.error();
     try {
         JSAN.use('util.functional');
-        JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.stash_retrieve();
-        data.temp_barcodes_for_labels = util.functional.map_list( selection_list, function(o){return o.barcode;}) ; 
-        data.stash('temp_barcodes_for_labels');
         xulG.new_tab(
             xulG.url_prefix( urls.XUL_SPINE_LABEL ),
             { 'tab_name' : $("catStrings").getString('staff.cat.util.spine_editor.tab_name') },
-            {}
+            {
+                'barcodes' : util.functional.map_list( selection_list, function(o){return o.barcode;}) 
+            }
         );
     } catch(E) {
         error.standard_unexpected_error_alert($("catStrings").getString('staff.cat.util.spine_editor.spine_editor_error'),E);

Modified: trunk/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js	2010-11-23 21:40:36 UTC (rev 18840)
+++ trunk/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js	2010-11-23 21:52:01 UTC (rev 18841)
@@ -486,6 +486,7 @@
             }
         }
 
+        var dont_close = false;
         JSAN.use('util.window'); var win = new util.window();
         if (copies.length > 0) {
             JSAN.use('cat.util');
@@ -507,13 +508,13 @@
                 //case 1706 /* ITEM_BARCODE_EXISTS */ :
                 if (copies && copies.length > 0 && $('print_labels').checked) {
                     JSAN.use('util.functional');
-                    JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.stash_retrieve();
-                    data.temp_barcodes_for_labels = util.functional.map_list( copies, function(o){return o.barcode();}) ; 
-                    data.stash('temp_barcodes_for_labels');
-                    var w = win.open(
+                    dont_close = true;
+                    xulG.set_tab(
                         urls.XUL_SPINE_LABEL,
-                        'spine_labels',
-                        'chrome,resizable,width=750,height=550'
+                        { 'tab_name' : $("catStrings").getString('staff.cat.util.spine_editor.tab_name') },
+                        {
+                            'barcodes' : util.functional.map_list( copies, function(o){return o.barcode();}) 
+                        }
                     );
                 }
             } catch(E) {
@@ -521,10 +522,10 @@
             }
         }
 
-        if (typeof window.refresh == 'function') { window.refresh(); }
-        if (typeof g.refresh == 'function') { g.refresh(); }
+        try { if (typeof window.refresh == 'function') { window.refresh(); } } catch(E) { dump(E+'\n'); }
+        try { if (typeof g.refresh == 'function') { g.refresh(); } } catch(E) { dump(E+'\n'); }
 
-        window.close();
+        if (! dont_close) { xulG.close_tab(); }
 
     } catch(E) {
         g.error.standard_unexpected_error_alert($(catStrings).getString('staff.cat.volume_copy_creator.stash_and_close.tree_err3'),E);

Modified: trunk/Open-ILS/xul/staff_client/server/circ/copy_status.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/copy_status.js	2010-11-23 21:40:36 UTC (rev 18840)
+++ trunk/Open-ILS/xul/staff_client/server/circ/copy_status.js	2010-11-23 21:52:01 UTC (rev 18841)
@@ -532,14 +532,9 @@
     
                                     var title = document.getElementById('circStrings').getFormattedString('staff.circ.copy_status.add_items.title', [r]);
     
-                                    JSAN.use('util.window'); var win = new util.window();
-                                    var w = win.open(
+                                    var w = xulG.new_tab(
                                         window.xulG.url_prefix(urls.XUL_VOLUME_COPY_CREATOR),
-                                            //+'?doc_id=' + window.escape(r)
-                                            //+'&ou_ids=' + window.escape( js2JSON(list) )
-                                            //+'&copy_shortcut=' + window.escape( js2JSON(copy_shortcut[r]) ),
-                                        title,
-                                        'chrome,resizable',
+                                        { 'tab_name' : title },
                                         { 'doc_id' : r, 'ou_ids' : list, 'copy_shortcut' : copy_shortcut[r] }
                                     );
                                 }
@@ -687,13 +682,9 @@
 
                                     var title = document.getElementById('circStrings').getFormattedString('staff.circ.copy_status.add_volumes.title', [r]);
 
-                                    JSAN.use('util.window'); var win = new util.window();
-                                    var w = win.open(
+                                    var w = xulG.new_tab(
                                         window.xulG.url_prefix(urls.XUL_VOLUME_COPY_CREATOR),
-                                            //+'?doc_id=' + window.escape(r)
-                                            //+'&ou_ids=' + window.escape( js2JSON(list) ),
-                                        title,
-                                        'chrome,resizable',
+                                        { 'tab_name' : title },
                                         { 'doc_id' : r, 'ou_ids' : list }
                                     );
 



More information about the open-ils-commits mailing list