LP1752356 Offline expired patrons download date additions
authorBill Erickson <berickxx@gmail.com>
Wed, 3 Jul 2019 18:34:39 +0000 (14:34 -0400)
committerJason Boyer <JBoyer@equinoxOLI.org>
Wed, 8 Sep 2021 19:30:49 +0000 (15:30 -0400)
Modify wording to clarify the date displayed is that of the block list
download and not necessarily the date the patron was flagged expired.

Avoid console errors when the file download date is not known -- edge
case where the code is updated but the block list was not updated in the
meantime.

Clean up some debug logging.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Signed-off-by: Jason Boyer <jboyer@equinoxOLI.org>
Open-ILS/src/templates/staff/offline-interface.tt2
Open-ILS/web/js/ui/default/staff/offline.js

index dae9b17..20ae7f6 100644 (file)
@@ -621,7 +621,7 @@ angular.module('egCoreMod').run(['egStrings', function(s) {
   s.PATRON_BLOCKED_WHY.D = "[% l('Patron has penalties') %]";
   s.PATRON_BLOCKED_WHY.L = "[% l('Barcode is reported Lost') %]";
   s.PATRON_BLOCKED_WHY.E = "[% l('Patron account is Expired') %]";
-  s.PATRON_BLOCKED_WHY.B = "[% l('Warning: as of [_1], this barcode ([_2]) was flagged Expired.', '{{formatted_date}}', '{{pbarcode}}') %]";
+  s.PATRON_BLOCKED_WHY.B = "[% l('Warning: Barcode [_2] was flagged Expired in block list downloaded [_1].', '{{formatted_date}}', '{{pbarcode}}') %]";
 
 }]);
 </script>
index 371d439..099c1e1 100644 (file)
@@ -302,12 +302,13 @@ function($routeProvider , $locationProvider , $compileProvider) {
 
         egLovefield.getOfflineBlockDate().then(
             function(blockListDateResp) {
-                $scope.blockListDate = Math.round(blockListDateResp.getTime()/1000);
-                console.log("get blocklistdate=");
-                console.log($scope.blockListDate)
+                if (blockListDateResp) {
+                    $scope.blockListDate =
+                        Math.round(blockListDateResp.getTime() / 1000);
+                }
             },
             function() {
-                console.log("Error when retrieving block list download date");                    
+                console.error("Error when retrieving block list download date");
             }
         );
 
@@ -607,7 +608,9 @@ function($routeProvider , $locationProvider , $compileProvider) {
                         egCore.org.settings(['format.date']).then(function(set) {
                             if (set && set['format.date']) default_format = set['format.date'];
                             $scope.date_format = default_format;
-                            var fBlockListDate = $filter('date')(($scope.blockListDate * 1000), $scope.date_format)
+                            var fBlockListDate = $scope.blockListDate ?
+                                $filter('date')(($scope.blockListDate * 1000), $scope.date_format) :
+                                null;
                             egConfirmDialog.open(
                                 egCore.strings.PATRON_BLOCKED,
                                 egCore.strings.PATRON_BLOCKED_WHY[blocked],