From b7b12c2c9ce566c928fcadc957c737367532c30e 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 --- 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 a736c30c8c..aca129468a 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -211,11 +211,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 12dc7ea7a2..c6a5a7390c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt @@ -254,7 +254,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.20.1