From 1c1c97d7ca5cf1be366f2a1feec56d0cc7e65c4a Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 29 Jul 2020 16:49:14 +0200 Subject: [PATCH] Bug 26012: Correctly format "paid for" info on the item details view The string is built controller side, which does not let the template format the info nicely. We want to display patron's info using patron-title.inc and the date with the KohaDates plugin Test plan: - Make sure there is a replacement cost in the item - check it out - Mark it lost - Pay the lost item fee - Go to the detail page and look on the items tab for the item - It will show an entry with "Paid for?" label The patron's info and date must be correctly formatted Signed-off-by: Sally Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart (cherry picked from commit ed4fc5889467bde858cfd4ac573cd40a5b4279c5) Signed-off-by: Lucas Gass (cherry picked from commit f16934384efe502a6247b1c4cb981d2684e6dee3) Signed-off-by: Aleisha Amohia --- catalogue/moredetail.pl | 6 +----- .../intranet-tmpl/prog/en/modules/catalogue/moredetail.tt | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index f74bc85aa0..17bf677c06 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -203,11 +203,7 @@ foreach my $item (@items){ if ($payment_offsets->count) { my $patron = $accountline->patron; my $payment_offset = $payment_offsets->next; - $item->{paidfor} = - $patron->firstname . " " - . $patron->surname . " " - . $patron->cardnumber . " " - . $payment_offset->created_on; + $item->{paidfor} = { patron => $patron, created_on => $payment_offset->created_on }; } } } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt index 6f3ba54ad0..2bce186faf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt @@ -247,7 +247,7 @@ [% IF ( ITEM_DAT.card0 ) %]
  • Last borrower: [% ITEM_DAT.card0 | html %] 
  • [% END %] [% IF ( ITEM_DAT.card1 ) %]
  • Previous borrower: [% ITEM_DAT.card1 | html %] 
  • [% END %] [% IF ( ITEM_DAT.card2 ) %]
  • Previous borrower: [% ITEM_DAT.card2 | html %] 
  • [% END %] - [% IF ( ITEM_DAT.paidfor ) %]
  • Paid for?: [% ITEM_DAT.paidfor | html %] 
  • [% END %] + [% IF ( ITEM_DAT.paidfor ) %]
  • Paid for?: [% INCLUDE 'patron-title.inc' patron=ITEM_DAT.paidfor.patron hide_patron_infos_if_needed=1 %] on [% ITEM_DAT.paidfor.created_on | $KohaDates %]
  • [% END %] [% IF ( ITEM_DAT.enumchron ) %]
  • Serial enumeration: [% ITEM_DAT.enumchron | html %] 
  • [% END %] -- 2.39.5