From 6ef2cf508d2677071e8a90b645620bfaca51e829 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 20 Apr 2017 12:49:51 -0300 Subject: [PATCH] Bug 18276: FIX status display for course reserves Content-Type: text/plain; charset=utf-8 This include file is terribly wrong, it's called from different places that do not set the same flag. The status from detail and result page might be different from the one display on the course reserve table. Signed-off-by: Josef Moravec Signed-off-by: Marcel de Rooy --- .../opac-tmpl/bootstrap/en/includes/item-status.inc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 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 843fcf6..81d3658 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc @@ -18,7 +18,10 @@ not use an API to fetch items that populates item.datedue. [% END %] [% END %] -[% IF ( item.datedue || issue.date_due ) %] +[% IF item.isa('Koha::Item') %][% SET datedue = issue.date_due %] +[% ELSE %][% SET datedue = item.datedue || issue.date_due %] +[% END %] +[% IF datedue %] [% SET itemavailable = 0 %] [% IF item.onsite_checkout %] [% IF ( OPACShowCheckoutName ) %] @@ -35,13 +38,13 @@ not use an API to fetch items that populates item.datedue. [% END %] [% END %] -[% IF ( item.transfertwhen ) %] +[% IF NOT ( item.isa('Koha::Item') ) AND item.transfertwhen %] [%# transfertwhen is set in C4::Search, do not have it for course reserves %] [% SET itemavailable = 0 %] In transit from [% Branches.GetName( item.transfertfrom ) %] to [% Branches.GetName( item.transfertto ) %] since [% item.transfertwhen | $KohaDates %] [% END %] -[% IF ( item.waiting ) %] +[% IF NOT( item.isa('Koha::Item') ) AND item.waiting %] [%# Not sure where does come from this waiting flag %] [% SET itemavailable = 0 %] On hold [% END %] @@ -51,14 +54,15 @@ not use an API to fetch items that populates item.datedue. Item withdrawn [% END %] -[% IF ( item.itemnotforloan ) %] + +[% IF NOT ( item.isa('Koha::Item') ) AND item.itemnotforloan %] [% SET itemavailable = 0 %] [% IF ( item.notforloanvalueopac ) %] [% item.notforloanvalueopac %] [% IF ( item.restrictedopac ) %]([% item.restrictedopac %])[% END %] [% ELSE %] Not for loan [% IF ( item.restrictedopac ) %]([% item.restrictedopac %])[% END %] [% END %] -[% ELSIF ( item.notforloan_per_itemtype ) %] +[% ELSIF NOT ( item.isa('Koha::Item') ) AND item.notforloan_per_itemtype %] [% SET itemavailable = 0 %] Not for loan [% IF ( item.restrictedopac ) %]([% item.restrictedopac %])[% END %] [% END %] @@ -73,11 +77,12 @@ not use an API to fetch items that populates item.datedue. [% END %] [% END %] -[% IF item.on_order %] +[% IF NOT ( item.isa('Koha::Item') ) AND item.on_order %][%# on_order is only set from opac-detail.pl %] [% SET itemavailable = 0 %] On order [% END %] [% IF ( itemavailable ) %] - Available [% IF ( item.restrictedopac ) %]([% item.restrictedopac %])[% END %] + [% IF NOT item.isa('Koha::Item') %][% SET restrictedopac = item.restrictedopac %][% END %] + Available [% IF restrictedopac %]([% restrictedopac %])[% END %] [% END %] -- 2.1.4