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 <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2017-09-29 11:49:30 -03:00
parent 10b5e1ee04
commit ea9255c004

View file

@ -16,12 +16,16 @@
[% END %] [% END %]
[% END %] [% END %]
[% IF item.isa('Koha::Item') %][% SET datedue = issue.date_due %] [% IF item.isa('Koha::Item') %]
[% ELSE %][% SET datedue = item.datedue || issue.date_due %] [% 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 %] [% END %]
[% IF datedue %] [% IF datedue %]
[% SET itemavailable = 0 %] [% SET itemavailable = 0 %]
[% IF item.onsite_checkout %] [% IF onsite_checkout %]
[% IF ( OPACShowCheckoutName ) %] [% IF ( OPACShowCheckoutName ) %]
<span class="item-status checkedout">Currently in local use by [% item.firstname %] [% item.surname %] [% IF ( item.cardnumber ) %]([% item.cardnumber %])[% END %]</span> <span class="item-status checkedout">Currently in local use by [% item.firstname %] [% item.surname %] [% IF ( item.cardnumber ) %]([% item.cardnumber %])[% END %]</span>
[% ELSE %] [% ELSE %]