From e2a0d335f68e12c70bb1461d514f01aac2f90573 Mon Sep 17 00:00:00 2001 From: pines Date: Tue, 15 May 2007 13:06:45 +0000 Subject: [PATCH] revert back to rel_1_0_5_2, which is before all the cacheable/observer stuff git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_0@7310 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Evergreen/xul/staff_client/server/patron/ue.js | 22 +- .../xul/staff_client/server/patron/ue_config.js | 7 +- .../staff_client/chrome/content/OpenILS/data.js | 93 --------- .../chrome/content/OpenILS/global_util.js | 114 ----------- .../staff_client/chrome/content/main/constants.js | 14 +- .../chrome/content/main/simple_auth.xul | 35 ++-- .../staff_client/chrome/content/util/browser.xul | 24 ++- .../xul/staff_client/chrome/content/util/error.js | 38 ++-- .../chrome/content/util/fancy_prompt.xul | 61 ++---- .../staff_client/chrome/content/util/network.js | 228 ++++++--------------- .../staff_client/chrome/content/util/rbrowser.xul | 24 ++- .../xul/staff_client/chrome/content/util/window.js | 33 +-- .../staff_client/server/admin/hold_pull_list.xul | 10 +- .../server/admin/offline_manage_xacts.js | 33 +-- .../server/admin/offline_manage_xacts.xul | 2 + .../staff_client/server/admin/printer_settings.js | 2 +- .../xul/staff_client/server/admin/upload_xacts.js | 14 +- .../staff_client/server/admin/upload_xacts.xhtml | 1 - Open-ILS/xul/staff_client/server/cat/bib_brief.xul | 30 +-- .../xul/staff_client/server/cat/copy_browser.js | 49 +++-- .../xul/staff_client/server/cat/copy_browser.xul | 4 +- .../xul/staff_client/server/cat/copy_buckets.js | 16 +- .../xul/staff_client/server/cat/copy_buckets.xul | 18 +- .../staff_client/server/cat/copy_buckets_quick.xul | 18 +- .../xul/staff_client/server/cat/copy_editor.js | 78 ++++--- .../xul/staff_client/server/cat/copy_notes.xul | 31 ++- .../xul/staff_client/server/cat/copy_summary.xul | 13 +- Open-ILS/xul/staff_client/server/cat/marc_new.xul | 2 +- Open-ILS/xul/staff_client/server/cat/marc_view.xul | 16 +- Open-ILS/xul/staff_client/server/cat/opac.xul | 115 +++++------ .../xul/staff_client/server/cat/record_buckets.js | 26 +-- .../xul/staff_client/server/cat/record_buckets.xul | 19 +- .../server/cat/record_buckets_quick.xul | 18 +- .../xul/staff_client/server/cat/spine_labels.js | 32 ++- Open-ILS/xul/staff_client/server/cat/util.js | 50 +++-- .../staff_client/server/cat/volume_copy_creator.js | 47 +++-- .../xul/staff_client/server/cat/volume_editor.xul | 24 +-- Open-ILS/xul/staff_client/server/cat/z3950.js | 26 ++- Open-ILS/xul/staff_client/server/cat/z3950.xul | 2 + Open-ILS/xul/staff_client/server/circ/checkin.xul | 4 +- Open-ILS/xul/staff_client/server/circ/checkout.js | 2 +- Open-ILS/xul/staff_client/server/circ/checkout.xul | 9 +- .../xul/staff_client/server/circ/circ_brief.xul | 16 +- .../xul/staff_client/server/circ/circ_summary.xul | 52 ++--- .../xul/staff_client/server/circ/copy_details.xul | 28 +-- .../xul/staff_client/server/circ/copy_status.js | 63 +++--- .../xul/staff_client/server/circ/copy_status.xul | 19 +- .../xul/staff_client/server/circ/hold_capture.xul | 2 + .../xul/staff_client/server/circ/in_house_use.xul | 2 + .../server/circ/print_list_template_editor.xul | 2 + Open-ILS/xul/staff_client/server/circ/util.js | 39 ++-- Open-ILS/xul/staff_client/server/main/data.xul | 150 +------------- .../server/patron/adv_barcode_entry.xul | 6 +- .../staff_client/server/patron/barcode_entry.xul | 6 +- .../staff_client/server/patron/bill_details.xul | 10 +- .../staff_client/server/patron/bill_history.xul | 45 ++-- .../xul/staff_client/server/patron/bill_wizard.xul | 10 +- Open-ILS/xul/staff_client/server/patron/bills.js | 90 ++++---- Open-ILS/xul/staff_client/server/patron/bills.xul | 4 +- Open-ILS/xul/staff_client/server/patron/display.js | 181 ++++++++-------- .../xul/staff_client/server/patron/display.xul | 18 +- .../staff_client/server/patron/hold_notices.xul | 31 ++- Open-ILS/xul/staff_client/server/patron/holds.js | 104 +++++----- Open-ILS/xul/staff_client/server/patron/holds.xul | 10 +- Open-ILS/xul/staff_client/server/patron/info.xul | 40 ++-- .../xul/staff_client/server/patron/info_group.xul | 79 ++++--- .../xul/staff_client/server/patron/info_notes.xul | 43 ++-- .../staff_client/server/patron/info_stat_cats.xul | 3 +- .../staff_client/server/patron/info_surveys.xul | 3 +- Open-ILS/xul/staff_client/server/patron/items.js | 14 +- Open-ILS/xul/staff_client/server/patron/items.xul | 4 +- .../staff_client/server/patron/search_result.xul | 5 - Open-ILS/xul/staff_client/server/patron/summary.js | 25 +-- .../xul/staff_client/server/patron/summary.xul | 10 +- Open-ILS/xul/staff_client/server/patron/ue.js | 22 +- .../xul/staff_client/server/patron/ue_config.js | 7 +- .../xul/staff_client/server/patron/user_edit.js | 17 +- .../xul/staff_client/server/patron/user_editor.js | 3 +- Open-ILS/xul/staff_client/server/patron/util.js | 25 +-- 79 files changed, 948 insertions(+), 1644 deletions(-) diff --git a/Evergreen/xul/staff_client/server/patron/ue.js b/Evergreen/xul/staff_client/server/patron/ue.js index 4aef839946..9e77d696f2 100644 --- a/Evergreen/xul/staff_client/server/patron/ue.js +++ b/Evergreen/xul/staff_client/server/patron/ue.js @@ -19,12 +19,8 @@ function uEditInit() { _debug('uEditInit(): ' + location.search); cgi = new CGI(); - session = cgi.param('ses'); - if (xulG) if (xulG.ses) session = xulG.ses; - if (xulG) if (xulG.params) if (xulG.params.ses) session = xulG.params.ses; - clone = cgi.param('clone'); - if (xulG) if (xulG.clone) clone = xulG.clone; - if (xulG) if (xulG.params) if (xulG.params.clone) clone = xulG.params.clone; + session = cgi.param('ses'); + clone = cgi.param('clone'); if(!session) throw "User session is not defined"; fetchUser(session); @@ -96,10 +92,7 @@ function uEditBuild() { fetchHighestPermOrgs( SESSION, USER.id(), myPerms ); uEditBuildLibSelector(); - var usr = cgi.param('usr'); - if (xulG) if (xulG.usr) usr = xulG.usr; - if (xulG) if (xulG.params) if (xulG.params.usr) usr = xulG.params.usr; - patron = fetchFleshedUser(usr); + patron = fetchFleshedUser(cgi.param('usr')); if(!patron) patron = uEditNewPatron(); uEditDraw( @@ -542,10 +535,7 @@ function uEditSaveUser(cloneme) { !patron.isnew() ) { _debug("xulG clone spawning new interface..."); - var ses = cgi.param('ses'); - if (xulG) if (xulG.ses) ses = xulG.ses; - if (xulG) if (xulG.params) if (xulG.params.ses) ses = xulG.params.ses; - window.xulG.spawn_editor({ses:ses,clone:cloneme}); + window.xulG.spawn_editor({ses:cgi.param('ses'),clone:cloneme}); uEditRefresh(); } else { @@ -582,9 +572,7 @@ function uEditCancel() { var href = location.href; href = href.replace(/\&?usr=\d+/, ''); href = href.replace(/\&?clone=\d+/, ''); - var id = cgi.param('usr'); - if (xulG) if (xulG.usr) id = xulG.usr; - if (xulG) if (xulG.params) if (xulG.params.usr) id = xulG.params.usr; + var id = cgi.param('usr') /* reload the current user if available */ if( id ) href += "&usr=" + id; location.href = href; diff --git a/Evergreen/xul/staff_client/server/patron/ue_config.js b/Evergreen/xul/staff_client/server/patron/ue_config.js index 2b3741c27f..4d0c647713 100644 --- a/Evergreen/xul/staff_client/server/patron/ue_config.js +++ b/Evergreen/xul/staff_client/server/patron/ue_config.js @@ -998,12 +998,9 @@ function uEditCheckSharedAddr(patron, address, tbody, row) { hideMe($n(row, 'owner_link_div')); } else { - - var ses = cgi.param('ses'); - if (xulG) if (xulG.ses) ses = xulG.ses; - if (xulG) if (xulG.params) if (xulG.params.ses) ses = xulG.params.ses; + link.onclick = - function() { window.xulG.spawn_editor({ses:ses,usr:id}) }; + function() { window.xulG.spawn_editor({ses:cgi.param('ses'),usr:id}) }; if( userCache[id] ) { var usr = userCache[id]; diff --git a/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js b/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js index 3685ce0412..2b6c7ca2dd 100644 --- a/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js +++ b/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js @@ -14,7 +14,6 @@ OpenILS.data.prototype = { 'list' : {}, 'hash' : {}, 'tree' : {}, - 'cached_request' : {}, 'temp' : '', @@ -46,98 +45,6 @@ OpenILS.data.prototype = { }, - // This should be invoked only once per application, in a persistant window - 'init_observer_functions' : function() { - try { - var obj = this; // OpenILS.data - obj.observers = {}; // - obj.observers.id = 1; // Unique id for each observer function added - obj.observers.id2path = {}; // Lookup for full_path via observer id - obj.observers.cache = {}; // Observer funcs go in here - - // For a given path, this executes all the registered observer funcs - obj.observers.dispatch = function(full_path, old_value, new_value) { - obj.error.sdump('D_OBSERVERS', 'entering observers.dispatch\nfull_path = ' + full_path + '\nold_value = ' + js2JSON(old_value) + '\nnew_value = ' + js2JSON(new_value) + '\n'); - try { - var path = full_path.split(/\./).pop(); - for (var i in obj.observers.cache[full_path]) { - try { - var o = obj.observers.cache[full_path][i]; - if (typeof o.func == 'function') o.func(path, old_value, new_value); - } catch(E) { - obj.error.sdump('D_ERROR','Error in OpenILS.data.observers.dispatch(): ' + js2JSON(E) ); - } - } - } catch(E) { - obj.error.sdump('D_ERROR','Error in OpenILS.data.observers.dispatch(): ' + js2JSON(E) ); - } - } - - // This registers an observer function for a given path - obj.observers.add = function(full_path, func) { - try { - obj.error.sdump('D_OBSERVERS', 'entering observers.add\nfull_path = ' + full_path + '\nfunc = ' + func + '\n'); - netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - const OpenILS=new Components.Constructor("@mozilla.org/openils_data_cache;1", "nsIOpenILS"); - var data_cache=new OpenILS( ); - var stash = data_cache.wrappedJSObject.OpenILS.prototype.data; - - var id = obj.observers.id++; - if (typeof obj.observers.cache[ full_path ] == 'undefined') obj.observers.cache[ full_path ] = {}; - obj.observers.cache[ full_path ][ id ] = { 'func' : func, 'time_added' : new Date() }; - obj.observers.id2path[ id ] = [ full_path ]; - - var path_list = full_path.split(/\./); - var observed_prop = path_list.pop(); - - // Convert soft path to object reference. Error if any but the last node is undefined - for (var i in path_list) stash = stash[ path_list[i] ]; - stash.watch( - observed_prop, - function(p,old_value,new_value) { - obj.observers.dispatch(full_path,old_value,new_value); - return new_value; - } - ); - - return id; - } catch(E) { - obj.error.sdump('D_ERROR','Error in OpenILS.data.observers.add(): ' + js2JSON(E) ); - } - } - - // This unregisters an observer function for a given observer id - obj.observers.remove = function(id) { - try { - obj.error.sdump('D_OBSERVERS', 'entering observers.remove\nid = ' + id + '\n'); - var path = obj.observers.id2path[ id ]; - delete obj.observers.cache[ path ][ id ]; - delete obj.observers.id2path[ id ]; - } catch(E) { - obj.error.sdump('D_ERROR','Error in OpenILS.data.observers.remove(): ' + js2JSON(E) ); - } - } - - // This purges observer functions for a given path - obj.observers.purge = function(full_path) { - obj.error.sdump('D_OBSERVERS', 'entering observers.purge\nfull_path = ' + full_path + '\n'); - try { - var remove_these = []; - for (var id in obj.observers.cache[ full_path ]) remove_these.push( id ); - for (var id in remove_these) delete obj.observers.id2path[ id ]; - delete obj.observers.cache[ full_path ]; - } catch(E) { - obj.error.sdump('D_ERROR','Error in OpenILS.data.observers.purge(): ' + js2JSON(E) ); - } - } - - obj.stash('observers'); // make this accessible globally - - } catch(E) { - this.error.sdump('D_ERROR','Error in OpenILS.data.init_observer_functions(): ' + js2JSON(E) ); - } - }, - 'stash' : function () { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 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 9fc4d8c755..ae380521ba 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 @@ -29,120 +29,6 @@ } } - function get_contentWindow(frame) { - netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); - if (frame && frame.contentWindow) { - if (typeof frame.contentWindow.wrappedJSObject != 'undefined') return frame.contentWindow.wrappedJSObject; - return frame.contentWindow; - } else { - return null; - } - } - - function update_modal_xulG(v) { - try { - 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 { - dump('xul_param('+param_name+','+js2JSON(_params)+')\n'); - var value = undefined; if (!_params) _params = {}; - if (typeof _params.no_cgi == 'undefined') { - var cgi = new CGI(); - if (cgi.param(param_name)) { - var x = cgi.param(param_name); - dump('\tfound via location.href = ' + x + '\n'); - if (typeof _params.JSON2js_if_cgi != 'undefined') { - x = JSON2js( x ); - dump('\tJSON2js = ' + x + '\n'); - } - if (typeof _params.concat == 'undefined') { - //alert(param_name + ' x = ' + x); - return x; // value - } else { - if (value) { - if (value.constructor != Array) value = [ value ]; - value = value.concat(x); - } else { - value = x; - } - } - } - } - if (typeof _params.no_xulG == 'undefined') { - if (typeof _params.modal_xulG != 'undefined') { - 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'); - if (typeof _params.JSON2js_if_xulG != 'undefined') { - x = JSON2js( x ); - dump('\tJSON2js = ' + x + '\n'); - } - if (typeof _params.concat == 'undefined') { - //alert(param_name + ' x = ' + x); - return x; // value - } else { - if (value) { - if (value.constructor != Array) value = [ value ]; - value = value.concat(x); - } else { - value = x; - } - } - } - } - if (typeof _params.no_xpcom == 'undefined') { - /* the field names used for temp variables in the global stash tend to be more unique than xuLG or CGI param names, to avoid collisions */ - if (typeof _params.stash_name != 'undefined') { - JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'}); - if (typeof data[ _params.stash_name ] != 'undefined') { - var x = data[ _params.stash_name ]; - dump('\tfound via xpcom = ' + x + '\n'); - if (typeof _params.JSON2js_if_xpcom != 'undefined') { - x = JSON2js( x ); - dump('\tJSON2js = ' + x + '\n'); - } - if (_params.clear_xpcom) { - data[ _params.stash_name ] = undefined; data.stash( _params.stash_name ); - } - if (typeof _params.concat == 'undefined') { - //alert(param_name + ' x = ' + x); - return x; // value - } else { - if (value) { - if (value.constructor != Array) value = [ value ]; - value = value.concat(x); - } else { - value = x; - } - } - } - } - } - //alert(param_name + ' value = ' + value); - return value; - } catch(E) { - dump('xul_param error: ' + E + '\n'); - } - } - function get_bool(a) { // Normal javascript interpretation except 'f' == false, per postgres, and 'F' == false // So false includes 'f', '', 0, null, and undefined diff --git a/Open-ILS/xul/staff_client/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js index 94c9ce6fb6..eef079c35b 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js @@ -18,7 +18,7 @@ const api = { 'AUTH_WORKSTATION' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.workstation.register' }, 'BILL_PAY' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.money.payment' }, 'BILLING_TYPE_LIST' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.billing_type.retrieve.all', 'secure' : false }, - 'BLOB_AU_PARTS_RETRIEVE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.retrieve.parts', 'cacheable' : true, 'ttl' : 120000 }, + 'BLOB_AU_PARTS_RETRIEVE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.retrieve.parts' }, 'BLOB_MARC_CALLNUMBERS_RETRIEVE' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.biblio.record.marc_cn.retrieve', 'secure' : false }, 'BLOB_MOBTS_CIRC_MVR_HAVING_BALANCE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.transactions.have_balance.fleshed' }, 'BLOB_MOBTS_CIRC_MVR_OPEN' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.transactions.fleshed' }, @@ -96,12 +96,12 @@ const api = { 'FM_AU_IDS_RETRIEVE_VIA_HASH' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.patron.search.advanced' }, 'FM_AU_LIST_RETRIEVE_VIA_GROUP' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.usergroup.members.retrieve' }, 'FM_AU_RETRIEVE_VIA_SESSION' : { 'app' : 'open-ils.auth', 'method' : 'open-ils.auth.session.retrieve' }, - 'FM_AU_RETRIEVE_VIA_BARCODE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.fleshed.retrieve_by_barcode', 'cacheable' : true, 'ttl' : 60000 }, - 'FM_AU_RETRIEVE_VIA_ID' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.retrieve', 'cacheable' : true, 'ttl' : 60000 }, - 'FM_AU_FLESHED_RETRIEVE_VIA_ID' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.fleshed.retrieve', 'cacheable' : true, 'ttl' : 60000 }, + 'FM_AU_RETRIEVE_VIA_BARCODE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.fleshed.retrieve_by_barcode' }, + 'FM_AU_RETRIEVE_VIA_ID' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.retrieve' }, + 'FM_AU_FLESHED_RETRIEVE_VIA_ID' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.fleshed.retrieve' }, 'FM_AU_NEW_USERGROUP' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.usergroup.new' }, 'FM_AU_UPDATE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.patron.update' }, - 'FM_AUN_RETRIEVE_ALL' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.note.retrieve.all', 'cacheable' : false, 'ttl' : 60000 }, + 'FM_AUN_RETRIEVE_ALL' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.note.retrieve.all' }, 'FM_AUN_CREATE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.note.create' }, 'FM_AUN_DELETE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.note.delete' }, 'FM_AUS_RETRIEVE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.patron.settings.retrieve' }, @@ -118,7 +118,7 @@ const api = { 'FM_CIRC_RETRIEVE_VIA_USER' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.checked_out' }, 'FM_CIRC_RETRIEVE_VIA_COPY' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.copy_checkout_history.retrieve' }, /*'FM_CIRC_COUNT_RETRIEVE_VIA_USER' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.checked_out.count' },*/ - 'FM_CIRC_COUNT_RETRIEVE_VIA_USER' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.checked_out.count', 'cacheable' : true, 'ttl' : 60000 }, + 'FM_CIRC_COUNT_RETRIEVE_VIA_USER' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.checked_out.count' }, 'FM_CIRC_COUNT_RETRIEVE_VIA_COPY' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.circulation.count' }, 'FM_CIRC_EDIT_DUE_DATE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.circulation.due_date.update' }, 'FM_CIT_RETRIEVE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.ident_types.retrieve', 'secure' : false }, @@ -146,7 +146,7 @@ const api = { 'FM_MOBTS_OPEN' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.transactions' }, 'FM_MOBTS_TOTAL_OPEN' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.transactions.total' }, 'FM_MOBTS_COUNT_OPEN' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.transactions.count' }, - 'FM_MOUS_RETRIEVE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.fines.summary', 'cacheable' : true, 'ttl' : 60000 }, + 'FM_MOUS_RETRIEVE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.fines.summary' }, 'FM_PGT_RETRIEVE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.groups.tree.retrieve', 'secure' : false }, 'MARC_HTML_RETRIEVE' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.biblio.record.html', 'secure' : false }, 'FM_BLOB_RETRIEVE_VIA_Z3950_SEARCH' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.z3950.search_class' }, 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 5114692d96..e4890c04d5 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 @@ -46,15 +46,16 @@ $('server').value = g.data.server_unadorned; - addCSSClass(document.documentElement,xul_param('login_type',{'modal_xulG':true})) + g.cgi = new CGI(); + addCSSClass(document.documentElement,g.cgi.param('login_type')) - if (xul_param('desc_brief',{'modal_xulG':true})) { + if (g.cgi.param('desc_brief')) { $('desc').hidden = false; - $('desc_brief').appendChild( document.createTextNode( xul_param('desc_brief',{'modal_xulG':true}) ) ); + $('desc_brief').appendChild( document.createTextNode( g.cgi.param('desc_brief') ) ); } - if (xul_param('desc_full',{'modal_xulG':true})) { + if (g.cgi.param('desc_full')) { $('desc').hidden = false; - $('desc_full').appendChild( document.createTextNode( xul_param('desc_full',{'modal_xulG':true}) ) ); + $('desc_full').appendChild( document.createTextNode( g.cgi.param('desc_full') ) ); } $('username').focus(); @@ -90,26 +91,14 @@ 'password_prompt' : $('password'), 'server_prompt' : $('server'), }, - xul_param('login_type',{'modal_xulG':true}) || 'temp' + g.cgi.param('login_type') || 'temp' ); g.session.on_init = function() { - try { - JSAN.use('util.network'); var n = new util.network(); - var staff = n.simple_request('FM_AU_RETRIEVE_VIA_SESSION',[ g.session.key ]); - g.data.temporary_session = { // old way because of local chrome still out there - 'key' : g.session.key, - 'authtime' : g.session.authtime, - '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); - window.close(); - } catch(E) { - g.error.standard_unexpected_error_alert('simple_auth.session.on_init',E); - } + JSAN.use('util.network'); var n = new util.network(); + var staff = n.simple_request('FM_AU_RETRIEVE_VIA_SESSION',[ g.session.key ]); + g.data.temporary_session = { 'key' : g.session.key, 'authtime' : g.session.authtime, 'usr' : js2JSON(staff) }; + g.data.stash('temporary_session'); + window.close(); } g.session.on_init_error = function() { $('password').value = ''; diff --git a/Open-ILS/xul/staff_client/chrome/content/util/browser.xul b/Open-ILS/xul/staff_client/chrome/content/util/browser.xul index 47ea663cfb..3f6deff0a8 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/browser.xul +++ b/Open-ILS/xul/staff_client/chrome/content/util/browser.xul @@ -42,17 +42,23 @@ JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'}); XML_HTTP_SERVER = data.server_unadorned; - var name = xul_param('tab_name') || xul_param('name') || null; - var url; try { url = xul_param('url'); } catch(E) { dump(E + '\n'); }; + g.cgi = new CGI(); + var name = g.cgi.param('tab_name') || g.cgi.param('name') || null; + if (!name) { + if (typeof window.xulG == 'object') { + name = window.xulG.name || window.xulG.tab_name || null; + } + } + var url; try { url = g.cgi.param('url') || xulG.url } catch(E) { dump(E + '\n'); }; if (!url) url = urls.browser; JSAN.use('util.browser'); g.browser = new util.browser(); var push_xulG = true; - if (xul_param('no_xulG')) push_xulG = false; + if (g.cgi.param('no_xulG') || (typeof xulG == 'object' ? xulG.no_xulG : false)) push_xulG = false; var alt_print = false; - if (xul_param('alternate_print')) alt_print = true; + if (g.cgi.param('alternate_print') || (typeof xulG == 'object' ? xulG.alternate_print : false)) alt_print = true; var p = { 'url' : url, @@ -72,17 +78,17 @@ if (typeof window.xulG == 'object' && typeof window.xulG.set_tab_name == 'function') { if (name) try { window.xulG.set_tab_name(name); } catch(E) { alert(E); } } - if (xul_param('show_nav_buttons')) { + if (g.cgi.param('show_nav_buttons')||(typeof window.xulG == 'object' && window.xulG.show_nav_buttons)) { document.getElementById('back').hidden = false; document.getElementById('forward').hidden = false; } - if (xul_param('show_print_button')) { + if (g.cgi.param('show_print_button')||(typeof window.xulG == 'object' && window.xulG.show_print_button)) { document.getElementById('browser_print').hidden = false; } - if (xul_param('title')) { - try { document.title = xul_param('title'); } catch(E) {} - try { window.title = xul_param('title'); } catch(E) {} + if (g.cgi.param('title')) { + try { document.title = g.cgi.param('title'); } catch(E) {} + try { window.title = g.cgi.param('title'); } catch(E) {} } } catch(E) { diff --git a/Open-ILS/xul/staff_client/chrome/content/util/error.js b/Open-ILS/xul/staff_client/chrome/content/util/error.js index cd5b612c9b..fb48e1ac23 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/error.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/error.js @@ -97,16 +97,14 @@ util.error.prototype = { 'D_EXPLODE' : false, 'D_FM_UTILS' : false, 'D_PRINT' : { 'dump' : true }, - 'D_OBSERVERS' : { 'dump' : true, 'console' : false }, - 'D_CACHE' : { 'dump' : true, 'console' : false }, - 'D_SES' : { 'dump' : true, 'console' : false }, + 'D_SES' : { 'dump' : true }, 'D_SES_FUNC' : false, 'D_SES_RESULT' : { 'dump' : true }, 'D_SES_ERROR' : { 'dump' : true, 'console' : true }, 'D_SPAWN' : false, 'D_STRING' : false, 'D_UTIL' : false, - 'D_WIN' : { 'dump' : true }, + 'D_WIN' : false, 'D_WIDGETS' : false }, @@ -347,16 +345,16 @@ util.error.prototype = { if (b3) xml += '