From 3bc23d8fcf6c5bf0666cb204d3c4b009db562476 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 11 Jul 2022 14:06:44 -0400 Subject: [PATCH] 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 --- Open-ILS/src/templates/staff/circ/patron/index.tt2 | 5 ++++ .../web/js/ui/default/staff/circ/patron/app.js | 28 ++++++++++++++++++++-- docs/RELEASE_NOTES_NEXT/miscellaneous.adoc | 3 +++ 3 files changed, 34 insertions(+), 2 deletions(-) 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 e69de29bb2..ff00e6c872 100644 --- a/docs/RELEASE_NOTES_NEXT/miscellaneous.adoc +++ b/docs/RELEASE_NOTES_NEXT/miscellaneous.adoc @@ -0,0 +1,3 @@ +* The Field Documentation interface (under Local Administration) has + been ported to Angular with an org selector as an additional filter. +* Patron Interface Gets a New Penalty Refresh Action -- 2.11.0