In list.fm_columns, allow us to dictate the data object used for rendering (the row...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 10 Sep 2010 16:35:51 +0000 (16:35 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 10 Sep 2010 16:35:51 +0000 (16:35 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@17580 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/util/list.js
Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
Open-ILS/xul/staff_client/server/patron/search_result.js

index 08f0623..739a244 100644 (file)
@@ -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) {
index 20f8b0f..5c970e2 100644 (file)
@@ -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
index 4b42eec..d313cbb 100644 (file)
@@ -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 {