[open-ils-commits] r11813 - in trunk/Open-ILS/xul/staff_client: chrome/content/util server/circ
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Jan 13 12:39:08 EST 2009
Author: phasefx
Date: 2009-01-13 12:39:05 -0500 (Tue, 13 Jan 2009)
New Revision: 11813
Modified:
trunk/Open-ILS/xul/staff_client/chrome/content/util/network.js
trunk/Open-ILS/xul/staff_client/server/circ/checkout.js
trunk/Open-ILS/xul/staff_client/server/circ/util.js
Log:
handle custom events (which have ilsevent == null)
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/util/network.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/util/network.js 2009-01-13 16:55:44 UTC (rev 11812)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/util/network.js 2009-01-13 17:39:05 UTC (rev 11813)
@@ -412,12 +412,12 @@
var result = obj.get_result(req);
if (!result) return req;
- if ( (typeof result.ilsevent != 'undefined') && (override_params.overridable_events.indexOf( Number(result.ilsevent) ) != -1) ) {
+ if ( (typeof result.ilsevent != 'undefined') && (override_params.overridable_events.indexOf( result.ilsevent == null ? null : Number(result.ilsevent) ) != -1) ) {
req = override([result]);
} else {
var found_good = false; var found_bad = false;
for (var i = 0; i < result.length; i++) {
- if ( (result[i].ilsevent != 'undefined') && (override_params.overridable_events.indexOf( Number(result[i].ilsevent) ) != -1) ) {
+ if ( (result[i].ilsevent != 'undefined') && (override_params.overridable_events.indexOf( result.ilsevent == null ? null : Number(result[i].ilsevent) ) != -1) ) {
found_good = true;
} else {
found_bad = true;
Modified: trunk/Open-ILS/xul/staff_client/server/circ/checkout.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/checkout.js 2009-01-13 16:55:44 UTC (rev 11812)
+++ trunk/Open-ILS/xul/staff_client/server/circ/checkout.js 2009-01-13 17:39:05 UTC (rev 11813)
@@ -558,6 +558,7 @@
{
'title' : document.getElementById('circStrings').getString('staff.circ.checkout.override.confirm'),
'overridable_events' : [
+ null /* custom event */,
1212 /* PATRON_EXCEEDS_OVERDUE_COUNT */,
1213 /* PATRON_BARRED */,
1215 /* CIRC_EXCEEDS_COPY_RANGE */,
@@ -672,7 +673,10 @@
for (var i = 0; i < test_permit.length; i++) {
dump('found [' + test_permit[i].ilsevent + ']\n');
- switch(Number(test_permit[i].ilsevent)) {
+ switch(test_permit[i].ilsevent == null ? null : Number(test_permit[i].ilsevent)) {
+ case null /* custom event */ :
+ found_handled = true;
+ break;
case 1212 /* PATRON_EXCEEDS_OVERDUE_COUNT */ :
found_handled = true;
break;
Modified: trunk/Open-ILS/xul/staff_client/server/circ/util.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/util.js 2009-01-13 16:55:44 UTC (rev 11812)
+++ trunk/Open-ILS/xul/staff_client/server/circ/util.js 2009-01-13 17:39:05 UTC (rev 11813)
@@ -1907,6 +1907,7 @@
{
'title' : document.getElementById('circStrings').getString('staff.circ.utils.checkin.override'),
'overridable_events' : [
+ null /* custom event */,
1203 /* COPY_BAD_STATUS */,
1213 /* PATRON_BARRED */,
1217 /* PATRON_INACTIVE */,
@@ -2275,6 +2276,7 @@
error.standard_network_error_alert(document.getElementById('circStrings').getString('staff.circ.checkin.suggest_offline'));
} else {
+ if (check.ilsevent == null) { return null; /* handled */ }
switch (Number(check.ilsevent)) {
case 1203 /* COPY_BAD_STATUS */ :
case 1213 /* PATRON_BARRED */ :
@@ -2316,8 +2318,9 @@
var renew = req.getResultObject();
if (typeof renew.ilsevent != 'undefined') renew = [ renew ];
for (var j = 0; j < renew.length; j++) {
- switch(Number(renew[j].ilsevent)) {
+ switch(renew[j].ilsevent == null ? null : Number(renew[j].ilsevent)) {
case 0 /* SUCCESS */ : break;
+ case null /* custom event */ : break;
case 5000 /* PERM_FAILURE */: break;
case 1212 /* PATRON_EXCEEDS_OVERDUE_COUNT */ : break;
case 1213 /* PATRON_BARRED */ : break;
@@ -2357,6 +2360,7 @@
{
'title' : document.getElementById('circStrings').getString('staff.circ.checkin.renew_failed.override'),
'overridable_events' : [
+ null /* custom event */,
1212 /* PATRON_EXCEEDS_OVERDUE_COUNT */,
1213 /* PATRON_BARRED */,
1215 /* CIRC_EXCEEDS_COPY_RANGE */,
More information about the open-ils-commits
mailing list