LP#1715423 - fix issues with the display of IDs in patron summary pane
authorCesar Velez <cesar.velez@equinoxinitiative.org>
Thu, 28 Sep 2017 14:48:58 +0000 (10:48 -0400)
committerMike Rylander <mrylander@gmail.com>
Tue, 17 Oct 2017 17:53:46 +0000 (13:53 -0400)
The Patron summary pane was not properly displaying the values
for the primary ID and secondary ID. Also added the type name of
the ID in next to primary ID label.

Signed-off by: Cesar Velez <cesar.velez@equinoxinitiative.org>

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/templates/staff/circ/patron/t_summary.tt2
Open-ILS/web/js/ui/default/staff/circ/patron/app.js

index 632f50b..9d55e17 100644 (file)
       <div class="col-md-7">{{patron().other_phone()}}</div>
     </div>
     <div class="row">
-      <div class="col-md-5">[% l('ID1') %]</div>
-      <div class="col-md-7">{{patron().ident_type().name()}}</div>
+      <div class="col-md-5">[% l('ID1') %]&nbsp;<span ng-if="hasIdentTypeName" class="ident_type">({{patron().ident_type().name()}})</span></div>
+      <div class="col-md-7">{{patron().ident_value()}}</div>
     </div>
     <div class="row">
       <div class="col-md-5">[% l('ID2') %]</div>
-      <div class="col-md-7">{{patron().ident_type2().name()}}</div>
+      <div class="col-md-7">{{patron().ident_value2()}}</div>
     </div>
     <div class="row">
       <div class="col-md-5">[% l('Email') %]</div>
index 705a4a7..4d4c728 100644 (file)
@@ -292,7 +292,11 @@ function($scope,  $q , $location , $filter , egCore , egNet , egUser , egAlertDi
             $scope.patron_id = patron_id;
             return patronSvc.setPrimary($scope.patron_id)
             .then(function() {return patronSvc.checkAlerts()})
-            .then(redirectToAlertPanel);
+            .then(redirectToAlertPanel)
+            .then(function(){
+                $scope.ident_type_name = $scope.patron().ident_type().name()
+                $scope.hasIdentTypeName = $scope.ident_type_name.length > 0;
+            });
         }
         return $q.when();
     }