I need accessors for OpenILS.data that can network retrieve and cache objects.. and...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 31 Jul 2006 20:52:55 +0000 (20:52 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 31 Jul 2006 20:52:55 +0000 (20:52 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5197 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/circ/checkout.js
Open-ILS/xul/staff_client/server/circ/util.js
Open-ILS/xul/staff_client/server/patron/items.js

index 5016c1d..e15456a 100644 (file)
@@ -350,7 +350,10 @@ circ.checkout.prototype = {
                                        ],
                                        'text' : {
                                                '7004' : function(r) {
-                                                       return obj.data.hash.ccs[ r.payload ].name();
+                                                       //return obj.data.hash.ccs[ r.payload ].name();
+                                                       return r.payload.status().name();
+                                                       //return r.payload.name();
+                                                       //return r.payload;
                                                },
                                                '7010' : function(r) {
                                                        return r.payload;
@@ -436,7 +439,7 @@ circ.checkout.prototype = {
                                                        found_handled = true;
                                                break;
                                                case 7004 /* COPY_NOT_AVAILABLE */ :
-                                                       msg += test_permit[i].desc + '\n' + 'Copy status = ' + obj.data.hash.ccs[ test_permit[i].payload ].name() + '\n';
+                                                       msg += test_permit[i].desc + '\n' + 'Copy status = ' + ( test_permit[i].payload.status().name() ) + '\n';
                                                        found_handled = true;
                                                break;
                                                case 7006 /* COPY_IS_REFERENCE */ :
index c877a34..174162a 100644 (file)
@@ -680,7 +680,8 @@ circ.util.checkin_via_barcode = function(session,barcode,backdate,auto_print) {
                                ],
                                'text' : {
                                        '1203' : function(r) {
-                                               return data.hash.ccs[ r.payload.status() ].name();
+                                               //return data.hash.ccs[ r.payload.status() ].name();
+                                               return r.payload.status().name();
                                        },
                                        '7010' : function(r) {
                                                return r.payload;
@@ -699,12 +700,12 @@ circ.util.checkin_via_barcode = function(session,barcode,backdate,auto_print) {
 
                /* SUCCESS  /  NO_CHANGE  /  ITEM_NOT_CATALOGED */
                if (check.ilsevent == 0 || check.ilsevent == 3 || check.ilsevent == 1202) {
-                       check.route_to = data.hash.acpl[ check.copy.location() ].name();
+                       try { check.route_to = data.hash.acpl[ check.copy.location() ].name(); } catch(E) { msg += 'FIXME: ' + E + '\n'; }
                        var msg = '';
                        if (check.ilsevent == 3) msg = 'This item is already checked in.\n';
                        if (check.ilsevent == 1202 && check.copy.status() != 11) {
                                msg = 'FIXME -- ITEM_NOT_CATALOGED event but copy status is '
-                                       + data.hash.ccs[ check.copy.status() ].name() + '\n';
+                                       + (data.hash.ccs[ check.copy.status() ] ? data.hash.ccs[ check.copy.status() ].name() : check.copy.status().name() ) + '\n';
                        }
                        switch(check.copy.status()) {
                                case 0: /* AVAILABLE */
@@ -761,7 +762,7 @@ circ.util.checkin_via_barcode = function(session,barcode,backdate,auto_print) {
                                        msg += 'This item needs to be routed to ' + check.route_to + '.';
                                break;
                                default:
-                                       msg += ('FIXME -- this case "' + data.hash.ccs[check.copy.status()].name() + '" is unhandled.\n');
+                                       msg += ('FIXME -- this case "' + (data.hash.ccs[check.copy.status()] ? data.hash.ccs[check.copy.status()].name() : check.copy.status().name()) + '" is unhandled.\n');
                                        msg += 'This item needs to be routed to ' + check.route_to + '.';
                                break;
                        }
index dbd9d1b..1874f5d 100644 (file)
@@ -121,7 +121,9 @@ patron.items.prototype = {
                                                                return r.payload;
                                                        },
                                                        '7004' : function(r) {
-                                                               return obj.data.hash.ccs[ r.payload ].name();
+                                                               //return obj.data.hash.ccs[ r.payload ].name();
+                                                               return r.payload.status().name();
+                                                               //return r.payload.name();
                                                        },
                                                }
                                        }