2 [% USE AuthorisedValues %]
3 [% SET itemavailable = 1 %]
5 [%#- This include takes two parameters: an item structure -%]
6 [%#- and an optional loan (issue) structure. The issue -%]
7 [%#- structure is used by course reserves pages, which do -%]
8 [%#- not use an API to fetch items that populates item.datedue. -%]
10 [% IF ( item.itemlost ) %]
11 [% SET itemavailable = 0 %]
12 [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost, opac => 1 ) %]
13 [% IF ( av_lib_include ) %]
14 <span class="item-status lost">[% av_lib_include | html %]</span>
16 <span class="item-status lost">Item lost</span>
20 [% IF item.isa('Koha::Item') %]
21 [% SET datedue = issue.date_due %]
22 [% SET onsite_checkout = issue.onsite_checkout %]
24 [% SET datedue = item.datedue || issue.date_due %]
25 [% SET onsite_checkout = item.onsite_checkout %]
28 [% SET itemavailable = 0 %]
29 [% IF onsite_checkout %]
30 [% IF ( OPACShowCheckoutName ) %]
31 <span class="item-status checkedout">Currently in local use by [% item.firstname | html %] [% item.surname | html %] [% IF ( item.cardnumber ) %]([% item.cardnumber | html %])[% END %]</span>
33 <span class="item-status checkedout">Currently in local use</span>
36 [% IF ( OPACShowCheckoutName ) %]
37 <span class="item-status checkedout">Checked out to [% item.firstname | html %] [% item.surname | html %] [% IF ( item.cardnumber ) %]([% item.cardnumber | html %])[% END %]</span>
39 <span class="item-status checkedout">Checked out</span>
44 [% IF NOT ( item.isa('Koha::Item') ) AND item.transfertwhen %] [%# transfertwhen is set in C4::Search, do not have it for course reserves %]
45 [% SET itemavailable = 0 %]
46 <span class="item-status intransit">In transit from [% Branches.GetName( item.transfertfrom ) | html %]
47 to [% Branches.GetName( item.transfertto ) | html %] since [% item.transfertwhen | $KohaDates %]</span>
50 [% IF NOT( item.isa('Koha::Item') ) AND item.waiting %] [%# Not sure where does come from this waiting flag %]
51 [% SET itemavailable = 0 %]
52 <span class="item-status onhold">On hold</span>
55 [% IF ( item.withdrawn ) %]
56 [% SET itemavailable = 0 %]
57 [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn, opac => 1 ) %]
58 [% IF av_lib_include %]
59 <span class="item-status withdrawn">[% av_lib_include | html %]</span>
61 <span class="item-status withdrawn">Item withdrawn</span>
66 [% IF NOT ( item.isa('Koha::Item') ) AND item.itemnotforloan %]
67 [% SET itemavailable = 0 %]
68 [% IF ( item.notforloanvalueopac ) %]
69 <span class="item-status notforloan">[% item.notforloanvalueopac | html %] [% IF ( item.restrictedvalueopac ) %]<span class="restricted">([% item.restrictedvalueopac | html %])</span>[% END %]</span>
71 <span class="item-status notforloan">Not for loan [% IF ( item.restrictedvalueopac ) %]<span class="restricted">([% item.restrictedvalueopac | html %])</span>[% END %]</span>
73 [% ELSIF NOT ( item.isa('Koha::Item') ) AND item.notforloan_per_itemtype %]
74 [% SET itemavailable = 0 %]
75 <span class="item-status notforloan">Not for loan [% IF ( item.restrictedvalueopac ) %]<span class="restricted">([% item.restrictedvalueopac | html %])</span>[% END %]</span>
78 [% IF ( item.damaged ) %]
79 [% SET itemavailable = 0 %]
80 [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => item.damaged, opac => 1 ) %]
81 [% IF av_lib_include %]
82 <span class="item-status damaged">[% av_lib_include | html %]</span>
84 <span class="item-status damaged">Item damaged</span>
88 [% IF NOT ( item.isa('Koha::Item') ) AND item.on_order %][%# on_order is only set from opac-detail.pl %]
89 [% SET itemavailable = 0 %]
90 <span class="item-status onorder">On order</span>
93 [% IF item.has_pending_hold %]
94 [% SET itemavailable = 0 %]
95 <span class="item-status pendinghold">Pending hold</span>
98 [% IF ( itemavailable ) %]
99 [% IF NOT item.isa('Koha::Item') %][% SET restrictedvalueopac = item.restrictedvalueopac %][% END %]
100 <span class="item-status available">Available [% IF restrictedvalueopac %]<span class="restricted">([% restrictedvalueopac | html %])</span>[% END %]</span>