From ea9255c00439fbedccab14a4a50b47fcb1ba05ac Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 29 Sep 2017 11:49:30 -0300 Subject: [PATCH] Bug 19388: FIX display item status if item is checked out In course reserves, if an item which was added to a course is checked out, it is not possible to show details for that course on OPAC. The error says: "Template process failed: undef error - The method onsite_checkout is not covered by tests! at /home/koha/src/C4/Templates.pm line 121." onsite_checkout is an attribute of Koha::Checkout, not Koha::Item Test plan: Create a course with 2 items that are checked out (standard and on-site) At the OPAC, add them to your cart and confirm the status of these 2 items is correct Confirm that on the detail page of the bib record as well as the detail of the course. Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart --- .../opac-tmpl/bootstrap/en/includes/item-status.inc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc index 408de462ee..ffb4d52965 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc @@ -16,12 +16,16 @@ [% END %] [% END %] -[% IF item.isa('Koha::Item') %][% SET datedue = issue.date_due %] -[% ELSE %][% SET datedue = item.datedue || issue.date_due %] +[% IF item.isa('Koha::Item') %] + [% SET datedue = issue.date_due %] + [% SET onsite_checkout = issue.onsite_checkout %] +[% ELSE %] + [% SET datedue = item.datedue || issue.date_due %] + [% SET onsite_checkout = item.onsite_checkout %] [% END %] [% IF datedue %] [% SET itemavailable = 0 %] - [% IF item.onsite_checkout %] + [% IF onsite_checkout %] [% IF ( OPACShowCheckoutName ) %] Currently in local use by [% item.firstname %] [% item.surname %] [% IF ( item.cardnumber ) %]([% item.cardnumber %])[% END %] [% ELSE %] -- 2.39.5