[open-ils-commits] r17576 - trunk/Open-ILS/xul/staff_client/server/patron (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Sep 10 12:35:41 EDT 2010


Author: phasefx
Date: 2010-09-10 12:35:37 -0400 (Fri, 10 Sep 2010)
New Revision: 17576

Modified:
   trunk/Open-ILS/xul/staff_client/server/patron/bill2.js
   trunk/Open-ILS/xul/staff_client/server/patron/bill_history.js
   trunk/Open-ILS/xul/staff_client/server/patron/bills.js
   trunk/Open-ILS/xul/staff_client/server/patron/info_group.js
   trunk/Open-ILS/xul/staff_client/server/patron/search_result.js
   trunk/Open-ILS/xul/staff_client/server/patron/util.js
Log:
the method behind patron.util.retrieve_fleshed_au_via_id can take a fields parameter for which fields to flesh, so let's expose that, and flesh some patron data being sent to receipt templates while we're here.  End-goal is to expose address information in patron searches without sending too much data over the wire

Modified: trunk/Open-ILS/xul/staff_client/server/patron/bill2.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/bill2.js	2010-09-10 16:08:30 UTC (rev 17575)
+++ trunk/Open-ILS/xul/staff_client/server/patron/bill2.js	2010-09-10 16:35:37 UTC (rev 17576)
@@ -648,7 +648,7 @@
         var template = 'bills_historical'; if (xul_param('current')) template = 'bills_current';
         JSAN.use('patron.util');
         var params = { 
-            'patron' : patron.util.retrieve_au_via_id(ses(),g.patron_id), 
+            'patron' : patron.util.retrieve_fleshed_au_via_id(ses(),g.patron_id,null), 
             'printer_context' : 'receipt',
             'template' : template
         };

Modified: trunk/Open-ILS/xul/staff_client/server/patron/bill_history.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/bill_history.js	2010-09-10 16:08:30 UTC (rev 17575)
+++ trunk/Open-ILS/xul/staff_client/server/patron/bill_history.js	2010-09-10 16:35:37 UTC (rev 17576)
@@ -376,7 +376,7 @@
         var template = 'bills_historical'; if (xul_param('current')) template = 'bills_current';
         JSAN.use('patron.util');
         var params = { 
-            'patron' : patron.util.retrieve_au_via_id(ses(),g.patron_id), 
+            'patron' : patron.util.retrieve_fleshed_au_via_id(ses(),g.patron_id,null), 
             'template' : template
         };
         g.bill_list.print(params);

Modified: trunk/Open-ILS/xul/staff_client/server/patron/bills.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/bills.js	2010-09-10 16:08:30 UTC (rev 17575)
+++ trunk/Open-ILS/xul/staff_client/server/patron/bills.js	2010-09-10 16:35:37 UTC (rev 17576)
@@ -516,7 +516,7 @@
                         var template = 'bill_payment';
                         JSAN.use('patron.util'); JSAN.use('util.functional');
                         var params = { 
-                            'patron' : patron.util.retrieve_fleshed_au_via_id(ses(),obj.patron_id), 
+                            'patron' : patron.util.retrieve_fleshed_au_via_id(ses(),obj.patron_id,null), 
                             'lib' : obj.data.hash.aou[ obj.data.list.au[0].ws_ou() ],
                             'staff' : obj.data.list.au[0],
                             'header' : obj.data.print_list_templates[template].header,
@@ -684,7 +684,7 @@
             var columns = patron.util.mbts_columns({});
             var template = 'bills_main_view';
             var params = { 
-                'patron' : patron.util.retrieve_fleshed_au_via_id(ses(),obj.patron_id), 
+                'patron' : patron.util.retrieve_fleshed_au_via_id(ses(),obj.patron_id,null), 
                 'lib' : obj.data.hash.aou[ obj.data.list.au[0].ws_ou() ],
                 'staff' : obj.data.list.au[0],
                 'header' : obj.data.print_list_templates[template].header,

Modified: trunk/Open-ILS/xul/staff_client/server/patron/info_group.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/info_group.js	2010-09-10 16:08:30 UTC (rev 17575)
+++ trunk/Open-ILS/xul/staff_client/server/patron/info_group.js	2010-09-10 16:35:37 UTC (rev 17576)
@@ -116,7 +116,7 @@
                         return row;
                     }
 
-                    patron.util.retrieve_fleshed_au_via_id( ses(), id, function(req) {
+                    patron.util.retrieve_fleshed_au_via_id( ses(), id, null, function(req) {
                         row.my.au = req.getResultObject();
                         process_and_return();
                     });
@@ -428,7 +428,7 @@
         if (g.sel_list.length == 0) g.sel_list[0] = g.patron_id;
         for (var i = 0; i < g.sel_list.length; i++) {    
 
-            var patron_a = patron.util.retrieve_fleshed_au_via_id(ses(),g.sel_list[i]);
+            var patron_a = patron.util.retrieve_fleshed_au_via_id(ses(),g.sel_list[i],null);
             if (typeof patron_a.ilsevent != 'undefined') throw(patron_a);
             switch(direction) {
                 case true:

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:08:30 UTC (rev 17575)
+++ trunk/Open-ILS/xul/staff_client/server/patron/search_result.js	2010-09-10 16:35:37 UTC (rev 17576)
@@ -50,7 +50,10 @@
                 'map_row_to_columns' : patron.util.std_map_row_to_columns(),
                 'retrieve_row' : function(params) {
                     var id = params.retrieve_id;
-                    var au_obj = patron.util.retrieve_au_via_id( ses(), id,
+                    var au_obj = patron.util.retrieve_fleshed_au_via_id(
+                        ses(),
+                        id,
+                        ["card","billing_address","mailing_address"],
                         function(req) {
                             try {
                                 var row = params.row;

Modified: trunk/Open-ILS/xul/staff_client/server/patron/util.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/util.js	2010-09-10 16:08:30 UTC (rev 17575)
+++ trunk/Open-ILS/xul/staff_client/server/patron/util.js	2010-09-10 16:35:37 UTC (rev 17576)
@@ -227,7 +227,7 @@
         },
         {
             'persist' : 'hidden width ordinal', 'id' : 'mp_staff', 'label' : commonStrings.getString('staff.mp_accepting_usr_label'), 'flex' : 1,
-            'primary' : false, 'hidden' : false, 'editable' : false, 'render' : function(my) { var s = my.mp.accepting_usr(); if (s && typeof s != "object") s = patron.util.retrieve_fleshed_au_via_id(ses(),s); return s.family_name() + " (" + s.card().barcode() + ") @ " + data.hash.aou[ s.home_ou() ].shortname(); }
+            'primary' : false, 'hidden' : false, 'editable' : false, 'render' : function(my) { var s = my.mp.accepting_usr(); if (s && typeof s != "object") s = patron.util.retrieve_fleshed_au_via_id(ses(),s,["card"]); return s.family_name() + " (" + s.card().barcode() + ") @ " + data.hash.aou[ s.home_ou() ].shortname(); }
         },
         {
             'persist' : 'hidden width ordinal', 'id' : 'mp_xact', 'label' : commonStrings.getString('staff.mp_xact_label'), 'flex' : 1,
@@ -590,15 +590,15 @@
     return parts;
 }
 
-patron.util.retrieve_fleshed_au_via_id = function(session, id, f) {
+patron.util.retrieve_fleshed_au_via_id = function(session, id, fields, func) {
     JSAN.use('util.network');
     var network = new util.network();
     var patron_obj = network.simple_request(
         'FM_AU_FLESHED_RETRIEVE_VIA_ID.authoritative',
-        [ session, id ],
-        typeof f == 'function' ? f : null
+        [ session, id, fields ],
+        typeof func == 'function' ? func : null
     );
-    if (typeof f != 'function') {
+    if (typeof func != 'function') {
         patron.util.set_penalty_css(patron_obj);
         return patron_obj;
     }



More information about the open-ils-commits mailing list