Bug 10626: Remove doubled up TT plugins - Merge KohaAuthorisedValues and AuthorisedValues
[koha_fer] / koha-tmpl / opac-tmpl / prog / en / includes / item-status.inc
index d2651f0..ec7304d 100644 (file)
@@ -1,4 +1,11 @@
-[% USE KohaAuthorisedValues %]
+[% USE AuthorisedValues %]
+
+[%#-
+This include takes two parameters: an item structure
+and an optional loan (issue) structure.  The issue
+structure is used by course reserves pages, which do
+not use an API to fetch items that populates item.datedue.
+-%]
 
 [% IF ( item.itemlost ) %]
     [% av_lib_include = KohaAuthorisedValues.GetByCode( 'LOST', item.itemlost, 1 ) %]
@@ -11,7 +18,7 @@
             Item lost
         [% END %]
     [% END %]
-[% ELSIF ( item.datedue ) %]
+[% ELSIF ( item.datedue || issue.date_due ) %]
     [% IF ( OPACShowCheckoutName ) %]
         Checked out to [% item.cardnumber %] [% item.firstname %] [% item.surname %]
     [% ELSE %]
@@ -33,7 +40,7 @@
 [% ELSIF ( item.notforloan_per_itemtype ) %]
     Not for loan [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %]
 [% ELSIF ( item.damaged ) %]
-    [% av_lib_include = KohaAuthorisedValues.GetByCode( 'DAMAGED', item.damaged, 1 ) %]
+    [% av_lib_include = AuthorisedValues.GetByCode( 'DAMAGED', item.damaged, 1 ) %]
     [% IF av_lib_include %]
         [% av_lib_include %]
     [% ELSE %]