From d0e5e7177e0e48246787aeebb410356522bdb709 Mon Sep 17 00:00:00 2001 From: Jeff Godin Date: Wed, 21 Sep 2011 16:41:19 -0400 Subject: [PATCH] Fix: Current Bills thinks it is Bill History This fixes LP 855894: Bills interface calls itself Bill History, uses bills_historical receipt template https://bugs.launchpad.net/evergreen/+bug/855894 At some point in development, the Current Bills and the Bill History interface were in a unified file, with an xul_param of "current" used to switch between the two. Nothing currently sets the xul_param "current", so the Current Bills interface (bill2.xul and bill2.js) was improperly: * not hiding the xact_finish column * using a caption label of "Bill History" * using the bills_historical receipt template The Bill History interface was okay -- "not current" was the default. This commit removes the tests for xul_param('current') and uses the appropriate code for each interface. // this code in both bill2.js and bill_history.js: var template = 'bills_historical'; if (xul_param('current')) template = 'bills_current'; // becomes: var template = 'bills_current'; // in bill2.js var template = 'bills_historical'; // in bill_history.js Also: added missing staff.patron.bill_interface.caption.label entity Signed-off-by: Jeff Godin Signed-off-by: Jason Etheridge --- Open-ILS/web/opac/locale/en-US/lang.dtd | 1 + Open-ILS/xul/staff_client/server/patron/bill2.js | 12 +++--------- .../xul/staff_client/server/patron/bill_history.js | 13 +++---------- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index a63abdf749..69dba21fc1 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -3035,6 +3035,7 @@ + diff --git a/Open-ILS/xul/staff_client/server/patron/bill2.js b/Open-ILS/xul/staff_client/server/patron/bill2.js index a234f3fe67..6b8d45c8aa 100644 --- a/Open-ILS/xul/staff_client/server/patron/bill2.js +++ b/Open-ILS/xul/staff_client/server/patron/bill2.js @@ -16,13 +16,7 @@ function my_init() { g.error.sdump('D_TRACE','my_init() for bill2.xul'); - if (xul_param('current')) { - $('caption').setAttribute('label',$("patronStrings").getString('staff.patron.bill_history.my_init.current_bills')); - document.title = $("patronStrings").getString('staff.patron.bill_history.my_init.current_bills'); - } else { - $('caption').setAttribute('label',$("patronStrings").getString('staff.patron.bill_history.my_init.bill_history')); - document.title = $("patronStrings").getString('staff.patron.bill_history.my_init.bill_history'); - } + document.title = $("patronStrings").getString('staff.patron.bill_history.my_init.current_bills'); g.funcs = []; g.bill_map = {}; g.row_map = {}; g.check_map = {}; @@ -483,7 +477,7 @@ function init_lists() { } ].concat( patron.util.mbts_columns({ - 'mbts_xact_finish' : { 'hidden' : xul_param('current') ? true : false } + 'mbts_xact_finish' : { 'hidden' : true } } ).concat( circ.util.columns({ @@ -717,7 +711,7 @@ function handle_details() { function print_bills() { try { - var template = 'bills_historical'; if (xul_param('current')) template = 'bills_current'; + var template = 'bills_current'; JSAN.use('patron.util'); g.patron = patron.util.retrieve_fleshed_au_via_id(ses(),g.patron_id,null); g.bill_list.print({ diff --git a/Open-ILS/xul/staff_client/server/patron/bill_history.js b/Open-ILS/xul/staff_client/server/patron/bill_history.js index 5ec8a3c72d..eecf162b9f 100644 --- a/Open-ILS/xul/staff_client/server/patron/bill_history.js +++ b/Open-ILS/xul/staff_client/server/patron/bill_history.js @@ -50,7 +50,6 @@ function payments_tally_selected() { function retrieve_mbts_for_list() { //var method = 'FM_MBTS_IDS_RETRIEVE_ALL_HAVING_CHARGE'; var method = 'FM_MBTS_IDS_RETRIEVE_FOR_HISTORY.authoritative'; - if (xul_param('current')) method = 'FM_MBTS_IDS_RETRIEVE_ALL_HAVING_BALANCE.authoritative'; var date2 = $('bills_date2').dateValue; date2.setDate( date2.getDate() + 1 ); // Javascript will wrap into subsequent months var filter = { @@ -123,7 +122,7 @@ function init_main_list() { g.bill_list.init( { 'columns' : patron.util.mbts_columns({ - 'xact_finish' : { 'hidden' : xul_param('current') ? true : false } + 'xact_finish' : { 'hidden' : false } }).concat( circ.util.columns({ 'title' : { 'hidden' : false, 'flex' : '3' } @@ -235,13 +234,7 @@ function my_init() { g.error.sdump('D_TRACE','my_init() for bill_history.xul'); - if (xul_param('current')) { - $('caption').setAttribute('label',$("patronStrings").getString('staff.patron.bill_history.my_init.current_bills')); - document.title = $("patronStrings").getString('staff.patron.bill_history.my_init.current_bills'); - } else { - $('caption').setAttribute('label',$("patronStrings").getString('staff.patron.bill_history.my_init.bill_history')); - document.title = $("patronStrings").getString('staff.patron.bill_history.my_init.bill_history'); - } + document.title = $("patronStrings").getString('staff.patron.bill_history.my_init.bill_history'); g.funcs = []; g.bill_map = {}; g.payments_map = {}; @@ -373,7 +366,7 @@ function gen_handle_copy_details(which_list) { function print_bills() { try { - var template = 'bills_historical'; if (xul_param('current')) template = 'bills_current'; + var template = 'bills_historical'; JSAN.use('patron.util'); var params = { 'patron' : patron.util.retrieve_fleshed_au_via_id(ses(),g.patron_id,null), -- 2.43.2