LP#1522599 add visual indicator for an expired patron
authorBilly Horn <bhorn@catalystdevworks.com>
Wed, 5 Oct 2016 17:41:33 +0000 (10:41 -0700)
committerKathy Lussier <klussier@masslnc.org>
Tue, 22 Nov 2016 19:10:06 +0000 (14:10 -0500)
Add checkAlerts to getPrimary
Add alert styling to index patron for any active alert
Add alert styling to expire date in patron summary

Signed-off-by: Billy Horn <bhorn@catalystdevworks.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/templates/staff/circ/patron/index.tt2
Open-ILS/src/templates/staff/circ/patron/t_summary.tt2
Open-ILS/web/js/ui/default/staff/circ/patron/app.js

index ebde904..50c8bd7 100644 (file)
@@ -68,7 +68,8 @@ angular.module('egCoreMod').run(['egStrings', function(s) {
     <div ng-show="patron()">
       <h4 title="{{patron().id()}}">
         <div class="flex-row">
-          <div class="flex-cell">
+          <div class="flex-cell"
+          ng-class="{'patron-summary-alert' : hasAlerts()}">
             [% l('[_1], [_2] [_3]', 
                 '{{patron().family_name()}}',
                 '{{patron().first_given_name()}}',
index 606687d..c67e1de 100644 (file)
@@ -57,7 +57,8 @@
       <div class="col-md-5">[% l('Create Date') %]</div>
       <div class="col-md-7">{{patron().create_date() | date:'shortDate'}}</div>
     </div>
-    <div class="row">
+    <div class="row"
+      ng-class="{'patron-summary-alert' : isPatronExpired()}">
       <div class="col-md-5">[% l('Expire Date') %]</div>
       <div class="col-md-7">{{patron().expire_date() | date:'shortDate'}}</div>
     </div>
index bb514c4..bc2f390 100644 (file)
@@ -298,6 +298,7 @@ function($q , $timeout , $location , egCore,  egUser , $locale) {
 
         service.getPrimary(id, user, force)
         .then(function() {
+            service.checkAlerts();
             var p = service.primaryUserPromise;
             service.primaryUserId = null;
             // clear before resolution just to be safe.
@@ -651,6 +652,8 @@ function($scope,  $q,  $location , $filter,  egCore,  egUser,  patronSvc) {
     $scope.patron = function() { return patronSvc.current }
     $scope.patron_stats = function() { return patronSvc.patron_stats }
     $scope.summary_stat_cats = function() { return patronSvc.summary_stat_cats }
+    $scope.hasAlerts = function() { return patronSvc.hasAlerts }
+    $scope.isPatronExpired = function() { return patronSvc.patronExpired }
 
     $scope.print_address = function(addr) {
         egCore.print.print({