From: Bill Erickson Date: Mon, 11 Jul 2022 18:06:44 +0000 (-0400) Subject: LP1823225 Patron Penalty Refresh Action X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=abf033c19050af93973a2d204378918cc6253749;p=evergreen%2Fmasslnc.git LP1823225 Patron Penalty Refresh Action New menu entry added under the 'Other' menu for patrons. It refreshes the patron's penalties and reloads the patron to ensure all needed data is refreshed. Signed-off-by: Bill Erickson Signed-off-by: John Amundson Signed-off-by: Michele Morgan --- diff --git a/Open-ILS/src/templates/staff/circ/patron/index.tt2 b/Open-ILS/src/templates/staff/circ/patron/index.tt2 index c2a548a847..7df2df7453 100644 --- a/Open-ILS/src/templates/staff/circ/patron/index.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/index.tt2 @@ -87,6 +87,8 @@ angular.module('egCoreMod').run(['egStrings', function(s) { s.TEST_NOTIFY_SUCCESS = "[% l('Test Notification sent') %]"; s.TEST_NOTIFY_FAIL = "[% l('Test Notification failed to send') %]"; s.REMOVE_HOLD_SUBSCRIPTIONS = "[% l('Remove selected Hold Groups for user?') %]"; + s.PENALTY_REFRESH_FAILED = "[% l('Penalty Refresh Failed') %]"; + s.PENALTY_REFRESH_SUCCESS = "[% l('Penalty Refresh Succeeded') %]"; }]); @@ -179,6 +181,9 @@ angular.module('egCoreMod').run(['egStrings', function(s) {
  • + [% l('Refresh Penalties') %] +
  • +
  • [% l('Display Alerts') %] 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 37247ef4bb..7914bca35c 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 @@ -233,8 +233,10 @@ angular.module('egPatronApp', ['ngRoute', 'ui.bootstrap', 'egUserBucketMod', * * */ .controller('PatronCtrl', - ['$scope','$q','$location','$filter','egCore','egNet','egUser','egAlertDialog','egConfirmDialog','egPromptDialog','patronSvc','egCirc','hasPermAt', -function($scope, $q , $location , $filter , egCore , egNet , egUser , egAlertDialog , egConfirmDialog , egPromptDialog , patronSvc , egCirc , hasPermAt) { + ['$scope','$q','$location','$filter','egCore','egNet','egUser','egAlertDialog', + 'egConfirmDialog','egPromptDialog','patronSvc','egCirc','hasPermAt','ngToast', +function($scope, $q , $location , $filter , egCore , egNet , egUser , egAlertDialog , + egConfirmDialog , egPromptDialog , patronSvc , egCirc , hasPermAt, ngToast) { $scope.is_patron_edit = function() { return Boolean($location.path().match(/patron\/\d+\/edit$/)); @@ -472,6 +474,28 @@ function($scope, $q , $location , $filter , egCore , egNet , egUser , egAlertDi }); } + $scope.refreshPenalties = function() { + + egNet.request( + 'open-ils.actor', + 'open-ils.actor.user.penalties.update', + egCore.auth.token(), $scope.patron().id() + + ).then(function(resp) { + + if (evt = egCore.evt.parse(resp)) { + ngToast.warning(egCore.strings.PENALTY_REFRESH_FAILED); + console.error(evt); + } + + ngToast.create(egCore.strings.PENALTY_REFRESH_SUCCESS); + + // Depending on which page we're on (e.g. Note/Messages) we + // may need to force a full data refresh. + setTimeout(function() { location.href = location.href; }); + }); + } + egCore.hatch.getItem('eg.circ.patron.summary.collapse') .then(function(val) {$scope.collapsePatronSummary = Boolean(val)}); }]) diff --git a/docs/RELEASE_NOTES_NEXT/miscellaneous.adoc b/docs/RELEASE_NOTES_NEXT/miscellaneous.adoc index 27b280793a..a56b9dd231 100644 --- a/docs/RELEASE_NOTES_NEXT/miscellaneous.adoc +++ b/docs/RELEASE_NOTES_NEXT/miscellaneous.adoc @@ -2,3 +2,4 @@ been ported to Angular with an org selector as an additional filter. * The Pending Users and Bucket View grids in the User Buckets interface now includes a column for the patron's balance owed. (LP#1980257) +* Patron Interface Gets a New Penalty Refresh Action