selfcheck staff mode : staff mode checkout auto-override / transit abort
authorBill Erickson <berick@esilibrary.com>
Thu, 7 Feb 2013 15:45:17 +0000 (10:45 -0500)
committerBill Erickson <berick@esilibrary.com>
Thu, 7 Feb 2013 15:45:17 +0000 (10:45 -0500)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js

index 3a40153..09b29c5 100644 (file)
@@ -593,7 +593,10 @@ SelfCheckManager.prototype.drawCircPage = function() {
     var self = this;
     this.updateScanBox({
         msg : dojo.string.substitute(localeStrings.CHECKOUT_PROMPT),
-        handler : function(barcode) { self.checkout(barcode); }
+        handler : function(barcode) { 
+            // staffMode jumps straight to override
+            self.checkout(barcode, self.staffMode); 
+        }
     });
 
     if(!this.circTemplate)
@@ -1506,6 +1509,20 @@ SelfCheckManager.prototype.handleXactResult = function(action, item, result) {
 
     } else {
 
+
+        if (this.staffMode) {
+            // in staff mode we override everything.  Transits, however, 
+            // can't be overridden.  They must first be aborted and checked in.
+
+            if(!result.length) result = [result];
+
+            for(var i = 0; i < result.length; i++) {
+                if(result[i].textcode == 'COPY_IN_TRANSIT') {
+                    if(this.inlineCheckinCopy(item, true)) 
+                        return { override : true };
+                }
+            }
+        }
     
         if(overrideEvents && overrideEvents.length) {