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 <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Katrin Fischer 2022-07-30 23:35:50 +02:00 committed by Tomas Cohen Arazi
parent e4d2ef0f46
commit 2353893c1a
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
2 changed files with 5 additions and 5 deletions

View file

@ -422,7 +422,7 @@
</td>
<td class="information">
[% IF ( itemLoo.dateDue ) %]
<span class="checkedout">Due [% itemLoo.dateDue | html %]</span>
<span class="checkedout">Due [% itemLoo.dateDue | $KohaDates as_due_date => 1 %]</span>
[% ELSIF ( itemLoo.transfertwhen ) %]
<span class="intransit">In transit from [% Branches.GetName( itemLoo.transfertfrom ) | html %] to [% Branches.GetName( itemLoo.transfertto ) | html %] since [% itemLoo.transfertwhen | html %]</span>
[% END %]
@ -438,11 +438,11 @@
[% IF ( itemLoo.reservedate ) %]
<span class="waiting">
[% IF ( itemLoo.waitingdate ) %]
<span>Waiting for patron at [% itemLoo.ExpectedAtLibrary | html %] since [% itemLoo.waitingdate | $KohaDates %]</span>
<span>Waiting for patron at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %] since [% itemLoo.waitingdate | $KohaDates %]</span>
[% ELSIF ( itemLoo.reservedate ) %]
<span>On hold for patron expected at [% itemLoo.ExpectedAtLibrary | html %] since [% itemLoo.reservedate | $KohaDates %]</span>
<span>On hold for patron expected at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %] since [% itemLoo.reservedate | $KohaDates %]</span>
[% ELSE %]
<span>On hold for patron expected at [% itemLoo.ExpectedAtLibrary | html %]</span>
<span>On hold for patron expected at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %]</span>
[% END %]
</span>
[% ELSE %]

View file

@ -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';
}