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 <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Matt Blenkinsop 2023-02-15 15:48:34 +00:00 committed by Tomas Cohen Arazi
parent 508ad15cb7
commit 561dac9335
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
3 changed files with 3 additions and 1 deletions

View file

@ -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" ) {

View file

@ -58,7 +58,7 @@
[% IF ( userdebarred ) %]
<li class="userdebarred blocker">
<span class="circ-hlt"> Restricted:</span> Patron's account is restricted
<span class="circ-hlt"> Restricted since [% debarredsince | $KohaDates %]:</span> Patron's account is restricted
[% IF ( userdebarreddate ) %]
until [% userdebarreddate | $KohaDates %]

View file

@ -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" ) {