From e07d4c1489259e089a8c66eef5d6e7ed8c8fe7a8 Mon Sep 17 00:00:00 2001 From: phasefx Date: Fri, 10 Sep 2010 16:35:51 +0000 Subject: [PATCH] In list.fm_columns, allow us to dictate the data object used for rendering (the row.my object fed into list.append) for all columns via the '*' column definition. Also, wire up mailing and billing address columns into Patron Search git-svn-id: svn://svn.open-ils.org/ILS/trunk@17580 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../xul/staff_client/chrome/content/util/list.js | 11 +++++++++++ .../server/locale/en-US/patron.properties | 2 ++ .../xul/staff_client/server/patron/search_result.js | 20 ++++++++++++++++++++ 3 files changed, 33 insertions(+) diff --git a/Open-ILS/xul/staff_client/chrome/content/util/list.js b/Open-ILS/xul/staff_client/chrome/content/util/list.js index 08f062369..739a24427 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/list.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/list.js @@ -1708,6 +1708,11 @@ util.list.prototype = { var dataobj = hint; var datafield = my_field.name; if (column_extras) { + if (column_extras['*']) { + if (column_extras['*']['dataobj']) { + dataobj = column_extras['*']['dataobj']; + } + } if (column_extras[col_id]) { if (column_extras[col_id]['dataobj']) { dataobj = column_extras[col_id]['dataobj']; @@ -1759,6 +1764,9 @@ util.list.prototype = { if (column_extras['*']['expanded_label']) { def.label = my_class.label + ': ' + def.label; } + if (column_extras['*']['label_prefix']) { + def.label = column_extras['*']['label_prefix'] + def.label; + } if (column_extras['*']['remove_virtual']) { if (my_field.virtual) { def.remove_me = true; @@ -1772,6 +1780,9 @@ util.list.prototype = { if (column_extras[col_id]['keep_me']) { def.remove_me = false; } + if (column_extras[col_id]['label_prefix']) { + def.label = column_extras[col_id]['label_prefix'] + def.label; + } } } if (def.remove_me) { diff --git a/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties b/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties index 20f8b0f15..5c970e256 100644 --- a/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties +++ b/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties @@ -335,6 +335,8 @@ staff.patron.search_result.init.typeof_params=typeof params.on_retrieve == %1$s staff.patron.search_result.init.search_print=patron search print staff.patron.search_result.init.search_clipboard=patron search clipboard staff.patron.search_result.init.search_saving_columns=patron search saving columns +staff.patron.search_result.mailing_address_column_label_prefix=Mailing Addr: +staff.patron.search_result.billing_address_column_label_prefix=Billing Addr: staff.patron.summary.patron_bill.money=$ %1$s staff.patron.summary.retrieve.no_barcode=summary: No barcode or ID staff.patron.summary.patron_net_access=Internet diff --git a/Open-ILS/xul/staff_client/server/patron/search_result.js b/Open-ILS/xul/staff_client/server/patron/search_result.js index 4b42eecd7..d313cbb61 100644 --- a/Open-ILS/xul/staff_client/server/patron/search_result.js +++ b/Open-ILS/xul/staff_client/server/patron/search_result.js @@ -42,6 +42,24 @@ patron.search_result.prototype = { '*' : { 'remove_virtual' : true, 'expanded_label' : true, 'hidden' : true }, 'ac_barcode' : { 'hidden' : false } }) + ).concat( + obj.list.fm_columns('aua',{ + '*' : { + 'dataobj' : 'billing_aua', + 'remove_virtual' : true, + 'label_prefix' : $('patronStrings').getString('staff.patron.search_result.billing_address_column_label_prefix'), + 'hidden' : true + } + },'billing_') + ).concat( + obj.list.fm_columns('aua',{ + '*' : { + 'dataobj' : 'mailing_aua', + 'remove_virtual' : true, + 'label_prefix' : $('patronStrings').getString('staff.patron.search_result.mailing_address_column_label_prefix'), + 'hidden' : true + } + },'mailing_') ); obj.list.init( @@ -60,6 +78,8 @@ patron.search_result.prototype = { if (typeof row.my == 'undefined') row.my = {}; row.my.au = req.getResultObject(); row.my.ac = row.my.au.card(); + row.my.billing_aua = row.my.au.billing_address(); + row.my.mailing_aua = row.my.au.mailing_address(); if (typeof params.on_retrieve == 'function') { params.on_retrieve(row); } else { -- 2.11.0