Replace deprecated use of window.opener in unit selection window.
authordbwells <dbwells@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 18 Nov 2010 19:22:46 +0000 (19:22 +0000)
committerdbwells <dbwells@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 18 Nov 2010 19:22:46 +0000 (19:22 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@18792 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/serial/manage_items.js
Open-ILS/xul/staff_client/server/serial/select_unit.xul

index 756ea5d..4e757be 100644 (file)
@@ -491,19 +491,18 @@ serial.manage_items.prototype = {
        'set_other_sunit' : function() {
                var obj = this;
                try {
-            g.serial_items_sunit_select = '';
-            g.serial_items_sdist_ids = obj.sdist_ids;
             JSAN.use('util.window'); var win = new util.window();
-            win.open(
+            var select_unit_window = win.open(
                 xulG.url_prefix(urls.XUL_SERIAL_SELECT_UNIT),
                 '_blank',
-                'chrome,resizable,modal,centerscreen'
+                'chrome,resizable,modal,centerscreen',
+                {'sdist_ids' : obj.sdist_ids}
             );
-            if (!g.serial_items_sunit_select) {
+            if (!select_unit_window.sunit_selection) {
                 return;
             }
 
-            var selection = g.serial_items_sunit_select;
+            var selection = select_unit_window.sunit_selection;
             var sunit_id = selection.sunit;
             var sdist_id = selection.sdist;
             var sstr_id = selection.sstr;
index 9fc93ef..0347ad8 100644 (file)
 
                 var ml;
                                JSAN.use('util.network'); g.network = new util.network();
+                var sdist_ids = xul_param('sdist_ids',{'modal_xulG':true});
+                //TODO: unit_list.retrieve option for binding units only (that is, units containing bound items only)
                 var robj = g.network.request(
                     'open-ils.serial',
                     'open-ils.serial.unit_list.retrieve',
-                    opener.g.serial_items_sdist_ids
+                    sdist_ids
                 );
                 if (typeof robj.ilsevent != 'undefined') throw(robj);
                 ml = util.widgets.make_menulist(robj);
@@ -64,7 +66,7 @@
         g.select_unit = function() {
             var selection = JSON2js($('unit_menu').value);
             selection.label = $('unit_menu').selectedItem.label;
-            opener.g.serial_items_sunit_select = selection;
+            update_modal_xulG({'sunit_selection' : selection});
             window.close();
         }