From fc6e73433c593cdc87b49cf6b8cde7054dcccaee Mon Sep 17 00:00:00 2001 From: pines Date: Sun, 13 May 2007 08:36:07 +0000 Subject: [PATCH] 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 --- .../chrome/content/main/simple_auth.xul | 35 +++-- .../staff_client/chrome/content/util/browser.xul | 24 ++- .../chrome/content/util/fancy_prompt.xul | 61 +++++--- .../staff_client/chrome/content/util/rbrowser.xul | 24 ++- .../staff_client/server/admin/hold_pull_list.xul | 10 +- .../server/admin/offline_manage_xacts.xul | 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_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 | 24 +-- 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 - .../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 | 169 +++++++++++---------- .../xul/staff_client/server/patron/display.xul | 10 +- .../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 | 21 +-- .../xul/staff_client/server/patron/info_group.xul | 63 ++++---- .../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 +-- 66 files changed, 964 insertions(+), 796 deletions(-) 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 @@