[open-ils-commits] r15214 - trunk/Open-ILS/web/js/ui/default/circ/selfcheck (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Dec 21 15:22:40 EST 2009
Author: erickson
Date: 2009-12-21 15:22:35 -0500 (Mon, 21 Dec 2009)
New Revision: 15214
Modified:
trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js
Log:
added support for abort transit -> check in -> check out in self check when COPY_IN_TRANSIT is added to the self-check override list
Modified: trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js 2009-12-21 20:11:28 UTC (rev 15213)
+++ trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js 2009-12-21 20:22:35 UTC (rev 15214)
@@ -828,9 +828,18 @@
);
}
-SelfCheckManager.prototype.checkin = function(barcode) {
+SelfCheckManager.prototype.checkin = function(barcode, abortTransit) {
var resp = fieldmapper.standardRequest(
+ ['open-ils.circ', 'open-ils.circ.transit.abort'],
+ {params : [this.authtoken, {barcode : barcode}]}
+ );
+
+ // resp == 1 on success
+ if(openils.Event.parse(resp))
+ return false;
+
+ var resp = fieldmapper.standardRequest(
['open-ils.circ', 'open-ils.circ.checkin.override'],
{params : [
this.authtoken, {
@@ -971,9 +980,6 @@
} else {
- console.log(js2JSON(result.payload));
- console.log(result.payload.copy.status() +' '+overrideEvents);
-
if( // copy is marked lost. if configured to do so, check it in and try again.
result.payload.copy &&
result.payload.copy.status() == /* LOST */ 3 &&
@@ -1012,6 +1018,16 @@
override = false;
break;
}
+
+ if(result[i].textcode == 'COPY_IN_TRANSIT') {
+ // to override a transit, we have to abort the transit and check it in first
+ if(this.checkin(item, true)) {
+ return { doOver : true };
+ } else {
+ override = false;
+ }
+
+ }
}
if(override)
More information about the open-ils-commits
mailing list