copy a33100339 into the temp dir selfcheck-staff-mode-deploy-1
authorBill Erickson <berick@esilibrary.com>
Thu, 7 Feb 2013 16:31:52 +0000 (11:31 -0500)
committerBill Erickson <berick@esilibrary.com>
Thu, 7 Feb 2013 16:31:52 +0000 (11:31 -0500)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/web/js/ui/default/circ/selfcheck.staff/selfcheck.js

index 5d6f7a0..0f3eb57 100644 (file)
@@ -589,7 +589,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)
@@ -1339,6 +1342,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) {