From f38509c2fba7b035f19d75100d565aa4f124f498 Mon Sep 17 00:00:00 2001 From: Billy Horn Date: Fri, 18 Nov 2016 13:04:24 -0800 Subject: [PATCH] LP#1526163 Web staff supports auto-renewl option Automatically renew an item from the client when the auto-renew toggle is returned by the server during a checkout call. Avoid modifying the items out counts in the UI when an item is auto-renewed. Signed-off-by: Billy Horn Signed-off-by: Bill Erickson Signed-off-by: Kathy Lussier --- Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js | 7 +++++-- Open-ILS/web/js/ui/default/staff/circ/services/circ.js | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js b/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js index a32687e336..549933baf0 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js @@ -151,8 +151,11 @@ function($scope , $q , $routeParams , egCore , egUser , patronSvc , function(co_resp) { // update stats locally so we don't have to fetch them w/ // each checkout. - patronSvc.patron_stats.checkouts.out++; - patronSvc.patron_stats.checkouts.total_out++; + //check for renew so that is doesn't update incorrectly + if(co_resp.evt[0].payload.parent_circ == null){ + patronSvc.patron_stats.checkouts.out++; + patronSvc.patron_stats.checkouts.total_out++; + } // copy the response event into the original grid row item // note: angular.copy clobbers the destination diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js index c32cf6f300..08ce484a92 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js +++ b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js @@ -460,6 +460,9 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog, return service.precat_dialog(params, options); case 'OPEN_CIRCULATION_EXISTS': + if(evt[0].payload.auto_renew == 1){ + return service.renew(params, options); + } egCore.audio.play('error.checkout.open_circ'); return service.circ_exists_dialog(evt, params, options); -- 2.11.0