From: phasefx Date: Thu, 5 Mar 2009 07:17:15 +0000 (+0000) Subject: trying to get the splitter in the patron displays to persist their positions again... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5cea33f036e5e6892903faac67a4e9ac1d0f7bcc;p=Evergreen.git trying to get the splitter in the patron displays to persist their positions again, but it's not working :-/ git-svn-id: svn://svn.open-ils.org/ILS/trunk@12415 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 065767f471..4a9f878be3 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -1157,7 +1157,9 @@ - + + + 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 c8eff26956..c1b9fd623c 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js @@ -295,6 +295,7 @@ const urls = { 'XUL_PATRON_BILL_HISTORY' : '/xul/server/patron/bill_history.xul', 'XUL_PATRON_BILL_WIZARD' : '/xul/server/patron/bill_wizard.xul', 'XUL_PATRON_DISPLAY' : '/xul/server/patron/display.xul', + 'XUL_PATRON_HORIZ_DISPLAY' : '/xul/server/patron/display_horiz.xul', 'XUL_PATRON_EDIT' : '/xul/server/patron/ue.xhtml', 'XUL_USER_PERM_EDITOR' : '/xul/server/patron/user_edit.xhtml', 'XUL_PATRON_HOLDS' : '/xul/server/patron/holds.xul', 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 f24e3d6401..304efc7bf0 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js @@ -197,8 +197,7 @@ main.menu.prototype = { 'cmd_patron_search' : [ ['oncommand'], function() { - obj.data.stash_retrieve(); - obj.set_tab(obj.url_prefix(urls.XUL_PATRON_DISPLAY),{},{}); + obj.set_patron_tab(); } ], 'cmd_search_opac' : [ @@ -970,7 +969,18 @@ main.menu.prototype = { } } }, - + 'set_patron_tab' : function(params,content_params) { + var obj = this; + var horizontal_interface = String( obj.data.hash.aous['ui.circ.patron_summary.horizontal'] ) == 'true'; + var url = obj.url_prefix( horizontal_interface ? urls.XUL_PATRON_HORIZ_DISPLAY : urls.XUL_PATRON_DISPLAY ); + obj.set_tab(url,params ? params : {},content_params ? content_params : {}); + }, + 'new_patron_tab' : function(params,content_params) { + var obj = this; + var horizontal_interface = String( obj.data.hash.aous['ui.circ.patron_summary.horizontal'] ) == 'true'; + var url = obj.url_prefix( horizontal_interface ? urls.XUL_PATRON_HORIZ_DISPLAY : urls.XUL_PATRON_DISPLAY ); + obj.new_tab(url,params ? params : {},content_params ? content_params : {}); + }, 'set_tab' : function(url,params,content_params) { var obj = this; if (!url) url = '/xul/server/'; @@ -986,6 +996,8 @@ main.menu.prototype = { content_params.new_tab = function(a,b,c) { return obj.new_tab(a,b,c); }; content_params.set_tab = function(a,b,c) { return obj.set_tab(a,b,c); }; + content_params.new_patron_tab = function(a,b) { return obj.new_patron_tab(a,b); }; + content_params.set_patron_tab = function(a,b) { return obj.set_patron_tab(a,b); }; content_params.set_tab_name = function(name) { tab.setAttribute('label',(idx + 1) + ' ' + name); }; content_params.open_chrome_window = function(a,b,c) { return xulG.window.open(a,b,c); }; content_params.url_prefix = function(url) { return obj.url_prefix(url); }; diff --git a/Open-ILS/xul/staff_client/server/admin/offline_manage_xacts.js b/Open-ILS/xul/staff_client/server/admin/offline_manage_xacts.js index 395fcca613..8bc0e3ed84 100644 --- a/Open-ILS/xul/staff_client/server/admin/offline_manage_xacts.js +++ b/Open-ILS/xul/staff_client/server/admin/offline_manage_xacts.js @@ -866,10 +866,8 @@ admin.offline_manage_xacts.prototype = { for (var barcode in patrons) { if (typeof window.xulG == 'object' && typeof window.xulG.new_tab == 'function') { try { - var url = urls.XUL_PATRON_DISPLAY; - //+ '?barcode=' + window.escape( error.command.patron_barcode ); - window.xulG.new_tab( - url, {}, { 'barcode' : barcode } + window.xulG.new_patron_tab( + {}, { 'barcode' : barcode } ); } catch(E) { alert(E); diff --git a/Open-ILS/xul/staff_client/server/cat/bib_brief.xul b/Open-ILS/xul/staff_client/server/cat/bib_brief.xul index 509a1236b0..f5ab1222d0 100644 --- a/Open-ILS/xul/staff_client/server/cat/bib_brief.xul +++ b/Open-ILS/xul/staff_client/server/cat/bib_brief.xul @@ -188,10 +188,8 @@ vim: noet:sw=4:ts=4: function spawn_patron(span) { try { - var loc = urls.XUL_PATRON_DISPLAY; // + '?barcode=' + window.escape(barcode); - - if (typeof window.xulG == 'object' && typeof window.xulG.set_tab == 'function') { - window.xulG.set_tab( loc, {}, { 'id' : span.getAttribute('au_id') } ); + if (typeof window.xulG == 'object' && typeof window.xulG.set_patron_tab == 'function') { + window.xulG.set_patron_tab( {}, { 'id' : span.getAttribute('au_id') } ); } else { copy_to_clipboard( span.textContent ); } diff --git a/Open-ILS/xul/staff_client/server/circ/checkin.js b/Open-ILS/xul/staff_client/server/circ/checkin.js index dd96475532..4a84d66ac0 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkin.js +++ b/Open-ILS/xul/staff_client/server/circ/checkin.js @@ -143,7 +143,7 @@ circ.checkin.prototype = { } } for (var i in patrons) { - xulG.new_tab(urls.XUL_PATRON_DISPLAY,{},{'id' : i}); + xulG.new_patron_tab({},{'id' : i}); } } ], diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js index 21672b1737..fd554a1b74 100644 --- a/Open-ILS/xul/staff_client/server/circ/util.js +++ b/Open-ILS/xul/staff_client/server/circ/util.js @@ -72,8 +72,7 @@ circ.util.show_copy_details = function(copy_id) { for (var j = 0; j < patrons.length; j++) { if (typeof window.xulG == 'object' && typeof window.xulG.new_tab == 'function') { try { - var url = urls.XUL_PATRON_DISPLAY; // + '?id=' + window.escape( patrons[j] ); - window.xulG.new_tab( url, {}, { 'id' : patrons[j] } ); + window.xulG.new_patron_tab( {}, { 'id' : patrons[j] } ); } catch(E) { obj.error.standard_unexpected_error_alert(document.getElementById('circStrings').getString('staff.circ.utils.retrieve_patron.failure'), E); } @@ -104,8 +103,7 @@ circ.util.show_last_few_circs = function(selection_list) { for (var j = 0; j < patrons.length; j++) { if (typeof window.xulG == 'object' && typeof window.xulG.new_tab == 'function') { try { - var url = urls.XUL_PATRON_DISPLAY; // + '?id=' + window.escape( patrons[j] ); - window.xulG.new_tab( url, {}, { 'id' : patrons[j] } ); + window.xulG.new_patron_tab( {}, { 'id' : patrons[j] } ); } catch(E) { obj.error.standard_unexpected_error_alert(document.getElementById('circStrings').getString('staff.circ.utils.retrieve_patron.failure') ,E); } diff --git a/Open-ILS/xul/staff_client/server/main/verify_credentials.js b/Open-ILS/xul/staff_client/server/main/verify_credentials.js index e11a41e28d..72c768b9ff 100644 --- a/Open-ILS/xul/staff_client/server/main/verify_credentials.js +++ b/Open-ILS/xul/staff_client/server/main/verify_credentials.js @@ -94,8 +94,7 @@ function verify_init() { alert (req.desc); document.getElementById('name_prompt').focus(); } else { - var url = xulG.url_prefix( urls.XUL_PATRON_DISPLAY ); - xulG.set_tab( url, {}, { 'id' : req } ); + xulG.set_patron_tab( {}, { 'id' : req } ); } }, false diff --git a/Open-ILS/xul/staff_client/server/patron/display.js b/Open-ILS/xul/staff_client/server/patron/display.js index e58ead9b5d..32fad47ce2 100644 --- a/Open-ILS/xul/staff_client/server/patron/display.js +++ b/Open-ILS/xul/staff_client/server/patron/display.js @@ -27,9 +27,9 @@ patron.display.prototype = { JSAN.use('OpenILS.data'); this.OpenILS = {}; obj.OpenILS.data = new OpenILS.data(); obj.OpenILS.data.init({'via':'stash'}); - var horizontal_interface = String( obj.OpenILS.data.hash.aous['ui.circ.patron_summary.horizontal'] ) == 'true'; - document.getElementById('ui.circ.patron_summary.horizontal').setAttribute('orient', horizontal_interface ? 'vertical' : 'horizontal'); - document.getElementById('pdms1').setAttribute('orient', horizontal_interface ? 'vertical' : 'horizontal'); + //var horizontal_interface = String( obj.OpenILS.data.hash.aous['ui.circ.patron_summary.horizontal'] ) == 'true'; + //document.getElementById('ui.circ.patron_summary.horizontal').setAttribute('orient', horizontal_interface ? 'vertical' : 'horizontal'); + //document.getElementById('pdms1').setAttribute('orient', horizontal_interface ? 'vertical' : 'horizontal'); JSAN.use('util.deck'); obj.right_deck = new util.deck('patron_right_deck'); @@ -91,9 +91,8 @@ patron.display.prototype = { if (typeof window.xulG == 'object' && typeof window.xulG.new_tab == 'function') { for (var i = 0; i < obj.retrieve_ids.length; i++) { try { - var url = urls.XUL_PATRON_DISPLAY; //+ '?id=' + window.escape( obj.retrieve_ids[i] ); - window.xulG.new_tab( - url, {}, { 'id' : obj.retrieve_ids[i] } + window.xulG.new_patron_tab( + {}, { 'id' : obj.retrieve_ids[i] } ); } catch(E) { alert(E); @@ -201,9 +200,7 @@ patron.display.prototype = { function spawn_search(s) { obj.error.sdump('D_TRACE', $("commonStrings").getFormattedString('staff.patron.display.cmd_patron_edit.edit_search', [js2JSON(s)]) ); obj.OpenILS.data.stash_retrieve(); - var loc = xulG.url_prefix(urls.XUL_PATRON_DISPLAY); - //loc += '?doit=1&query=' + window.escape(js2JSON(s)); - xulG.new_tab( loc, {}, { 'doit' : 1, 'query' : s } ); + xulG.new_patron_tab( {}, { 'doit' : 1, 'query' : s } ); } function spawn_editor(p) { diff --git a/Open-ILS/xul/staff_client/server/patron/display_horiz.xul b/Open-ILS/xul/staff_client/server/patron/display_horiz.xul new file mode 100644 index 0000000000..a6f5e9ca8e --- /dev/null +++ b/Open-ILS/xul/staff_client/server/patron/display_horiz.xul @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Open-ILS/xul/staff_client/server/patron/display_horiz_overlay.xul b/Open-ILS/xul/staff_client/server/patron/display_horiz_overlay.xul new file mode 100644 index 0000000000..7a4d2c26c3 --- /dev/null +++ b/Open-ILS/xul/staff_client/server/patron/display_horiz_overlay.xul @@ -0,0 +1,132 @@ + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Open-ILS/xul/staff_client/server/patron/holds.js b/Open-ILS/xul/staff_client/server/patron/holds.js index 4feb5fb7c5..6324fcd642 100644 --- a/Open-ILS/xul/staff_client/server/patron/holds.js +++ b/Open-ILS/xul/staff_client/server/patron/holds.js @@ -824,8 +824,7 @@ patron.holds.prototype = { for (var i = 0; i < obj.retrieve_ids.length; i++) { var patron_id = obj.retrieve_ids[i].usr; if (seen[patron_id]) continue; seen[patron_id] = true; - xulG.new_tab( - xulG.url_prefix(urls.XUL_PATRON_DISPLAY), // + '?id=' + patron_id, + xulG.new_patron_tab( {}, { 'id' : patron_id } ); diff --git a/Open-ILS/xul/staff_client/server/patron/info_group.xul b/Open-ILS/xul/staff_client/server/patron/info_group.xul index 356b34642f..9b2081cf84 100644 --- a/Open-ILS/xul/staff_client/server/patron/info_group.xul +++ b/Open-ILS/xul/staff_client/server/patron/info_group.xul @@ -188,9 +188,7 @@ if (typeof window.xulG == 'object' && typeof window.xulG.new_tab == 'function') { for (var i = 0; i < g.sel_list.length; i++) { try { - var url = urls.XUL_PATRON_DISPLAY// + '?id=' + window.escape( g.sel_list[i] ); - window.xulG.new_tab( - url, + window.xulG.new_patron_tab( { 'tab_name' : $("patronStrings").getString('staff.patron.info_group.retrieve_patron.tab_name') }, { 'id' : g.sel_list[i], @@ -216,14 +214,10 @@ var result = patron.util.merge(g.sel_list); if (result) { if (result != g.patron_id && g.sel_list.indexOf( g.patron_id ) != -1) { - xulG.set_tab( - urls.XUL_PATRON_DISPLAY, + xulG.set_patron_tab( { 'tab_name' : $("patronStrings").getString('staff.patron.info_group.retrieve_patron.tab_name') }, { - 'id' : result, - 'url_prefix' : xulG.url_prefix, - 'new_tab' : xulG.new_tab, - 'set_tab' : xulG.set_tab + 'id' : result } ); } else { @@ -299,10 +293,8 @@ function spawn_search(s) { try { g.error.sdump('D_TRACE', 'Editor would like to search for: ' + js2JSON(s) ); - var loc = xulG.url_prefix(urls.XUL_PATRON_DISPLAY); - //loc += '?doit=1&query=' + window.escape(js2JSON(s)); - if (typeof window.xulG == 'object' && typeof window.xulG.new_tab == 'function') - xulG.new_tab( loc, {}, {'doit':1,'query':s} ); + if (typeof window.xulG == 'object' && typeof window.xulG.new_patron_tab == 'function') + xulG.new_patron_tab( {}, {'doit':1,'query':s} ); } catch(E) { g.error.standard_unexpected_error_alert($("patronStrings").getString('staff.patron.info_group.spwan_search'),E); }