From: phasefx Date: Mon, 31 Jul 2006 20:52:55 +0000 (+0000) Subject: I need accessors for OpenILS.data that can network retrieve and cache objects.. and... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=bd1625fcc73129ca43f97a2d23ab10808663d86d;p=Evergreen.git I need accessors for OpenILS.data that can network retrieve and cache objects.. and handle getting objects as params as well ids git-svn-id: svn://svn.open-ils.org/ILS/trunk@5197 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/xul/staff_client/server/circ/checkout.js b/Open-ILS/xul/staff_client/server/circ/checkout.js index 5016c1d8e5..e15456ac90 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkout.js +++ b/Open-ILS/xul/staff_client/server/circ/checkout.js @@ -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 */ : diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js index c877a34d67..174162a6e4 100644 --- a/Open-ILS/xul/staff_client/server/circ/util.js +++ b/Open-ILS/xul/staff_client/server/circ/util.js @@ -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; } diff --git a/Open-ILS/xul/staff_client/server/patron/items.js b/Open-ILS/xul/staff_client/server/patron/items.js index dbd9d1b3d3..1874f5d326 100644 --- a/Open-ILS/xul/staff_client/server/patron/items.js +++ b/Open-ILS/xul/staff_client/server/patron/items.js @@ -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(); }, } }