[open-ils-commits] r17580 - in trunk/Open-ILS/xul/staff_client: chrome/content/util server/locale/en-US server/patron (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Sep 10 12:35:54 EDT 2010
Author: phasefx
Date: 2010-09-10 12:35:51 -0400 (Fri, 10 Sep 2010)
New Revision: 17580
Modified:
trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js
trunk/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
trunk/Open-ILS/xul/staff_client/server/patron/search_result.js
Log:
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
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js 2010-09-10 16:35:48 UTC (rev 17579)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js 2010-09-10 16:35:51 UTC (rev 17580)
@@ -1708,6 +1708,11 @@
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 @@
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 @@
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) {
Modified: trunk/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties 2010-09-10 16:35:48 UTC (rev 17579)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties 2010-09-10 16:35:51 UTC (rev 17580)
@@ -335,6 +335,8 @@
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
Modified: trunk/Open-ILS/xul/staff_client/server/patron/search_result.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/search_result.js 2010-09-10 16:35:48 UTC (rev 17579)
+++ trunk/Open-ILS/xul/staff_client/server/patron/search_result.js 2010-09-10 16:35:51 UTC (rev 17580)
@@ -42,6 +42,24 @@
'*' : { '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 @@
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 {
More information about the open-ils-commits
mailing list