From 5dd2ae5ac5e85e3a7c25816e195a621835e5c106 Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Wed, 11 Apr 2012 19:53:48 -0400 Subject: [PATCH] Rip modal_xulG_stack out, replace with openDialog This converts the util/window.js open function to a wrapper around the openDialog function and passes xulG in that way, as well as teaches global_util.js to look for it having been passed in via the arguments parameter on window. The non-modal "push it into place" is still done as well, in case some window isn't using global_util.js and needs xulG. Signed-off-by: Thomas Berezansky Signed-off-by: Bill Erickson --- .../chrome/content/OpenILS/global_util.js | 35 +----- .../staff_client/chrome/content/main/menu.js | 8 +- .../chrome/content/main/simple_auth.xul | 17 ++- .../chrome/content/util/fancy_prompt.xul | 40 ++----- .../staff_client/chrome/content/util/print.js | 2 +- .../chrome/content/util/timestamp.js | 42 +++---- .../chrome/content/util/widget_prompt.js | 23 ++-- .../chrome/content/util/widget_prompt.xul | 2 +- .../chrome/content/util/window.js | 109 ++---------------- .../xul/staff_client/server/cat/bib_brief.js | 13 --- .../staff_client/server/cat/copy_editor.js | 13 +-- .../staff_client/server/cat/copy_notes.xul | 2 +- .../xul/staff_client/server/cat/marc_view.xul | 10 -- .../server/cat/record_buckets_quick.xul | 1 - .../staff_client/server/cat/volume_editor.js | 3 +- .../server/circ/backdate_post_checkin.js | 12 +- .../staff_client/server/circ/circ_summary.xul | 4 +- .../staff_client/server/circ/copy_details.xul | 4 +- .../staff_client/server/main/simple_auth.xul | 17 ++- .../server/patron/bill_cc_info.xul | 2 +- .../staff_client/server/patron/bill_wizard.js | 38 +++--- .../server/patron/edit_standing_penalty.js | 22 ++-- .../staff_client/server/patron/hold_cancel.js | 10 +- .../server/patron/new_standing_penalty.js | 10 +- .../staff_client/server/serial/editor_base.js | 17 ++- .../xul/staff_client/server/serial/notes.xul | 8 +- .../staff_client/server/serial/select_aou.xul | 4 +- .../server/serial/select_unit.xul | 4 +- 28 files changed, 134 insertions(+), 338 deletions(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js b/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js index 38e62ae4d9..af522518e5 100644 --- a/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js +++ b/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js @@ -1,3 +1,7 @@ + if(window.arguments && typeof window.arguments[0] == 'object' && typeof xulG == 'undefined') { + xulG = window.arguments[0]; + } + function $(id) { return document.getElementById(id); } function oils_unsaved_data_V() { @@ -443,25 +447,6 @@ } } - function update_modal_xulG(v) { - try { - if (typeof xulG != "undefined" && xulG.not_modal) { - xulG = v; - xulG.not_modal = true; - return; - } - - JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'}); - var key = location.pathname + location.search + location.hash; - if (typeof data.modal_xulG_stack != 'undefined' && typeof data.modal_xulG_stack[key] != 'undefined') { - data.modal_xulG_stack[key][ data.modal_xulG_stack[key].length - 1 ] = v; - data.stash('modal_xulG_stack'); - } - } catch(E) { - alert('FIXME: update_modal_xulG => ' + E); - } - } - function xul_param(param_name,_params) { /* By default, this function looks for a CGI-style query param identified by param_name. If one isn't found, it then looks in xulG. If one still isn't found, and _params.stash_name is true, it looks in the global xpcom stash for the field identified by stash_name. If _params.concat is true, then it looks in all these places and concatenates the results. There are also options for converting JSON to javascript objects, and clearing the xpcom stash_name field after retrieval. Also added, ability to search a specific spot in the xpcom stash that implements a stack to hold xulG's for modal windows */ try { @@ -490,18 +475,6 @@ } } if (typeof _params.no_xulG == 'undefined') { - if (typeof _params.modal_xulG != 'undefined') { - if (typeof xulG != 'undefined' && xulG.not_modal) { - // for interfaces that used to be modal but aren't now, do nothing - } else { - JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'}); - var key = location.pathname + location.search + location.hash; - //dump('xul_param, considering modal key = ' + key + '\n'); - if (typeof data.modal_xulG_stack != 'undefined' && typeof data.modal_xulG_stack[key] != 'undefined') { - xulG = data.modal_xulG_stack[key][ data.modal_xulG_stack[key].length - 1 ]; - } - } - } if (typeof xulG == 'object' && typeof xulG[ param_name ] != 'undefined') { var x = xulG[ param_name ]; //dump('\tfound via xulG = ' + x + '\n'); diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu.js b/Open-ILS/xul/staff_client/chrome/content/main/menu.js index d7fb3b4c21..8d130f459e 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js @@ -1278,11 +1278,9 @@ main.menu.prototype = { var cookieSvc = Components.classes["@mozilla.org/cookieService;1"].getService(Components.interfaces.nsICookieService); cookieSvc.setCookieString(cookieUriSSL, null, "ses="+obj.data.session.key + "; secure;", null); - - } catch(E) { - alert(offlineStrings.getFormattedString(main.session_cookie.error, [E])); - } - + } catch(E) { + alert(offlineStrings.getFormattedString(main.session_cookie.error, [E])); + } } else { if (network.get_new_session(offlineStrings.getString('menu.cmd_chg_session.label'),{'url_prefix':obj.url_prefix})) { obj.data.stash_retrieve(); diff --git a/Open-ILS/xul/staff_client/chrome/content/main/simple_auth.xul b/Open-ILS/xul/staff_client/chrome/content/main/simple_auth.xul index 89b54407e1..30c507d30f 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/simple_auth.xul +++ b/Open-ILS/xul/staff_client/chrome/content/main/simple_auth.xul @@ -47,15 +47,15 @@ $('server').value = g.data.server_unadorned; - addCSSClass(document.documentElement,xul_param('login_type',{'modal_xulG':true})) + addCSSClass(document.documentElement,xul_param('login_type')) - if (xul_param('desc_brief',{'modal_xulG':true})) { + if (xul_param('desc_brief')) { $('desc').hidden = false; - $('desc_brief').appendChild( document.createTextNode( xul_param('desc_brief',{'modal_xulG':true}) ) ); + $('desc_brief').appendChild( document.createTextNode( xul_param('desc_brief') ) ); } - if (xul_param('desc_full',{'modal_xulG':true})) { + if (xul_param('desc_full')) { $('desc').hidden = false; - $('desc_full').appendChild( document.createTextNode( xul_param('desc_full',{'modal_xulG':true}) ) ); + $('desc_full').appendChild( document.createTextNode( xul_param('desc_full') ) ); } $('username').focus(); @@ -90,7 +90,7 @@ 'password_prompt' : $('password'), 'server_prompt' : $('server'), }, - xul_param('login_type',{'modal_xulG':true}) || 'temp' + xul_param('login_type') || 'temp' ); g.session.on_init = function() { try { @@ -102,10 +102,7 @@ 'usr' : js2JSON(staff) } g.data.stash('temporary_session'); - var my_xulG = { // new way, to minimize the use of global spaces - 'temporary_session' : g.data.temporary_session - }; - update_modal_xulG(my_xulG); + xulG.temporary_session = g.data.temporary_session; window.close(); } catch(E) { g.error.standard_unexpected_error_alert('simple_auth.session.on_init',E); diff --git a/Open-ILS/xul/staff_client/chrome/content/util/fancy_prompt.xul b/Open-ILS/xul/staff_client/chrome/content/util/fancy_prompt.xul index 281ee639d0..0d423456b2 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/fancy_prompt.xul +++ b/Open-ILS/xul/staff_client/chrome/content/util/fancy_prompt.xul @@ -19,7 +19,7 @@ @@ -34,8 +34,6 @@ '; } print_url += '' + window.escape(msg.replace(/]*>.*?<\/script>/gi,'')) + ''; - obj.win.openDialog(print_url,'receipt_temp','chrome,resizable,modal', null, { "data" : params.data, "list" : params.list}, function(w) { + obj.win.openDialog(print_url,'receipt_temp','chrome,resizable,modal', { "data" : params.data, "list" : params.list}, function(w) { try { obj.NSPrint(w, silent, params); } catch(E) { diff --git a/Open-ILS/xul/staff_client/chrome/content/util/timestamp.js b/Open-ILS/xul/staff_client/chrome/content/util/timestamp.js index 141551cd8a..aac7d70304 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/timestamp.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/timestamp.js @@ -22,31 +22,31 @@ function timestamp_init() { JSAN.use('util.sound'); sound = new util.sound(); JSAN.use('util.date'); - $('datepicker').value = xul_param('default_date',{'modal_xulG':true}) || util.date.formatted_date(new Date(),'%F'); - if (xul_param('default_time',{'modal_xulG':true})) { - $('timepicker').value = xul_param('default_time',{'modal_xulG':true}); + $('datepicker').value = xul_param('default_date') || util.date.formatted_date(new Date(),'%F'); + if (xul_param('default_time')) { + $('timepicker').value = xul_param('default_time'); } - if (xul_param('time_readonly',{'modal_xulG':true})) { + if (xul_param('time_readonly')) { $('timepicker').readonly = true; // This isn't working correctly with xulrunner 1.9.2 $('timepicker').disabled = true; // So, poor man's kludge } - if (xul_param('date_readonly',{'modal_xulG':true})) { + if (xul_param('date_readonly')) { $('datepicker').readonly = true; // This isn't working correctly with xulrunner 1.9.2 $('datepicker').disabled = true; // So, poor man's kludge } - if (xul_param('title',{'modal_xulG':true})) { $('dialogheader').setAttribute('title',xul_param('title',{'modal_xulG':true})); } - if (xul_param('description',{'modal_xulG':true})) { $('dialogheader').setAttribute('description',xul_param('description',{'modal_xulG':true})); } + if (xul_param('title')) { $('dialogheader').setAttribute('title',xul_param('title')); } + if (xul_param('description')) { $('dialogheader').setAttribute('description',xul_param('description')); } var x = $('msg_area'); - if (x && xul_param('msg',{'modal_xulG':true})) { + if (x && xul_param('msg')) { var d = document.createElement('description'); - var t = document.createTextNode( xul_param('msg',{'modal_xulG':true}) ); + var t = document.createTextNode( xul_param('msg') ); x.appendChild( d ); d.appendChild( t ); } - if (xul_param('allow_unset',{'modal_xulG':true})) { $('remove_btn').hidden = false; } + if (xul_param('allow_unset')) { $('remove_btn').hidden = false; } /* set widget behavior */ $('cancel_btn').addEventListener( @@ -92,13 +92,13 @@ function timestamp_init() { } function check_date(value) { - if (xul_param('disallow_future_dates',{'modal_xulG':true})) { + if (xul_param('disallow_future_dates')) { if ( value > new Date() ) { return { 'allowed' : false, 'reason' : $('commonStrings').getString('staff.util.timestamp_dialog.future_date_disallowed') }; } } - if (xul_param('disallow_past_dates',{'modal_xulG':true})) { + if (xul_param('disallow_past_dates')) { if ( util.date.check_past('YYYY-MM-DD', value) ) { return { 'allowed' : false, 'reason' : $('commonStrings').getString('staff.util.timestamp_dialog.past_date_disallowed') }; } } - if (xul_param('disallow_today',{'modal_xulG':true})) { + if (xul_param('disallow_today')) { if ( util.date.formatted_date(new Date(),'%F') == value) { return { 'allowed' : false, 'reason' : $('commonStrings').getString('staff.util.timestamp_dialog.today_disallowed') }; } } return { 'allowed' : true }; @@ -110,12 +110,8 @@ function gen_handle_apply(params) { if (!params) { params = {}; } if (params.remove) { - update_modal_xulG( - { - 'timestamp' : null, - 'complete' : 1 - } - ) + xulG.timestamp = null; + xulG.complete = 1; window.close(); } else { @@ -130,12 +126,8 @@ function gen_handle_apply(params) { dp_date.setHours( tp_date.getHours() ); dp_date.setMinutes( tp_date.getMinutes() ); - update_modal_xulG( - { - 'timestamp' : util.date.formatted_date(dp_date,'%{iso8601}'), - 'complete' : 1 - } - ) + xulG.timestampe = util.date.formatted_date(dp_date,'%{iso8601}'); + xulG.complete = 1; window.close(); } diff --git a/Open-ILS/xul/staff_client/chrome/content/util/widget_prompt.js b/Open-ILS/xul/staff_client/chrome/content/util/widget_prompt.js index 35e5319b7c..0bc238f373 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/widget_prompt.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/widget_prompt.js @@ -9,24 +9,24 @@ function my_init() { JSAN.use('util.error'); g.error = new util.error(); g.error.sdump('D_TRACE','my_init() for widget_prompt.xul'); - widget = xul_param('widget',{'modal_xulG':true}); + widget = xul_param('widget'); if (widget) { $('widget_prompt_main').appendChild(widget); } - var ok_label = xul_param('ok_label',{'modal_xulG':true}) || offlineStrings.getString('common.ok.label'); + var ok_label = xul_param('ok_label') || offlineStrings.getString('common.ok.label'); $('ok_btn').setAttribute('label',ok_label); - var ok_accesskey = xul_param('ok_accesskey',{'modal_xulG':true}) || offlineStrings.getString('common.ok.accesskey'); + var ok_accesskey = xul_param('ok_accesskey') || offlineStrings.getString('common.ok.accesskey'); $('ok_btn').setAttribute('accesskey',ok_accesskey); - var cancel_label = xul_param('cancel_label',{'modal_xulG':true}) || offlineStrings.getString('common.cancel.label'); + var cancel_label = xul_param('cancel_label') || offlineStrings.getString('common.cancel.label'); $('cancel_btn').setAttribute('label',cancel_label); - var cancel_accesskey = xul_param('cancel_accesskey',{'modal_xulG':true}) || offlineStrings.getString('common.cancel.accesskey'); + var cancel_accesskey = xul_param('cancel_accesskey') || offlineStrings.getString('common.cancel.accesskey'); $('cancel_btn').setAttribute('accesskey',cancel_accesskey); - var desc = xul_param('desc',{'modal_xulG':true}); + var desc = xul_param('desc'); if (desc) { $('desc').appendChild( document.createTextNode( desc ) ); } @@ -34,13 +34,12 @@ function my_init() { $('ok_btn').addEventListener('command',widget_save,false); $('cancel_btn').addEventListener('command',function(ev) { window.close(); },false); - if (xul_param('title',{'modal_xulG':true})) { - try { window.title = xul_param('title',{'modal_xulG':true}); } catch(E) {} - try { document.title = xul_param('title',{'modal_xulG':true}); } catch(E) {} + if (xul_param('title')) { + try { window.title = xul_param('title'); } catch(E) {} + try { document.title = xul_param('title'); } catch(E) {} } xulG[ 'status' ] = 'incomplete'; - update_modal_xulG(xulG); try { widget.focus(); } catch(E) {} @@ -52,7 +51,7 @@ function my_init() { function widget_save(ev) { try { if (widget) { - switch( xul_param('access',{'modal_xulG':true}) ) { + switch( xul_param('access') ) { case 'method' : xulG[ 'value' ] = xulG[ 'method' ](); break; @@ -67,8 +66,6 @@ function widget_save(ev) { } xulG[ 'status' ] = 'complete'; - update_modal_xulG(xulG); - window.close(); } catch(E) { alert('Error in widget_prompt.js, widget_save(): ' + E); diff --git a/Open-ILS/xul/staff_client/chrome/content/util/widget_prompt.xul b/Open-ILS/xul/staff_client/chrome/content/util/widget_prompt.xul index 303a4c3e90..dbe504dac6 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/widget_prompt.xul +++ b/Open-ILS/xul/staff_client/chrome/content/util/widget_prompt.xul @@ -19,7 +19,7 @@ diff --git a/Open-ILS/xul/staff_client/chrome/content/util/window.js b/Open-ILS/xul/staff_client/chrome/content/util/window.js index ddb8cbc526..38c3836fda 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/window.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/window.js @@ -32,27 +32,6 @@ util.window.prototype = { // From: Bryan White on netscape.public.mozilla.xpfe, Oct 13, 2004 // Message-ID: // Modified by Jason for Evergreen - 'SafeWindowOpen' : function (url,title,features) { - var w; - - const CI = Components.interfaces; - const PB = Components.classes["@mozilla.org/preferences-service;1"].getService(CI.nsIPrefBranch); - - var blocked = false; - try { - // pref 'dom.disable_open_during_load' is the main popup blocker preference - blocked = PB.getBoolPref("dom.disable_open_during_load"); - if(blocked) PB.setBoolPref("dom.disable_open_during_load",false); - w = this.win.open(url,title,features); - } catch(E) { - this.error.sdump('D_ERROR','window.SafeWindowOpen: ' + E + '\n'); - throw(E); - } - if(blocked) PB.setBoolPref("dom.disable_open_during_load",true); - - return w; - }, - 'SafeWindowOpenDialog' : function (url,title,features) { var w; @@ -66,7 +45,7 @@ util.window.prototype = { if(blocked) PB.setBoolPref("dom.disable_open_during_load",false); w = this.win.openDialog.apply(this.win,arguments); } catch(E) { - this.error.sdump('D_ERROR','window.SafeWindowOpen: ' + E + '\n'); + this.error.sdump('D_ERROR','window.SafeWindowOpenDialog: ' + E + '\n'); throw(E); } if(blocked) PB.setBoolPref("dom.disable_open_during_load",true); @@ -74,57 +53,16 @@ util.window.prototype = { return w; }, + // This has basically become a compatibility wrapper for openDialog. 'open' : function(url,title,features,my_xulG) { var key; - if (!title) title = '_blank'; - if (!features) features = 'chrome'; - this.error.sdump('D_WIN', 'opening ' + url + ', ' + title + ', ' + features + ' from ' + this.win + '\n'); - var data; - if (features.match(/modal/) && my_xulG) { - JSAN.use('OpenILS.data'); data = new OpenILS.data(); data.init({'via':'stash'}); - if (typeof data.modal_xulG_stack == 'undefined') data.modal_xulG_stack = {}; - /* FIXME - not a perfect key.. could imagine two top-level windows both opening modal windows */ - key = url; - if (typeof xulG == 'object') { - if (typeof xulG.url_prefix == 'function') { - key = key.replace( xulG.url_prefix('/'), '/' ); - } - } else if (typeof url_prefix == 'function') { - key = key.replace( url_prefix('/'), '/' ); - } - // oils://remote/ looks like http://server/ to files loaded off of it. That is, location.pathname ignores it. - // So remove it here, like we remove url_prefix. - key = key.replace('oils://remote/', '/'); - if (typeof data.modal_xulG_stack[key] == 'undefined') data.modal_xulG_stack[key] = []; - data.modal_xulG_stack[key].push( my_xulG ); - data.stash('modal_xulG_stack'); - this.error.sdump('D_WIN','modal key = ' + key); - } - var w = this.SafeWindowOpen(url,title,features); - if (features.match(/modal/) && my_xulG) { - data.init({'via':'stash'}); - var x = data.modal_xulG_stack[key].pop(); - data.stash('modal_xulG_stack'); - w.focus(); - return x; - } else { - if (my_xulG) { - if (get_contentWindow(w)) { - get_contentWindow(w).xulG = my_xulG; - } else { - w.xulG = my_xulG; - } - } - } - /* - setTimeout( - function() { - try { w.title = title; } catch(E) { dump('**'+E+'\n'); } - try { w.document.title = title; } catch(E) { dump('**'+E+'\n'); } - }, 0 - ); - */ - return w; + if (!features) features = 'chrome,dialog=no'; + if (!features.match(/dialog/)) features = 'dialog=no,' + features; // window.open doesn't do dialog by default + if (!features.match(/chrome/)) features = 'chrome=no,' + features; // And window.open doesn't assume chrome by default + var outArgs = Array.prototype.slice.call(arguments); + outArgs[1] = title; + outArgs[2] = features; + return this.openDialog.apply(this, outArgs); // Pass to openDialog }, 'openDialog' : function(url,title,features,my_xulG) { @@ -132,36 +70,13 @@ util.window.prototype = { if (!title) title = '_blank'; if (!features) features = 'chrome'; // Note that this is a default for openDialog anyway var outArgs = Array.prototype.slice.call(arguments); - outArgs.splice(3,1); // Remove my_xulG + outArgs[1] = title; + outArgs[2] = features; this.error.sdump('D_WIN', 'opening ' + url + ', ' + title + ', ' + features + ' from ' + this.win + '\n'); var data; - if (features.match(/modal/) && my_xulG) { - JSAN.use('OpenILS.data'); data = new OpenILS.data(); data.init({'via':'stash'}); - if (typeof data.modal_xulG_stack == 'undefined') data.modal_xulG_stack = {}; - /* FIXME - not a perfect key.. could imagine two top-level windows both opening modal windows */ - key = url; - if (typeof xulG == 'object') { - if (typeof xulG.url_prefix == 'function') { - key = key.replace( xulG.url_prefix('/'), '/' ); - } - } else if (typeof url_prefix == 'function') { - key = key.replace( url_prefix('/'), '/' ); - } - // oils://remote/ looks like http://server/ to files loaded off of it. That is, location.pathname ignores it. - // So remove it here, like we remove url_prefix. - key = key.replace('oils://remote/', '/'); - if (typeof data.modal_xulG_stack[key] == 'undefined') data.modal_xulG_stack[key] = []; - data.modal_xulG_stack[key].push( my_xulG ); - data.stash('modal_xulG_stack'); - this.error.sdump('D_WIN','modal key = ' + key); - } var w = this.SafeWindowOpenDialog.apply(this, outArgs); if (features.match(/modal/) && my_xulG) { - data.init({'via':'stash'}); - var x = data.modal_xulG_stack[key].pop(); - data.stash('modal_xulG_stack'); - w.focus(); - return x; + return my_xulG; } else { if (my_xulG) { if (get_contentWindow(w)) { diff --git a/Open-ILS/xul/staff_client/server/cat/bib_brief.js b/Open-ILS/xul/staff_client/server/cat/bib_brief.js index 13c57d8cf7..0f527d6aab 100644 --- a/Open-ILS/xul/staff_client/server/cat/bib_brief.js +++ b/Open-ILS/xul/staff_client/server/cat/bib_brief.js @@ -13,19 +13,6 @@ function bib_brief_init(mode) { docid = xul_param('docid'); - // hackery if modal and invoked with util.window - var key = location.pathname + location.search + location.hash; - if (!docid - && typeof g.data.modal_xulG_stack != 'undefined' - && typeof g.data.modal_xulG_stack[key] != 'undefined' - ) { - var xulG = g.data.modal_xulG_stack[key][ - g.data.modal_xulG_stack[key].length - 1 ]; - if (typeof xulG == 'object') { - docid = xulG.docid; - } - } - JSAN.use('util.network'); g.network = new util.network(); JSAN.use('util.date'); diff --git a/Open-ILS/xul/staff_client/server/cat/copy_editor.js b/Open-ILS/xul/staff_client/server/cat/copy_editor.js index 48aeb39465..d289be8174 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_editor.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_editor.js @@ -25,13 +25,13 @@ function my_init() { $('non_unified_buttons').hidden = true; } - g.docid = xul_param('docid',{'modal_xulG':true}); - g.handle_update = xul_param('handle_update',{'modal_xulG':true}); + g.docid = xul_param('docid'); + g.handle_update = xul_param('handle_update'); /******************************************************************************************************/ /* Get the copy ids from various sources and flesh them */ - var copy_ids = xul_param('copy_ids',{'concat':true,'JSON2js_if_cgi':true,'JSON2js_if_xulG':true,'JSON2js_if_xpcom':true,'stash_name':'temp_copy_ids','clear_xpcom':true,'modal_xulG':true}); + var copy_ids = xul_param('copy_ids',{'concat':true,'JSON2js_if_cgi':true,'JSON2js_if_xulG':true,'JSON2js_if_xpcom':true,'stash_name':'temp_copy_ids','clear_xpcom':true}); if (!copy_ids) copy_ids = []; if (copy_ids.length > 0) g.copies = g.network.simple_request( @@ -43,13 +43,13 @@ function my_init() { /* And other fleshed copies if any */ if (!g.copies) g.copies = []; - var c = xul_param('copies',{'concat':true,'JSON2js_if_cgi':true,'JSON2js_if_xpcom':true,'stash_name':'temp_copies','clear_xpcom':true,'modal_xulG':true}) + var c = xul_param('copies',{'concat':true,'JSON2js_if_cgi':true,'JSON2js_if_xpcom':true,'stash_name':'temp_copies','clear_xpcom':true}) if (c) g.copies = g.copies.concat(c); /******************************************************************************************************/ /* We try to retrieve callnumbers for existing copies, but for new copies, we rely on this */ - g.callnumbers = xul_param('callnumbers',{'concat':true,'JSON2js_if_cgi':true,'JSON2js_if_xpcom':true,'stash_name':'temp_callnumbers','clear_xpcom':true,'modal_xulG':true}); + g.callnumbers = xul_param('callnumbers',{'concat':true,'JSON2js_if_cgi':true,'JSON2js_if_xpcom':true,'stash_name':'temp_callnumbers','clear_xpcom':true}); /******************************************************************************************************/ /* Get preference (if it exists) for copy location label order */ @@ -71,7 +71,7 @@ function my_init() { /******************************************************************************************************/ /* Is the interface an editor or a viewer, single or multi copy, existing copies or new copies? */ - if (xul_param('edit',{'modal_xulG':true}) == '1') { + if (xul_param('edit') == '1') { g.edit = false; @@ -1465,7 +1465,6 @@ g.stash_and_close = function() { //g.data.temp_copies = js2JSON( g.copies ); //g.data.stash('temp_copies'); xulG.copies = g.copies; - update_modal_xulG(xulG); JSAN.use('util.widgets'); util.widgets.dispatch('close',window); } catch(E) { diff --git a/Open-ILS/xul/staff_client/server/cat/copy_notes.xul b/Open-ILS/xul/staff_client/server/cat/copy_notes.xul index fb633a7ab6..a71f436b40 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_notes.xul +++ b/Open-ILS/xul/staff_client/server/cat/copy_notes.xul @@ -53,7 +53,7 @@ g.error.sdump('D_TRACE','my_init() for copy_notes.xul'); - g.copy_id = xul_param('copy_id',{'modal_xulG':true}); + g.copy_id = xul_param('copy_id'); refresh(); diff --git a/Open-ILS/xul/staff_client/server/cat/marc_view.xul b/Open-ILS/xul/staff_client/server/cat/marc_view.xul index 7ad83433dc..90b42e8e35 100644 --- a/Open-ILS/xul/staff_client/server/cat/marc_view.xul +++ b/Open-ILS/xul/staff_client/server/cat/marc_view.xul @@ -47,16 +47,6 @@ vim:noet:sw=4:ts=4: var docid = xul_param('docid'); var noprint = xul_param('noprint'); - JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'}); - var key = location.pathname + location.search + location.hash; - if (!docid && typeof data.modal_xulG_stack != 'undefined' && typeof data.modal_xulG_stack[key] != 'undefined') { - var modal_xulG = data.modal_xulG_stack[key][ data.modal_xulG_stack[key].length - 1 ]; - if (typeof modal_xulG == 'object') { - docid = modal_xulG.docid; - if (modal_xulG.noprint) noprint = modal_xulG.noprint; - } - } - JSAN.use('util.network'); g.network = new util.network(); if (docid > -1) { diff --git a/Open-ILS/xul/staff_client/server/cat/record_buckets_quick.xul b/Open-ILS/xul/staff_client/server/cat/record_buckets_quick.xul index d2160dbdd3..72264b7284 100644 --- a/Open-ILS/xul/staff_client/server/cat/record_buckets_quick.xul +++ b/Open-ILS/xul/staff_client/server/cat/record_buckets_quick.xul @@ -46,7 +46,6 @@ g.record_ids = xul_param( 'record_ids',{ 'concat' : true, - 'modal_xulG' : true, 'JSON2js_if_cgi' : true, 'JSON2js_if_xpcom' : true, 'stash_name':'rb_temp_record_ids', diff --git a/Open-ILS/xul/staff_client/server/cat/volume_editor.js b/Open-ILS/xul/staff_client/server/cat/volume_editor.js index d520479214..48d8d55d23 100644 --- a/Open-ILS/xul/staff_client/server/cat/volume_editor.js +++ b/Open-ILS/xul/staff_client/server/cat/volume_editor.js @@ -20,7 +20,7 @@ function my_init() { JSAN.use('cat.util'); - g.volumes = xul_param('volumes',{'stash_name':'volumes_temp','clear_xpcom':true,'modal_xulG':true}); //JSON2js( g.data.volumes_temp ); + g.volumes = xul_param('volumes',{'stash_name':'volumes_temp','clear_xpcom':true}); //JSON2js( g.data.volumes_temp ); //g.data.volumes_temp = ''; g.data.stash('volumes_temp'); var rows = document.getElementById('rows'); @@ -123,7 +123,6 @@ g.stash_and_close = function() { xulG.volumes = g.volumes; xulG.update_these_volumes = 1; xulG.auto_merge = document.getElementById('auto_merge').checked; - update_modal_xulG(xulG); window.close(); } catch(E) { alert('FIXME: volume editor -> ' + E); diff --git a/Open-ILS/xul/staff_client/server/circ/backdate_post_checkin.js b/Open-ILS/xul/staff_client/server/circ/backdate_post_checkin.js index 46d306b789..a139a99ec2 100644 --- a/Open-ILS/xul/staff_client/server/circ/backdate_post_checkin.js +++ b/Open-ILS/xul/staff_client/server/circ/backdate_post_checkin.js @@ -34,7 +34,7 @@ function backdate_post_checkin_init() { $('checkin_effective_datepicker').value = util.date.formatted_date(new Date(),'%F'); var x = $('circ_brief_area'); - var circ_ids = xul_param('circ_ids',{'modal_xulG':true}); + var circ_ids = xul_param('circ_ids'); if (x) { var d = document.createElement('description'); var t = document.createTextNode( $('circStrings').getFormattedString('staff.circ.backdate.circ_ids.prompt',[circ_ids.length,circ_ids.join(',')]) ); @@ -111,13 +111,9 @@ function gen_handle_apply(circ_ids) { sound.circ_good(); } - update_modal_xulG( - { - 'backdate' : backdate, - 'bad_circs' : bad_circs, - 'complete' : 1 - } - ) + xulG['backdate'] = backdate; + xulG['bad_circs'] = bad_circs; + xulG['complete'] = 1; window.close(); } } diff --git a/Open-ILS/xul/staff_client/server/circ/circ_summary.xul b/Open-ILS/xul/staff_client/server/circ/circ_summary.xul index e39bfdefd5..9a98fb8760 100644 --- a/Open-ILS/xul/staff_client/server/circ/circ_summary.xul +++ b/Open-ILS/xul/staff_client/server/circ/circ_summary.xul @@ -48,7 +48,7 @@ JSAN.use('util.error'); g.error = new util.error(); g.error.sdump('D_TRACE','my_init() for circ_circ_brief.xul'); - g.copy_id = xul_param('copy_id',{'modal_xulG':true}); + g.copy_id = xul_param('copy_id'); JSAN.use('util.network'); g.network = new util.network(); JSAN.use('util.date'); @@ -106,7 +106,6 @@ //g.data.fancy_prompt_data = js2JSON( [ g.circs[0].usr() ] ); //g.data.stash('fancy_prompt_data'); xulG.retrieve_these_patrons = [ g.circs[0].usr() ]; - update_modal_xulG(xulG); window.close(); } catch(E) { g.error.standard_unexpected_error_alert('retrieve_last',E); @@ -125,7 +124,6 @@ //g.data.fancy_prompt_data = js2JSON(patrons); //g.data.stash('fancy_prompt_data'); xulG.retrieve_these_patrons = patrons; - update_modal_xulG(xulG); window.close(); } catch(E) { g.error.standard_unexpected_error_alert('retrieve_all',E); diff --git a/Open-ILS/xul/staff_client/server/circ/copy_details.xul b/Open-ILS/xul/staff_client/server/circ/copy_details.xul index 54627942de..aefcac94a9 100644 --- a/Open-ILS/xul/staff_client/server/circ/copy_details.xul +++ b/Open-ILS/xul/staff_client/server/circ/copy_details.xul @@ -48,7 +48,7 @@ JSAN.use('util.error'); g.error = new util.error(); g.error.sdump('D_TRACE','my_init() for circ_copy_details.xul'); - g.copy_id = xul_param('copy_id',{'modal_xulG':true}); + g.copy_id = xul_param('copy_id'); JSAN.use('util.network'); g.network = new util.network(); JSAN.use('util.date'); @@ -171,7 +171,6 @@ //g.data.fancy_prompt_data = js2JSON( [ g.circ.usr() ] ); //g.data.stash('fancy_prompt_data'); xulG.retrieve_these_patrons = [ g.circ.usr() ]; - update_modal_xulG(xulG); window.close(); } catch(E) { alert(E); @@ -183,7 +182,6 @@ //g.data.fancy_prompt_data = js2JSON( [ g.hold.usr() ] ); //g.data.stash('fancy_prompt_data'); xulG.retrieve_these_patrons = [ g.hold.usr() ]; - update_modal_xulG(xulG); window.close(); } catch(E) { alert(E); diff --git a/Open-ILS/xul/staff_client/server/main/simple_auth.xul b/Open-ILS/xul/staff_client/server/main/simple_auth.xul index 5dae0ac6af..e311333661 100644 --- a/Open-ILS/xul/staff_client/server/main/simple_auth.xul +++ b/Open-ILS/xul/staff_client/server/main/simple_auth.xul @@ -53,15 +53,15 @@ $('server').value = g.data.server_unadorned; - addCSSClass(document.documentElement,xul_param('login_type',{'modal_xulG':true})) + addCSSClass(document.documentElement,xul_param('login_type')) - if (xul_param('desc_brief',{'modal_xulG':true})) { + if (xul_param('desc_brief')) { $('desc').hidden = false; - $('desc_brief').appendChild( document.createTextNode( xul_param('desc_brief',{'modal_xulG':true}) ) ); + $('desc_brief').appendChild( document.createTextNode( xul_param('desc_brief') ) ); } - if (xul_param('desc_full',{'modal_xulG':true})) { + if (xul_param('desc_full')) { $('desc').hidden = false; - $('desc_full').appendChild( document.createTextNode( xul_param('desc_full',{'modal_xulG':true}) ) ); + $('desc_full').appendChild( document.createTextNode( xul_param('desc_full') ) ); } $('username').focus(); @@ -96,7 +96,7 @@ 'password_prompt' : $('password'), 'server_prompt' : $('server'), }, - xul_param('login_type',{'modal_xulG':true}) || 'temp' + xul_param('login_type') || 'temp' ); g.session.on_init = function() { try { @@ -108,10 +108,7 @@ 'usr' : js2JSON(staff) } g.data.stash('temporary_session'); - var my_xulG = { // new way, to minimize the use of global spaces - 'temporary_session' : g.data.temporary_session - }; - update_modal_xulG(my_xulG); + xulG.temporary_session = g.data.temporary_session; window.close(); } catch(E) { g.error.standard_unexpected_error_alert('simple_auth.session.on_init',E); diff --git a/Open-ILS/xul/staff_client/server/patron/bill_cc_info.xul b/Open-ILS/xul/staff_client/server/patron/bill_cc_info.xul index 11297bb011..36337450e2 100644 --- a/Open-ILS/xul/staff_client/server/patron/bill_cc_info.xul +++ b/Open-ILS/xul/staff_client/server/patron/bill_cc_info.xul @@ -108,7 +108,7 @@ try { patron = g.network.simple_request( 'FM_AU_FLESHED_RETRIEVE_VIA_ID', - [ses(), xul_param('patron_id', {'modal_xulG': true})] + [ses(), xul_param('patron_id')] ); } catch (e) { alert ("Patron retrieval failed"); diff --git a/Open-ILS/xul/staff_client/server/patron/bill_wizard.js b/Open-ILS/xul/staff_client/server/patron/bill_wizard.js index b355845b28..1dc31471c3 100644 --- a/Open-ILS/xul/staff_client/server/patron/bill_wizard.js +++ b/Open-ILS/xul/staff_client/server/patron/bill_wizard.js @@ -76,8 +76,8 @@ function retrieve_circ() { function retrieve_patron() { JSAN.use('patron.util'); - g.patron_id = xul_param('patron_id',{'modal_xulG':true}); - g.au_obj = xul_param('patron',{'modal_xulG':true}); + g.patron_id = xul_param('patron_id'); + g.au_obj = xul_param('patron'); if (! g.au_obj) { g.au_obj = patron.util.retrieve_fleshed_au_via_id( ses(), g.patron_id ); @@ -105,7 +105,7 @@ function patron_bill_init() { JSAN.use('util.money'); JSAN.use('util.widgets'); JSAN.use('util.functional'); - var override_default_billing_type = xul_param('override_default_billing_type',{'modal_xulG':true}); + var override_default_billing_type = xul_param('override_default_billing_type'); var billing_list = util.functional.filter_list( g.OpenILS.data.list.cbt, function (x) { return x.id() >= 100 || x.id() == override_default_billing_type } ); var ml = util.widgets.make_menulist( util.functional.map_list( @@ -133,15 +133,15 @@ function patron_bill_init() { if ( g.OpenILS.data.hash.cbt[ ml.value ] ) { $('bill_amount').value = g.OpenILS.data.hash.cbt[ ml.value ].default_price(); } - var override_default_price = xul_param('override_default_price',{'modal_xulG':true}); + var override_default_price = xul_param('override_default_price'); if (override_default_price) { $('bill_amount').value = override_default_price; } $('bill_amount').select(); $('bill_amount').focus(); - g.circ = xul_param('circ',{'modal_xulG':true}); - if (xul_param('xact_id',{'modal_xulG':true})) { - g.mbts_id = xul_param('xact_id',{'modal_xulG':true}); + g.circ = xul_param('circ'); + if (xul_param('xact_id')) { + g.mbts_id = xul_param('xact_id'); $('summary').hidden = false; retrieve_mbts(); retrieve_circ(); @@ -157,19 +157,15 @@ function patron_bill_init() { function patron_bill_finish() { try { - var do_not_process_bill = xul_param('do_not_process_bill',{'modal_xulG':true}); - var xact_id = xul_param('xact_id',{'modal_xulG':true}); + var do_not_process_bill = xul_param('do_not_process_bill'); + var xact_id = xul_param('xact_id'); if (do_not_process_bill) { - update_modal_xulG( - { - 'proceed' : true, - 'cbt_id' : $('billing_type').value, - 'amount' : $('bill_amount').value, - 'note' : $('bill_note').value - } - ); + xulG.proceed = true; + xulG.cbt_id = $('billing_type').value; + xulG.amount = $('bill_amount').value; + xulG.note = $('bill_note').value; } else { @@ -202,12 +198,8 @@ function patron_bill_finish() { if (typeof mb_id.ilsevent != 'undefined') throw(mb_id); //alert($('patronStrings').getString('staff.patron.bill_wizard.patron_bill_finish.billing_added')); - update_modal_xulG( - { - mb_id : mb_id, - xact_id : xact_id - } - ); + xulG.mb_id = mb_id; + xulG.xact_id = xact_id; } else { throw(xact_id); diff --git a/Open-ILS/xul/staff_client/server/patron/edit_standing_penalty.js b/Open-ILS/xul/staff_client/server/patron/edit_standing_penalty.js index 8aad0331ab..b2d60fdb64 100644 --- a/Open-ILS/xul/staff_client/server/patron/edit_standing_penalty.js +++ b/Open-ILS/xul/staff_client/server/patron/edit_standing_penalty.js @@ -30,16 +30,16 @@ function edit_penalty_init() { } /* set widget values */ - document.getElementById('note_tb').value = xul_param('note',{'modal_xulG':true}); - document.getElementById('csp_menupopup').setAttribute('value',xul_param('id',{'modal_xulG':true})); - if (xul_param('id',{'modal_xulG':true})==21) { // SILENT_NOTE + document.getElementById('note_tb').value = xul_param('note'); + document.getElementById('csp_menupopup').setAttribute('value',xul_param('id')); + if (xul_param('id')==21) { // SILENT_NOTE document.getElementById('note_btn').checked = true; - } else if (xul_param('id',{'modal_xulG':true})==20) { // ALERT_NOTE + } else if (xul_param('id')==20) { // ALERT_NOTE document.getElementById('alert_btn').checked = true; - } else if (xul_param('id',{'modal_xulG':true})==25) { // STAFF_CHR + } else if (xul_param('id')==25) { // STAFF_CHR document.getElementById('block_btn').checked = true; } else { - var nl = document.getElementById('csp_menupopup').getElementsByAttribute('value',xul_param('id',{'modal_xulG':true})); + var nl = document.getElementById('csp_menupopup').getElementsByAttribute('value',xul_param('id')); if (nl.length > 0) { document.getElementById('csp_menulist').setAttribute('label', nl[0].getAttribute('label')); } else { @@ -97,13 +97,9 @@ function edit_penalty_init() { note = note + commonStrings.getFormattedString('staff.initials.format',[initials_tb.value,util.date.formatted_date(new Date(),'%F'), ses('ws_ou_shortname')]); } } - update_modal_xulG( - { - 'id' : document.getElementById('csp_menupopup').getAttribute('value'), - 'note' : note, - 'modify' : 1 - } - ) + xulG.id = document.getElementById('csp_menupopup').getAttribute('value'); + xulG.note = note; + xulG.modify = 1; window.close(); }, false diff --git a/Open-ILS/xul/staff_client/server/patron/hold_cancel.js b/Open-ILS/xul/staff_client/server/patron/hold_cancel.js index 9bef546223..4adbcc1855 100644 --- a/Open-ILS/xul/staff_client/server/patron/hold_cancel.js +++ b/Open-ILS/xul/staff_client/server/patron/hold_cancel.js @@ -32,13 +32,9 @@ function hold_cancel_init() { 'command', function() { var note = document.getElementById('note_tb').value; - update_modal_xulG( - { - 'cancel_reason' : document.getElementById('ahrcc_menupopup').getAttribute('value'), - 'note' : note, - 'proceed' : 1 - } - ) + xulG.cancel_reason = document.getElementById('ahrcc_menupopup').getAttribute('value'); + xulG.note = note; + xulG.proceed = 1; window.close(); }, false diff --git a/Open-ILS/xul/staff_client/server/patron/new_standing_penalty.js b/Open-ILS/xul/staff_client/server/patron/new_standing_penalty.js index fd9d0646ad..ddfd645c84 100644 --- a/Open-ILS/xul/staff_client/server/patron/new_standing_penalty.js +++ b/Open-ILS/xul/staff_client/server/patron/new_standing_penalty.js @@ -79,13 +79,9 @@ function new_penalty_init() { note = note + commonStrings.getFormattedString('staff.initials.format',[initials_tb.value,util.date.formatted_date(new Date(),'%F'), ses('ws_ou_shortname')]); } } - update_modal_xulG( - { - 'id' : document.getElementById('csp_menupopup').getAttribute('value'), - 'note' : note, - 'modify' : 1 - } - ) + xulG.id = document.getElementById('csp_menupopup').getAttribute('value'); + xulG.note = note; + xulG.modify = 1; window.close(); }, false diff --git a/Open-ILS/xul/staff_client/server/serial/editor_base.js b/Open-ILS/xul/staff_client/server/serial/editor_base.js index 91f84aebb8..6da04b0164 100644 --- a/Open-ILS/xul/staff_client/server/serial/editor_base.js +++ b/Open-ILS/xul/staff_client/server/serial/editor_base.js @@ -27,10 +27,10 @@ serial.editor_base = { /******************************************************************************************************/ /* base vars */ - obj.docid = xul_param('docid',{'modal_xulG':true}); + obj.docid = xul_param('docid'); if (typeof params.handle_update == 'undefined') { - obj.handle_update = xul_param('handle_update',{'modal_xulG':true}); + obj.handle_update = xul_param('handle_update'); } else { obj.handle_update = params.handle_update; } @@ -54,7 +54,7 @@ serial.editor_base = { /* Get the fm_type ids from various sources and flesh them */ var fm_type_ids = params[fm_type + '_ids']; - if (!fm_type_ids) fm_type_ids = xul_param(fm_type + '_ids',{'concat':true,'JSON2js_if_cgi':true,'JSON2js_if_xulG':true,'JSON2js_if_xpcom':true,'stash_name':'temp_' + fm_type + '_ids','clear_xpcom':true,'modal_xulG':true}); + if (!fm_type_ids) fm_type_ids = xul_param(fm_type + '_ids',{'concat':true,'JSON2js_if_cgi':true,'JSON2js_if_xulG':true,'JSON2js_if_xpcom':true,'stash_name':'temp_' + fm_type + '_ids','clear_xpcom':true}); if (!fm_type_ids) fm_type_ids = []; obj[fm_type_plural] = []; @@ -70,7 +70,7 @@ serial.editor_base = { if (!obj[fm_type_plural]) obj[fm_type_plural] = []; var fms = params[fm_type_plural]; - if (!fms) fms = xul_param(fm_type_plural,{'concat':true,'JSON2js_if_cgi':true,'JSON2js_if_xpcom':true,'stash_name':'temp_' + fm_type_plural,'clear_xpcom':true,'modal_xulG':true}) + if (!fms) fms = xul_param(fm_type_plural,{'concat':true,'JSON2js_if_cgi':true,'JSON2js_if_xpcom':true,'stash_name':'temp_' + fm_type_plural,'clear_xpcom':true}) if (fms) obj[fm_type_plural] = obj[fm_type_plural].concat(fms); @@ -90,7 +90,7 @@ serial.editor_base = { var do_edit; if (typeof params.do_edit == 'undefined') { - do_edit = xul_param('do_edit',{'modal_xulG':true}); + do_edit = xul_param('do_edit'); } else { do_edit = params.do_edit; } @@ -185,7 +185,7 @@ serial.editor_base = { /* Show the Record Details? (only for 'in_modal' mode)*/ var bdb; - if (xul_param('in_modal',{'modal_xulG':true}) && obj.docid) { + if (xul_param('in_modal') && obj.docid) { bdb = document.getElementById('brief_display_box'); while(bdb.firstChild) bdb.removeChild(bdb.lastChild); var brief_display = document.createElement('iframe'); bdb.appendChild(brief_display); brief_display.setAttribute( 'src', urls.XUL_BIB_BRIEF + '?docid=' + obj.docid); // this is a modal window, so can't push in xulG @@ -580,18 +580,17 @@ serial.editor_base = { } catch(E) { alert($('serialStrings').getString('staff.serial.editor_base.handle_update.error') + ' ' + js2JSON(E)); } - } else if (xul_param('in_modal',{'modal_xulG':true})) { + } else if (xul_param('in_modal')) { // TODO: this is to perhaps allow this editor to be called // in a modal window, but is unfinished functionality var xulG = {}; xulG[fm_type_plural] = obj[fm_type_plural]; - update_modal_xulG(xulG); } else { obj.data['temp_' + fm_type_plural] = js2JSON( obj[fm_type_plural] ); obj.data.stash('temp_' + fm_type_plural); } - if (xul_param('in_modal',{'modal_xulG':true})) { + if (xul_param('in_modal')) { window.close(); } } catch(E) { diff --git a/Open-ILS/xul/staff_client/server/serial/notes.xul b/Open-ILS/xul/staff_client/server/serial/notes.xul index ede54b9663..4e2d9606a5 100644 --- a/Open-ILS/xul/staff_client/server/serial/notes.xul +++ b/Open-ILS/xul/staff_client/server/serial/notes.xul @@ -52,10 +52,10 @@ g.error.sdump('D_TRACE','my_init() for notes.xul'); - g.object_type = xul_param('object_type',{'modal_xulG':true}); - g.object_id = xul_param('object_id',{'modal_xulG':true}); - g.function_type = xul_param('function_type',{'modal_xulG':true}); - g.constructor = xul_param('constructor',{'modal_xulG':true}); + g.object_type = xul_param('object_type'); + g.object_id = xul_param('object_id'); + g.function_type = xul_param('function_type'); + g.constructor = xul_param('constructor'); var window_title = xul_param('title',{'modal_xulG':true}); if (window_title) { diff --git a/Open-ILS/xul/staff_client/server/serial/select_aou.xul b/Open-ILS/xul/staff_client/server/serial/select_aou.xul index c6f24f3913..4026ae5c27 100644 --- a/Open-ILS/xul/staff_client/server/serial/select_aou.xul +++ b/Open-ILS/xul/staff_client/server/serial/select_aou.xul @@ -47,7 +47,7 @@ var file; var list_data; var ml; file = new util.file('offline_ou_list'); - var server_unadorned = xul_param('server_unadorned',{'modal_xulG':true}); + var server_unadorned = xul_param('server_unadorned'); if (file._file.exists()) { list_data = file.get_object(); file.close(); ml = util.widgets.make_menulist( list_data[0], list_data[1] ); @@ -76,7 +76,7 @@ } g.select_aou = function() { - update_modal_xulG({'create_mfhd_aou' : $('lib_menu').value}); + xulG.create_mfhd_aou = $('lib_menu').value; window.close(); } diff --git a/Open-ILS/xul/staff_client/server/serial/select_unit.xul b/Open-ILS/xul/staff_client/server/serial/select_unit.xul index ad513c916d..3d0cbdc722 100644 --- a/Open-ILS/xul/staff_client/server/serial/select_unit.xul +++ b/Open-ILS/xul/staff_client/server/serial/select_unit.xul @@ -45,7 +45,7 @@ var ml; JSAN.use('util.network'); g.network = new util.network(); - var sdist_ids = xul_param('sdist_ids',{'modal_xulG':true}); + var sdist_ids = xul_param('sdist_ids'); //TODO: unit_list.retrieve option for binding units only (that is, units containing bound items only) var robj = g.network.request( 'open-ils.serial', @@ -65,7 +65,7 @@ g.select_unit = function() { var selection = JSON2js($('unit_menu').value); selection.label = $('unit_menu').selectedItem.label; - update_modal_xulG({'sunit_selection' : selection}); + xulG.sunit_selection = selection; window.close(); } -- 2.43.2