[open-ils-commits] [GIT] Evergreen ILS branch master updated. 22891eb1dccb101e097f355b344e1aac20e1ef9d

Evergreen Git git at git.evergreen-ils.org
Sun Mar 5 22:01:33 EST 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  22891eb1dccb101e097f355b344e1aac20e1ef9d (commit)
       via  f38509c2fba7b035f19d75100d565aa4f124f498 (commit)
      from  5134f0cfcdc97a210250d92a0e9c3593314eda9a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 22891eb1dccb101e097f355b344e1aac20e1ef9d
Author: Bill Erickson <berickxx at gmail.com>
Date:   Fri Feb 3 14:26:09 2017 -0500

    LP#1526163 Web staff supports auto-renew tweaks
    
    Initiate the auto-renewal earlier in the checkout process, specifically
    before response data is unnecessarily fleshed.  Add an explicit
    auto_renew toggle to the checkout response blob to more clearly indicate
    why checkout counts are not modified.
    
    Additional code comments and logging.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>

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 549933b..8fc38de 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,10 @@ function($scope , $q , $routeParams , egCore , egUser , patronSvc ,
             function(co_resp) {
                 // update stats locally so we don't have to fetch them w/
                 // each checkout.
-                //check for renew so that is doesn't update incorrectly
-                if(co_resp.evt[0].payload.parent_circ == null){
+
+                // Avoid updating checkout counts when a checkout turns
+                // into a renewal via auto_renew.
+                if (!co_resp.auto_renew) {
                     patronSvc.patron_stats.checkouts.out++;
                     patronSvc.patron_stats.checkouts.total_out++;
                 }
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 08ce484..62b6502 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
@@ -143,6 +143,13 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,
 
                 if (!angular.isArray(evt)) evt = [evt];
 
+                if (evt[0].payload && evt[0].payload.auto_renew == 1) {
+                    // open circulation found with auto-renew toggle on.
+                    console.debug('Auto-renewing item ' + params.copy_barcode);
+                    options.auto_renew = true;
+                    return service.renew(params, options);
+                }
+
                 return service.flesh_response_data('checkout', evt, params, options)
                 .then(function() {
                     return service.handle_checkout_resp(evt, params, options);
@@ -188,6 +195,7 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,
                     return service.handle_renew_resp(evt, params, options);
                 })
                 .then(function(final_resp) {
+                    final_resp.auto_renew = options.auto_renew;
                     return service.munge_resp_data(final_resp,'renew',method)
                 })
             });
@@ -460,9 +468,7 @@ 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);
-                }
+                // auto_renew checked in service.checkout()
                 egCore.audio.play('error.checkout.open_circ');
                 return service.circ_exists_dialog(evt, params, options);
 

commit f38509c2fba7b035f19d75100d565aa4f124f498
Author: Billy Horn <bhorn at catalystdevworks.com>
Date:   Fri Nov 18 13:04:24 2016 -0800

    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 <bhorn at catalystdevworks.com>
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>

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 a32687e..549933b 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 c32cf6f..08ce484 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);
 

-----------------------------------------------------------------------

Summary of changes:
 .../js/ui/default/staff/circ/patron/checkout.js    |    9 +++++++--
 .../web/js/ui/default/staff/circ/services/circ.js  |    9 +++++++++
 2 files changed, 16 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list