new uber holds detail. Does this make it faster?
authorpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 3 Sep 2006 22:33:49 +0000 (22:33 +0000)
committerpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 3 Sep 2006 22:33:49 +0000 (22:33 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5901 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/main/constants.js
Open-ILS/xul/staff_client/server/circ/util.js
Open-ILS/xul/staff_client/server/patron/holds.js

index 2ec1eb6..1d4bf08 100644 (file)
@@ -54,6 +54,7 @@ const api = {
        'FM_AHN_CREATE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.hold_notification.create' },
        'FM_AHN_RETRIEVE_VIA_AHR' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.hold_notification.retrieve_by_hold' },
        'FM_AHR_RETRIEVE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.holds.retrieve_by_id' },
+       'FM_AHR_BLOB_RETRIEVE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.hold.details.retrieve' },
        'FM_AHR_RETRIEVE_VIA_AU' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.holds.retrieve' },
        'FM_AHR_ID_LIST_RETRIEVE_VIA_AU' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.holds.id_list.retrieve' },
        'FM_AHR_RETRIEVE_VIA_BRE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.open_holds.retrieve' },
index f8de568..5ce24d4 100644 (file)
@@ -847,7 +847,7 @@ circ.util.hold_columns = function(modify,params) {
                },
                {
                        'persist' : 'hidden width ordinal', 'id' : 'patron_name', 'label' : 'Patron Name', 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'render' : 'JSAN.use("patron.util"); var temp1 = patron.util.retrieve_name_via_id( ses(), my.ahr.usr() ); temp1[0] + ", " + temp1[1] + " " + temp1[2];',
+                       'primary' : false, 'hidden' : true, 'render' : 'my.patron_barcode + " " + my.patron_family_name + ", " + my.patron_first_given_name;',
                }
        ];
        for (var i = 0; i < c.length; i++) {
index 77b329d..22587b0 100644 (file)
@@ -46,6 +46,38 @@ patron.holds.prototype = {
                                'retrieve_row' : function(params) {
                                        var row = params.row;
                                        try {
+                                               obj.network.simple_request('FM_AHR_BLOB_RETRIEVE', [ ses(), row.my.hold_id ],
+                                                       function(blob_req) {
+                                                               try {
+                                                                       var blob = blob_req.getResultObject();
+                                                                       if (typeof blob.ilsevent != 'undefined') throw(blob);
+                                                                       row.my.ahr = blob.hold;
+                                                                       row.my.status = blob.status;
+                                                                       row.my.acp = blob.copy;
+                                                                       row.my.acn = blob.volume;
+                                                                       row.my.mvr = blob.mvr;
+                                                                       row.my.patron_family_name = blob.patron_last;
+                                                                       row.my.patron_first_given_name = blob.patron_first;
+                                                                       row.my.patron_barcode = blob.patron_barcode;
+
+                                                                       obj.holds_map[ row.my.ahr.id() ] = row.my.ahr;
+                                                                       params.row_node.setAttribute('retrieve_id', 
+                                                                               js2JSON({
+                                                                                       'copy_id':row.my.ahr.current_copy(),
+                                                                                       'id':row.my.ahr.id(),
+                                                                                       'type':row.my.ahr.hold_type(),
+                                                                                       'target':row.my.ahr.target(),
+                                                                                       'usr':row.my.ahr.usr(),
+                                                                               })
+                                                                       );
+                                                                       if (typeof params.on_retrieve == 'function') { params.on_retrieve(row); }
+
+                                                               } catch(E) {
+                                                                       obj.error.standard_unexpected_error_alert('Error retrieving details for hold #' + row.my.hold_id, E);
+                                                               }
+                                                       }
+                                               );
+                                               /*
                                                obj.network.simple_request('FM_AHR_RETRIEVE', [ ses(), row.my.hold_id ],
                                                        function(ahr_req) {
                                                                try {
@@ -167,7 +199,7 @@ patron.holds.prototype = {
                                                                }
                                                        }
                                                );
-
+                                               */
                                        } catch(E) {
                                                obj.error.sdump('D_ERROR','retrieve_row: ' + E );
                                        }