From c35a3a5780c3cb8234fab2a43203ebf27e09818e Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Wed, 15 Feb 2023 15:48:34 +0000 Subject: [PATCH] Bug 32373: Show patron restriction date This is a rebased submission following bug 31095 which removed the use of GetDebarments. This patch now uses $patron->restrictions to find the date and pass it to the template Test plan: 1) Create a restriction on a patron and navigate to that patron in Checkouts or the patron details page 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. 5) Change the 'dateformat' syspref and refresh, the date should change to reflect the syspref Signed-off-by: Sally Signed-off-by: Laura Escamilla Signed-off-by: Katrin Fischer --- circ/circulation.pl | 1 + koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc | 2 +- members/moremember.pl | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 2cd85b6dad..61065c726d 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -269,6 +269,7 @@ if ($patron) { $template->param( 'userdebarred' => $patron->debarred, 'debarredcomment' => $patron->debarredcomment, + 'debarredsince' => $patron->restrictions->search()->single->created, ); 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 db9c3430fc..19ba6cee80 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 | $KohaDates %]: Patron's account is restricted [% IF ( userdebarreddate ) %] until [% userdebarreddate | $KohaDates %] diff --git a/members/moremember.pl b/members/moremember.pl index 767b1a783b..bf422d7749 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -87,6 +87,7 @@ if ( $patron->is_debarred ) { $template->param( 'userdebarred' => $patron->debarred, 'debarredcomment' => $patron->debarredcomment, + 'debarredsince' => $patron->restrictions->search()->single->created, ); if ( $patron->debarred ne "9999-12-31" ) { -- 2.30.2