use slim checkouts. Should use real async instead of the chain, though
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 2 Jan 2006 02:41:21 +0000 (02:41 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 2 Jan 2006 02:41:21 +0000 (02:41 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2579 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/patron/items.js
Open-ILS/xul/staff_client/server/patron/summary.js

index 3ff81c2..6d0557b 100644 (file)
@@ -30,6 +30,52 @@ patron.items.prototype = {
                obj.list.init(
                        {
                                'columns' : columns,
+                               'retrieve_row' : function(params) {
+
+                                       var row = params.row;
+
+                                       var funcs = [
+                                               
+                                               function() {
+
+                                                       row.my.mvr = obj.network.request(
+                                                               api.mods_slim_record_retrieve_via_copy.app,
+                                                               api.mods_slim_record_retrieve_via_copy.method,
+                                                               [ row.my.circ.target_copy() ]
+                                                       );
+
+                                               },
+                                               
+                                               function() {
+
+
+                                                       row.my.acp = obj.network.request(
+                                                               api.fm_acp_retrieve.app,
+                                                               api.fm_acp_retrieve.method,
+                                                               [ obj.session, row.my.circ.target_copy() ]
+                                                       );
+
+                                               },
+
+                                               function() {
+
+                                                       if (typeof params.on_retrieve == 'function') {
+                                                               params.on_retrieve(row);
+                                                       }
+
+                                               },
+                                       ];
+
+                                       JSAN.use('util.exec'); var exec = new util.exec();
+                                       exec.on_error = function(E) {
+                                               //var err = 'items chain: ' + js2JSON(E);
+                                               //obj.error.sdump('D_ERROR',err);
+                                               return true; /* keep going */
+                                       }
+                                       exec.chain( funcs );
+
+                                       return row;
+                               },
                                'map_row_to_column' : circ.util.std_map_row_to_column(),
                        }
                );
@@ -76,8 +122,8 @@ patron.items.prototype = {
                        obj.checkouts = window.xulG.checkouts;
                } else {
                        obj.checkouts = obj.network.request(
-                               api.blob_checkouts_retrieve.app,
-                               api.blob_checkouts_retrieve.method,
+                               api.fm_circ_retrieve_via_user.app,
+                               api.fm_circ_retrieve_via_user.method,
                                [ obj.session, obj.patron_id ]
                        );
                                
@@ -89,9 +135,7 @@ patron.items.prototype = {
                                        {
                                                'row' : {
                                                        'my' : {
-                                                               'circ' : checkout.circ,
-                                                               'mvr' : checkout.record,
-                                                               'acp' : checkout.copy
+                                                               'circ' : checkout,
                                                        }
                                                }
                                        }
index bd86a57..bbd6bb6 100644 (file)
@@ -120,8 +120,8 @@ patron.summary.prototype = {
                                                                JSAN.use('util.date');
                                                                var total = 0;
                                                                for (var i = 0; i < obj.patron.checkouts().length; i++) {
-                                                                       var item = obj.patron.checkouts()[i];
-                                                                       var due_date = item.circ.due_date();
+                                                                       var circ = obj.patron.checkouts()[i];
+                                                                       var due_date = circ.due_date();
                                                                        due_date = due_date.substr(0,4) 
                                                                                + due_date.substr(5,2) + due_date.substr(8,2);
                                                                        var today = util.date.formatted_date( new Date() , '%Y%m%d' );
@@ -506,8 +506,8 @@ patron.summary.prototype = {
                                function() {
                                        try {
                                                var checkouts = obj.network.request(
-                                                       api.blob_checkouts_retrieve.app,
-                                                       api.blob_checkouts_retrieve.method,
+                                                       api.fm_circ_retrieve_via_user.app,
+                                                       api.fm_circ_retrieve_via_user.method,
                                                        [ obj.session, obj.patron.id() ]
                                                );
                                                obj.patron.checkouts( checkouts );