From: Bill Erickson Date: Wed, 3 Jul 2019 18:34:39 +0000 (-0400) Subject: LP1752356 Offline expired patrons download date additions X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=53fd9478eff64697734441698948d588ae7534e0;p=evergreen%2Fpines.git LP1752356 Offline expired patrons download date additions 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 Signed-off-by: Terran McCanna Signed-off-by: Jason Boyer --- diff --git a/Open-ILS/src/templates/staff/offline-interface.tt2 b/Open-ILS/src/templates/staff/offline-interface.tt2 index dae9b17a2b..20ae7f6e31 100644 --- a/Open-ILS/src/templates/staff/offline-interface.tt2 +++ b/Open-ILS/src/templates/staff/offline-interface.tt2 @@ -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}}') %]"; }]); diff --git a/Open-ILS/web/js/ui/default/staff/offline.js b/Open-ILS/web/js/ui/default/staff/offline.js index 371d439dbf..099c1e15ed 100644 --- a/Open-ILS/web/js/ui/default/staff/offline.js +++ b/Open-ILS/web/js/ui/default/staff/offline.js @@ -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],