[open-ils-commits] r15006 - trunk/Open-ILS/web/js/ui/default/circ/selfcheck (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Nov 23 12:13:17 EST 2009


Author: erickson
Date: 2009-11-23 12:13:14 -0500 (Mon, 23 Nov 2009)
New Revision: 15006

Modified:
   trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js
Log:
now updating circ and hold summary numbers.  during checkout, update the total and session checkout number.  if a hold is captured during checkout, update the hold numbers to reflect the change

Modified: trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js	2009-11-23 16:41:27 UTC (rev 15005)
+++ trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js	2009-11-23 17:13:14 UTC (rev 15006)
@@ -278,7 +278,7 @@
     }
 }
 
-SelfCheckManager.prototype.updateHoldsSummary = function(decrement) {
+SelfCheckManager.prototype.updateHoldsSummary = function() {
 
     if(!this.holdsSummary) {
         var summary = fieldmapper.standardRequest(
@@ -294,9 +294,6 @@
             this.holdsSummary.total += Number(summary[i]);
     }
 
-    if(this.decrement) 
-        this.holdsSummary.ready -= 1;
-
     dojo.byId('oils-selfck-holds-total').innerHTML = 
         dojo.string.substitute(
             localeStrings.TOTAL_HOLDS, 
@@ -500,6 +497,8 @@
     var popup = false;  
 
     // TODO handle lost/missing/etc checkin+checkout override steps
+    
+    var payload = result.payload || {};
         
     if(result.textcode == 'NO_SESSION') {
 
@@ -509,15 +508,22 @@
 
         if(action == 'checkout') {
 
-            displayText = dojo.string.substitute(
-                localeStrings.CHECKOUT_SUCCESS, [item]);
-                this.displayCheckout(result, 'checkout');
+            displayText = dojo.string.substitute(localeStrings.CHECKOUT_SUCCESS, [item]);
+            this.displayCheckout(result, 'checkout');
 
+            if(payload.holds_fulfilled && payload.holds_fulfilled.length) {
+                // A hold was fulfilled, update the hold numbers in the circ summary
+                console.log("fulfilled hold " + payload.holds_fulfilled + " during checkout");
+                this.holdsSummary = null;
+                this.updateHoldsSummary();
+            }
+
+            this.updateCircSummary(true);
+
         } else if(action == 'renew') {
 
-            displayText = dojo.string.substitute(
-                localeStrings.RENEW_SUCCESS, [item]);
-                this.displayCheckout(result, 'renew');
+            displayText = dojo.string.substitute(localeStrings.RENEW_SUCCESS, [item]);
+            this.displayCheckout(result, 'renew');
         }
 
         this.updateScanBox();
@@ -527,8 +533,6 @@
         // Server says the item is already checked out.  If it's checked out to the
         // current user, we may need to renew it.  
 
-        var payload = result.payload || {};
-
         if(payload.old_circ) { 
 
             /*



More information about the open-ils-commits mailing list