[open-ils-commits] r18897 - trunk/Open-ILS/xul/staff_client/server/circ (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Dec 1 14:11:46 EST 2010


Author: dbs
Date: 2010-12-01 14:11:41 -0500 (Wed, 01 Dec 2010)
New Revision: 18897

Modified:
   trunk/Open-ILS/xul/staff_client/server/circ/checkout.js
Log:
Return the copy status name when a copy is not available

It looks like the checkout operation used to return a fleshed
config.copy_status object, but that changed and we now get a
raw ccs ID back.

Retrieve the status name using the ccs ID and present that
to the users. Also, in case problems like this happen in
the future, provide a more specific error message and var
name so that it will be (hopefully!) a little clearer what
payload was expected in the first place :)

Resolves https://bugs.launchpad.net/evergreen/+bug/680575

Thanks to Jason Etheridge for a major assist with this bug.


Modified: trunk/Open-ILS/xul/staff_client/server/circ/checkout.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/checkout.js	2010-12-01 13:52:28 UTC (rev 18896)
+++ trunk/Open-ILS/xul/staff_client/server/circ/checkout.js	2010-12-01 19:11:41 UTC (rev 18897)
@@ -641,9 +641,10 @@
                         },
                         '7004' : function(r) {
                             try {
-                                return r.payload.status().name();
+                                status_name = obj.data.hash.ccs[ r.payload.status() ].name();
+                                return status_name;
                             } catch (E) {
-                                return "copy not available: (Unexpected error: payload not available)";  // XXX
+                                return "Could not retrieve the name of the current status for the copy";  // XXX
                             }
                         },
                         '7010' : function(r) {
@@ -800,7 +801,7 @@
                             found_handled = true;
                         break;
                         case 7004 /* COPY_NOT_AVAILABLE */ :
-                            msg += test_permit[i].desc + '\n' + document.getElementById('circStrings').getFormattedString('staff.circ.checkout.copy_status', [test_permit[i].payload.status().name()]) + '\n';
+                            msg += test_permit[i].desc + '\n' + document.getElementById('circStrings').getFormattedString('staff.circ.checkout.copy_status', [obj.data.hash.ccs [test_permit[i].payload.status() ].name()]) + '\n';
                             found_handled = true;
                         break;
                         case 7006 /* COPY_IS_REFERENCE */ :



More information about the open-ils-commits mailing list