Bug 21013: Missing itemtype for checkut makes patron summary print explode
authorOwen Leonard <oleonard@myacpl.org>
Thu, 14 Mar 2019 13:15:01 +0000 (13:15 +0000)
committerLucas Gass <lucas@bywatersolutions.com>
Tue, 16 Apr 2019 20:10:55 +0000 (20:10 +0000)
This patch moves retrieval of the item type description from the script
to the template using the ItemTypes template plugin.

To test, apply the patch and locate an item which is checked out to
someone. Modify the database record for that item to remove the item
type (items.itype).

View the print summary for the patron who has that item checked out. The
page should display correctly. Checked-out items which have an item type
should show that item type description correctly.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ea7245631ebfb16d4921a6cf7b4b46799a241ff9)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 1247af85216fc0664de8c667d282aa9c7e605f35)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt
members/summary-print.pl

index 9a395bb..03a40e0 100644 (file)
@@ -2,6 +2,7 @@
 [% USE Branches %]
 [% USE KohaDates %]
 [% USE Price %]
+[% USE ItemTypes %]
 [% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
     <title>Summary for [% patron.firstname %] [% patron.surname %] ([% patron.cardnumber %])</title>
@@ -52,7 +53,7 @@
                         </td>
                         <td>[% issue.author | html %]</td>
                         <td>[% issue.itemcallnumber | html %]</td>
-                        <td>[% issue.itemtype_description | html %]</td>
+                        <td>[% ItemTypes.GetDescription( issue.itype ) | html %]</td>
                         <td>[% issue.date_due | $KohaDates  as_due_date => 1 %]</td>
                         <td>[% issue.barcode | html %]</td>
                         <td>[% issue.charge | $Price %]</td>
index 76bb1d4..38127c9 100755 (executable)
@@ -93,9 +93,6 @@ sub build_issue_data {
         my ( $charge, $itemtype ) =
           GetIssuingCharges( $checkout->{itemnumber}, $borrowernumber );
 
-        $itemtype = Koha::ItemTypes->find( $itemtype );
-        $checkout->{itemtype_description} = $itemtype->description; #FIXME Should not it be translated_description
-
         $checkout->{charge} = $charge;
 
         $checkout->{overdue} = $c->is_overdue;