+ 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() {
}
}
- 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 {
}
}
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');
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();
$('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();
'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 {
'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);
<?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
<window id="fancy_prompt_win"
- onload="try { my_init(); font_helper(); persist_helper( xul_param('title',{'modal_xulG':true}) ); } catch(E) { alert(E); }"
+ onload="try { my_init(); font_helper(); persist_helper( xul_param('title') ); } catch(E) { alert(E); }"
oils_persist="width height"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script>
<![CDATA[
- var xulG = {};
-
function my_init() {
try {
if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
JSAN.use('util.error'); g.error = new util.error();
g.error.sdump('D_TRACE','my_init() for fancy_prompt.xul');
- //JSAN.use('OpenILS.data'); g.data = new OpenILS.data(); g.data.init({'via':'stash'});
- //g.data.fancy_prompt_data = ''; g.data.stash('fancy_prompt_data');
- //g.data.fancy_prompt_data = {};
-
- //var key = location.pathname + location.search + location.hash;
- //if (typeof g.data.modal_xulG_stack != 'undefined' && typeof g.data.modal_xulG_stack[key] != 'undefined') {
- // xulG = g.data.modal_xulG_stack[key][ g.data.modal_xulG_stack[key].length - 1 ];
- //}
-
- var top_xml = xul_param('top_xml',{'stash_name':xul_param('top_xml_in_stash',{'modal_xulG':true}),'modal_xulG':true});
+ var top_xml = xul_param('top_xml',{'stash_name':xul_param('top_xml_in_stash')});
if (top_xml) {
var parser = new DOMParser();
var doc = parser.parseFromString( top_xml, 'text/xml' );
if (node) document.getElementById('fancy_prompt_topbar').appendChild(node);
}
- var my_xml = xul_param('xml',{'stash_name':xul_param('xml_in_stash',{'modal_xulG':true}),'modal_xulG':true});
+ var my_xml = xul_param('xml',{'stash_name':xul_param('xml_in_stash')});
if (my_xml) {
var parser = new DOMParser();
var doc = parser.parseFromString( my_xml, 'text/xml' );
if (node) document.getElementById('fancy_prompt_main').appendChild(node);
}
- var bot_xml = xul_param('bottom_xml',{'stash_name':xul_param('bottom_xml_in_stash',{'modal_xulG':true}),'modal_xulG':true});;
+ var bot_xml = xul_param('bottom_xml',{'stash_name':xul_param('bottom_xml_in_stash')});;
if (bot_xml) {
var parser = new DOMParser();
var doc = parser.parseFromString( bot_xml, 'text/xml' );
nl[i].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) {}
}
- if (xul_param('focus',{'modal_xulG':true})) {
- var focus_element = document.getElementById(xul_param('focus',{'modal_xulG':true}));
+ if (xul_param('focus')) {
+ var focus_element = document.getElementById(xul_param('focus'));
if (focus_element) focus_element.focus();
}
- var snd = xul_param('sound',{'modal_xulG':true});
- var snd_obj = xul_param('sound_object',{'modal_xulG':true});
+ var snd = xul_param('sound');
+ var snd_obj = xul_param('sound_object');
if (snd) {
try {
var params = { 'sig' : 'fancy_prompt_my_init' };
}
}
- JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
xulG.fancy_status = 'incomplete';
- var key = location.pathname + location.search + location.hash;
- data.modal_xulG_stack[key][ data.modal_xulG_stack[key].length - 1 ] = xulG;
- data.stash('modal_xulG_stack');
} catch(E) {
var err_msg = "!! This software has encountered an error. Please tell your friendly " +
xulG[ nl[i].id ] = nl[i].nodeName == 'checkbox' ? nl[i].checked : nl[i].value;
}
xulG.fancy_status = 'complete';
- var key = location.pathname + location.search + location.hash;
- data.modal_xulG_stack[key][ data.modal_xulG_stack[key].length - 1 ] = xulG;
- data.stash('modal_xulG_stack');
window.close();
} catch(E) {
print_url += '<script src="' + this.data.hash.aous['print.custom_js_file'] + '"></script>';
}
print_url += '</head><body onload="try{print_init(\'' + params.type + '\');}catch(E){alert(E);}">' + window.escape(msg.replace(/<script[^>]*>.*?<\/script>/gi,'')) + '</body></html>';
- 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) {
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(
}
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 };
if (!params) { params = {}; }
if (params.remove) {
- update_modal_xulG(
- {
- 'timestamp' : null,
- 'complete' : 1
- }
- )
+ xulG.timestamp = null;
+ xulG.complete = 1;
window.close();
} else {
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();
}
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 ) );
}
$('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) {}
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;
}
xulG[ 'status' ] = 'complete';
- update_modal_xulG(xulG);
-
window.close();
} catch(E) {
alert('Error in widget_prompt.js, widget_save(): ' + E);
<?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
<window id="widget_prompt_win"
- onload="try { my_init(); font_helper(); persist_helper( xul_param('title',{'modal_xulG':true}) ); } catch(E) { alert(E); }"
+ onload="try { my_init(); font_helper(); persist_helper( xul_param('title') ); } catch(E) { alert(E); }"
oils_persist="width height"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
// From: Bryan White on netscape.public.mozilla.xpfe, Oct 13, 2004
// Message-ID: <ckjh7a$18q1@ripley.netscape.com>
// 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;
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);
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) {
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)) {
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');
$('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(
/* 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 */
/******************************************************************************************************/
/* 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;
//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) {
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();
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) {
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',
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');
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);
$('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(',')]) );
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();
}
}
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');
//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);
//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);
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');
//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);
//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);
$('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();
'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 {
'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);
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");
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 );
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(
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();
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 {
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);
}
/* 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 {
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
'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
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
/******************************************************************************************************/
/* 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;
}
/* 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] = [];
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);
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;
}
/* 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
} 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) {
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) {
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] );
}
g.select_aou = function() {
- update_modal_xulG({'create_mfhd_aou' : $('lib_menu').value});
+ xulG.create_mfhd_aou = $('lib_menu').value;
window.close();
}
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',
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();
}