From bc5f637d25b22b19f179454a13feea60bc11e018 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 --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt | 8 ++++---- opac/opac-reserve.pl | 2 +- 2 files changed, 5 insertions(+), 5 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 a6fe88e113..8bb46e8ff7 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt @@ -422,7 +422,7 @@ [% 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 %] @@ -438,11 +438,11 @@ [% IF ( itemLoo.reservedate ) %] [% IF ( itemLoo.waitingdate ) %] - Waiting for patron at [% itemLoo.ExpectedAtLibrary | html %] since [% itemLoo.waitingdate | $KohaDates %] + Waiting for patron at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %] since [% itemLoo.waitingdate | $KohaDates %] [% ELSIF ( itemLoo.reservedate ) %] - On hold for patron expected at [% itemLoo.ExpectedAtLibrary | html %] since [% itemLoo.reservedate | $KohaDates %] + On hold for patron expected at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %] since [% itemLoo.reservedate | $KohaDates %] [% ELSE %] - On hold for patron expected at [% itemLoo.ExpectedAtLibrary | html %] + On hold for patron expected at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %] [% END %] [% ELSE %] diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index f60528f0db..e5c2753d6c 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -506,7 +506,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.20.1