From: pines Date: Sun, 13 May 2007 08:36:07 +0000 (+0000) Subject: xul_param and modal xulG conversion X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=fc6e73433c593cdc87b49cf6b8cde7054dcccaee;p=Evergreen.git xul_param and modal xulG conversion git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_0@7294 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- 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 e4890c04d5..5114692d96 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,16 +46,15 @@ $('server').value = g.data.server_unadorned; - g.cgi = new CGI(); - addCSSClass(document.documentElement,g.cgi.param('login_type')) + addCSSClass(document.documentElement,xul_param('login_type',{'modal_xulG':true})) - if (g.cgi.param('desc_brief')) { + if (xul_param('desc_brief',{'modal_xulG':true})) { $('desc').hidden = false; - $('desc_brief').appendChild( document.createTextNode( g.cgi.param('desc_brief') ) ); + $('desc_brief').appendChild( document.createTextNode( xul_param('desc_brief',{'modal_xulG':true}) ) ); } - if (g.cgi.param('desc_full')) { + if (xul_param('desc_full',{'modal_xulG':true})) { $('desc').hidden = false; - $('desc_full').appendChild( document.createTextNode( g.cgi.param('desc_full') ) ); + $('desc_full').appendChild( document.createTextNode( xul_param('desc_full',{'modal_xulG':true}) ) ); } $('username').focus(); @@ -91,14 +90,26 @@ 'password_prompt' : $('password'), 'server_prompt' : $('server'), }, - g.cgi.param('login_type') || 'temp' + xul_param('login_type',{'modal_xulG':true}) || 'temp' ); g.session.on_init = function() { - 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(); + 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); + } } 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 3f6deff0a8..47ea663cfb 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/browser.xul +++ b/Open-ILS/xul/staff_client/chrome/content/util/browser.xul @@ -42,23 +42,17 @@ JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'}); XML_HTTP_SERVER = data.server_unadorned; - 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'); }; + var name = xul_param('tab_name') || xul_param('name') || null; + var url; try { url = xul_param('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 (g.cgi.param('no_xulG') || (typeof xulG == 'object' ? xulG.no_xulG : false)) push_xulG = false; + if (xul_param('no_xulG')) push_xulG = false; var alt_print = false; - if (g.cgi.param('alternate_print') || (typeof xulG == 'object' ? xulG.alternate_print : false)) alt_print = true; + if (xul_param('alternate_print')) alt_print = true; var p = { 'url' : url, @@ -78,17 +72,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 (g.cgi.param('show_nav_buttons')||(typeof window.xulG == 'object' && window.xulG.show_nav_buttons)) { + if (xul_param('show_nav_buttons')) { document.getElementById('back').hidden = false; document.getElementById('forward').hidden = false; } - if (g.cgi.param('show_print_button')||(typeof window.xulG == 'object' && window.xulG.show_print_button)) { + if (xul_param('show_print_button')) { document.getElementById('browser_print').hidden = false; } - if (g.cgi.param('title')) { - try { document.title = g.cgi.param('title'); } catch(E) {} - try { window.title = g.cgi.param('title'); } catch(E) {} + if (xul_param('title')) { + try { document.title = xul_param('title'); } catch(E) {} + try { window.title = xul_param('title'); } catch(E) {} } } catch(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 27a9731854..02d2f7d812 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 @@ -32,6 +32,9 @@ diff --git a/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul b/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul index 4dd9aa23ac..0062dde462 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul +++ b/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul @@ -41,14 +41,8 @@ JSAN.use('util.error'); g.error = new util.error(); g.error.sdump('D_TRACE','my_init() for util_browser.xul'); - 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'); }; + var name = xul_param('tab_name') || xul_param('name') || null; + var url; try { url = xul_param('url'); } catch(E) { dump(E + '\n'); }; if (!url) url = urls.browser; if (!g.browser) { @@ -56,10 +50,10 @@ } var push_xulG = true; - if (g.cgi.param('no_xulG') || (typeof xulG == 'object' ? xulG.no_xulG : false)) push_xulG = false; + if (xul_param('no_xulG')) push_xulG = false; var alt_print = false; - if (g.cgi.param('alternate_print') || (typeof xulG == 'object' ? xulG.alternate_print : false)) alt_print = true; + if (xul_param('alternate_print')) alt_print = true; var p = { 'url' : url, @@ -78,17 +72,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 (g.cgi.param('show_nav_buttons')||(typeof window.xulG == 'object' && window.xulG.show_nav_buttons)) { + if (xul_param('show_nav_buttons')) { document.getElementById('back').hidden = false; document.getElementById('forward').hidden = false; } - if (g.cgi.param('show_print_button')||(typeof window.xulG == 'object' && window.xulG.show_print_button)) { + if (xul_param('show_print_button')) { document.getElementById('browser_print').hidden = false; } - if (g.cgi.param('title')) { - try { document.title = g.cgi.param('title'); } catch(E) {} - try { window.title = g.cgi.param('title'); } catch(E) {} + if (xul_param('title')) { + try { document.title = xul_param('title'); } catch(E) {} + try { window.title = xul_param('title'); } catch(E) {} } } catch(E) { diff --git a/Open-ILS/xul/staff_client/server/admin/hold_pull_list.xul b/Open-ILS/xul/staff_client/server/admin/hold_pull_list.xul index 22963fdbd3..99e565f576 100644 --- a/Open-ILS/xul/staff_client/server/admin/hold_pull_list.xul +++ b/Open-ILS/xul/staff_client/server/admin/hold_pull_list.xul @@ -41,16 +41,14 @@ JSAN.use('util.error'); g.error = new util.error(); g.error.sdump('D_TRACE','my_init() for holds.xul'); - g.cgi = new CGI(); - JSAN.use('patron.holds'); g.holds = new patron.holds(); g.holds.init( { 'tree_id' : 'holds_pull_list', - 'patron_id' : g.cgi.param('patron_id'), - 'docid' : g.cgi.param('docid'), - 'shelf' : g.cgi.param('shelf'), - 'pull' : g.cgi.param('pull'), + 'patron_id' : xul_param('patron_id'), + 'docid' : xul_param('docid'), + 'shelf' : xul_param('shelf'), + 'pull' : xul_param('pull'), } ); window.refresh = function(p) { g.holds.retrieve(p); } diff --git a/Open-ILS/xul/staff_client/server/admin/offline_manage_xacts.xul b/Open-ILS/xul/staff_client/server/admin/offline_manage_xacts.xul index c8d991ca62..0bf9973cb2 100644 --- a/Open-ILS/xul/staff_client/server/admin/offline_manage_xacts.xul +++ b/Open-ILS/xul/staff_client/server/admin/offline_manage_xacts.xul @@ -40,8 +40,6 @@ JSAN.use('util.error'); g.error = new util.error(); g.error.sdump('D_TRACE','my_init() for admin_offline_manage_xacts.xul'); - g.cgi = new CGI(); - JSAN.use('admin.offline_manage_xacts'); g.admin = new admin.offline_manage_xacts(); g.admin.init({}); diff --git a/Open-ILS/xul/staff_client/server/admin/upload_xacts.js b/Open-ILS/xul/staff_client/server/admin/upload_xacts.js index e4ec6533ca..12dec910d5 100644 --- a/Open-ILS/xul/staff_client/server/admin/upload_xacts.js +++ b/Open-ILS/xul/staff_client/server/admin/upload_xacts.js @@ -11,15 +11,13 @@ function my_init() { JSAN.errorLevel = "die"; // none, warn, or die JSAN.addRepository('..'); JSAN.use('util.error'); g.error = new util.error(); - g.error.sdump('D_TRACE','my_init() for offline_checkout.html'); + g.error.sdump('D_TRACE','my_init() for upload_xacts.html'); if (typeof window.xulG == 'object' && typeof window.xulG.set_tab_name == 'function') { try { window.xulG.set_tab_name('Upload Offline Transactions'); } catch(E) { alert(E); } } - g.cgi = new CGI(); - - JSAN.use('util.file'); g.file = new util.file( g.cgi.param('filename') ); + JSAN.use('util.file'); g.file = new util.file( xul_param('filename') ); if (g.file._file.exists()) { $('submit').disabled = false; @@ -29,10 +27,10 @@ function my_init() { return; } - $( 'ws' ).setAttribute('value', g.cgi.param('ws')); - $( 'ses' ).setAttribute('value', g.cgi.param('ses')); - $( 'seskey' ).setAttribute('value', g.cgi.param('seskey')); - $( 'delta' ).setAttribute('value', g.cgi.param('delta')); + $( 'ws' ).setAttribute('value', xul_param('ws')); + $( 'ses' ).setAttribute('value', xul_param('ses')); + $( 'seskey' ).setAttribute('value', xul_param('seskey')); + $( 'delta' ).setAttribute('value', xul_param('delta')); $( 'form' ).setAttribute('action', xulG.url_prefix(urls.XUL_OFFLINE_MANAGE_XACTS_CGI)); diff --git a/Open-ILS/xul/staff_client/server/admin/upload_xacts.xhtml b/Open-ILS/xul/staff_client/server/admin/upload_xacts.xhtml index ce5fee3988..d3c13f8bc4 100644 --- a/Open-ILS/xul/staff_client/server/admin/upload_xacts.xhtml +++ b/Open-ILS/xul/staff_client/server/admin/upload_xacts.xhtml @@ -14,6 +14,7 @@