From ed22e55698cfdd04949b762a8e8a5c805d7e4a68 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Thu, 22 Dec 2022 15:22:24 +0000 Subject: [PATCH] Bug 32373: Show patron restriction date When viewing a patron account with a restriction there is no way to see when the restriction was placed. This is available in the borrower_debarrments table and has now been added to the UI. Test plan: 1) Create a restriction on a patron and navigate to that patron in Checkouts 2) There should be a message with details about the restriction but the creation date of the restriction won't be included in the message 3) Apply patch 4) The message should now say "Restricted since DATE" as in the screenshot attached. --- circ/circulation.pl | 4 ++++ koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index b7270bfe56a..ddccf32828f 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -54,6 +54,7 @@ use Koha::Items; use Koha::SearchEngine; use Koha::SearchEngine::Search; use Koha::Patron::Modifications; +use Data::Dumper qw( Dumper ); use List::MoreUtils qw( uniq ); @@ -265,10 +266,13 @@ if ($patron) { finetotal => $balance, ); + my $debarrment = @{ GetDebarments( { borrowernumber => $borrowernumber } ) }[0] || undef; + my $debarrmentdate = substr($debarrment->{created}, 0, 10) if $debarrment; if ( $patron and $patron->is_debarred ) { $template->param( 'userdebarred' => $patron->debarred, 'debarredcomment' => $patron->debarredcomment, + 'debarredsince' => $debarrmentdate ); if ( $patron->debarred ne "9999-12-31" ) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc index db9c3430fcf..a72932b62c2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc @@ -58,7 +58,7 @@ [% IF ( userdebarred ) %]
  • - Restricted: Patron's account is restricted + Restricted since [% debarredsince %]: Patron's account is restricted [% IF ( userdebarreddate ) %] until [% userdebarreddate | $KohaDates %] -- 2.37.1 (Apple Git-137.1)