[open-ils-commits] [GIT] Evergreen ILS branch master updated. 2652801981e9505ac05dde0fc2129eb6bc3e1582

Evergreen Git git at git.evergreen-ils.org
Thu Nov 17 21:28:01 EST 2016


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  2652801981e9505ac05dde0fc2129eb6bc3e1582 (commit)
      from  8defb7f475216294d9c1e1a9390f98c75608d4e3 (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 2652801981e9505ac05dde0fc2129eb6bc3e1582
Author: Billy Horn <bhorn at catalystdevworks.com>
Date:   Tue Oct 4 14:45:30 2016 -0700

    LP#1621799: disable checkout for inactive patrons
    
    Add search_barcode variable to patronSvc
    Add function fetchedWithInactiveCard to patronSvc
    Add check to disable checkout for fetchedWithInactiveCard
    
    Signed-off-by: Billy Horn <bhorn at catalystdevworks.com>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>

diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js
index 350a48a..356bdfe 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js
@@ -230,7 +230,9 @@ function($q , $timeout , $location , egCore,  egUser , $locale) {
         // event types manually overridden, which should always be
         // overridden for checkouts to this patron for this instance of
         // the interface.
-        checkout_overrides : {},
+        checkout_overrides : {},        
+        //holds the searched barcode
+        search_barcode : null,      
     };
 
     // when we change the default patron, we need to clear out any
@@ -248,7 +250,6 @@ function($q , $timeout , $location , egCore,  egUser , $locale) {
         service.alertsShown = false;
         service.patronExpired = false;
         service.patronExpiresSoon = false;
-        service.retrievedWithInactive = false;
         service.invalidAddresses = false;
     }
     service.resetPatronLists();  // initialize
@@ -417,7 +418,13 @@ function($q , $timeout , $location , egCore,  egUser , $locale) {
 
         return $q.when(fail);
     }
-
+    //resolves to true if the patron was fetched with an inactive card
+    service.fetchedWithInactiveCard = function() {
+        var bc = service.search_barcode
+        var cards = service.current.cards();
+        var card = cards.filter(function(c) { return c.barcode() == bc })[0];
+        return (card && card.active() == 'f');
+    }   
     // resolves to true if there is any aspect of the patron account
     // which should produce a message in the alerts panel
     service.checkAlerts = function() {
@@ -438,14 +445,8 @@ function($q , $timeout , $location , egCore,  egUser , $locale) {
         }
 
         // see if the user was retrieved with an inactive card
-        if (bc = $location.search().card) {
-            var card = p.cards().filter(
-                function(c) { return c.barcode() == bc })[0];
-
-            if (card && card.active() == 'f') {
-                service.hasAlerts = true;
-                service.retrievedWithInactive = true;
-            }
+        if(service.fetchedWithInactiveCard()){
+            service.hasAlerts = true;
         }
 
         // regardless of whether we know of alerts, we still need 
@@ -692,6 +693,7 @@ function($scope , $location , egCore , egConfirmDialog , egUser , patronSvc) {
         $location
         .path('/circ/patron/' + user_id + '/checkout')
         .search('card', $scope.args.barcode);
+        patronSvc.search_barcode = $scope.args.barcode;
     }
 
     // create an opt-in=yes response for the loaded user
@@ -878,7 +880,8 @@ function($scope,  $q,  $routeParams,  $timeout,  $window,  $location,  egCore,
             delete patronSvc.urlSearch;
 
         } else {
-
+            patronSvc.search_barcode = $scope.searchArgs.card;
+            
             var search = compileSearch($scope.searchArgs);
             if (Object.keys(search) == 0) return $q.when();
 
@@ -1302,7 +1305,7 @@ function($scope,  $routeParams , $location , egCore , patronSvc) {
     .then(function() {
         $scope.patronExpired = patronSvc.patronExpired;
         $scope.patronExpiresSoon = patronSvc.patronExpiresSoon;
-        $scope.retrievedWithInactive = patronSvc.retrievedWithInactive;
+        $scope.retrievedWithInactive = patronSvc.fetchedWithInactiveCard();
         $scope.invalidAddresses = patronSvc.invalidAddresses;
     });
 
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 3f82de7..cf3c8f1 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
@@ -30,7 +30,8 @@ function($scope , $q , $routeParams , egCore , egUser , patronSvc ,
             !patronSvc.current ||
             patronSvc.current.active() == 'f' ||
             patronSvc.current.deleted() == 't' ||
-            patronSvc.current.card().active() == 'f'
+            patronSvc.current.card().active() == 'f' ||
+            patronSvc.fetchedWithInactiveCard()
         );
     }
 

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

Summary of changes:
 .../web/js/ui/default/staff/circ/patron/app.js     |   29 +++++++++++---------
 .../js/ui/default/staff/circ/patron/checkout.js    |    3 +-
 2 files changed, 18 insertions(+), 14 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list