From 7d0fc9920da3aac3eea93777eaec3b26a9e2961d Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 23 Nov 2009 17:13:14 +0000 Subject: [PATCH] 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 git-svn-id: svn://svn.open-ils.org/ILS/trunk@15006 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../web/js/ui/default/circ/selfcheck/selfcheck.js | 28 ++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js b/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js index 145c2c6efe..0330c7aa3a 100644 --- a/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js +++ b/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js @@ -278,7 +278,7 @@ SelfCheckManager.prototype.drawCircPage = function() { } } -SelfCheckManager.prototype.updateHoldsSummary = function(decrement) { +SelfCheckManager.prototype.updateHoldsSummary = function() { if(!this.holdsSummary) { var summary = fieldmapper.standardRequest( @@ -294,9 +294,6 @@ SelfCheckManager.prototype.updateHoldsSummary = function(decrement) { 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 @@ SelfCheckManager.prototype.handleXactResult = function(action, item, result) { 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 @@ SelfCheckManager.prototype.handleXactResult = function(action, item, result) { 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 @@ SelfCheckManager.prototype.handleXactResult = function(action, item, result) { // 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) { /* -- 2.11.0