From 06900135db789ed6a8150c9c207df41c08a6ef20 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Sat, 30 Jul 2022 23:35:50 +0200 Subject: [PATCH] Bug 31272: Use TT plugins for pickup library and due date in opac-reserve.pl Before this patch the date formatting for the due date was done in the .pl instead of the template and the branchcode would show instead of the library's name in the list of items when placing an item level hold in the OPAC. To test: * Find or create a record with mulitple items * Check out one of the items * Place a record level hold * Return an item to set to waiting * Place an item level hold * Go to the OPAC and start placing an item level hold * Verify the messages in the item table show the branchcode * Apply patch * Only visible change should be the library name replacing the branchcode Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 2353893c1acc45c99f5afbe0bde5dcd049d88660) Signed-off-by: Lucas Gass (cherry picked from commit 7459cbd3999f4a4ca97e53473c52c9d28dddbe3d) Signed-off-by: Arthur Suzuki --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt | 8 +++++--- opac/opac-reserve.pl | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt index 4372e295ba..930c2bf75b 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt @@ -417,7 +417,7 @@ [% END %] [% IF ( itemLoo.dateDue ) %] - Due [% itemLoo.dateDue | html %] + Due [% itemLoo.dateDue | $KohaDates as_due_date => 1 %] [% ELSIF ( itemLoo.transfertwhen ) %] In transit from [% Branches.GetName( itemLoo.transfertfrom ) | html %] to [% Branches.GetName( itemLoo.transfertto ) | html %] since [% itemLoo.transfertwhen | html %] [% END %] @@ -433,9 +433,11 @@ [% IF ( itemLoo.reservedate ) %] [% IF ( itemLoo.waitingdate ) %] - Waiting + Waiting for patron at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %] since [% itemLoo.waitingdate | $KohaDates %] + [% ELSIF ( itemLoo.reservedate ) %] + On hold for patron expected at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %] since [% itemLoo.reservedate | $KohaDates %] [% ELSE %] - On hold + On hold for patron expected at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %] [% END %] for patron [% IF ( itemLoo.waitingdate ) %] diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index 366ff0d6bd..d6ba57fc9d 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -507,7 +507,7 @@ foreach my $biblioNum (@biblionumbers) { # change the background color. my $issue = Koha::Checkouts->find( { itemnumber => $itemNum } ); if ( $issue ) { - $itemLoopIter->{dateDue} = output_pref({ dt => dt_from_string($issue->date_due, 'sql'), as_due_date => 1 }); + $itemLoopIter->{dateDue} = $issue->date_due; $itemLoopIter->{onloan} = 'onloan'; } -- 2.39.5