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>
42 [% IF item.avail_for_recall %]<a href="/cgi-bin/koha/opac-recall.pl?biblionumber=[% item.biblionumber | uri %]" class="btn btn-default btn-xs">Recall</a>[% END %]
45 [% IF NOT ( item.isa('Koha::Item') ) AND item.transfertwhen %] [%# transfertwhen is set in C4::Search, do not have it for course reserves %]
46 [% SET itemavailable = 0 %]
47 <span class="item-status intransit">In transit from [% Branches.GetName( item.transfertfrom ) | html %]
48 to [% Branches.GetName( item.transfertto ) | html %] since [% item.transfertwhen | $KohaDates %]</span>
51 [% IF NOT( item.isa('Koha::Item') ) AND item.waiting %] [%# Not sure where does come from this waiting flag %]
52 [% SET itemavailable = 0 %]
53 <span class="item-status onhold">On hold</span>
56 [% IF ( item.withdrawn ) %]
57 [% SET itemavailable = 0 %]
58 [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn, opac => 1 ) %]
59 [% IF av_lib_include %]
60 <span class="item-status withdrawn">[% av_lib_include | html %]</span>
62 <span class="item-status withdrawn">Item withdrawn</span>
67 [% IF NOT ( item.isa('Koha::Item') ) AND item.itemnotforloan %]
68 [% SET itemavailable = 0 %]
69 [% IF ( item.notforloanvalueopac ) %]
70 <span class="item-status notforloan">[% item.notforloanvalueopac | html %] [% IF ( item.restrictedvalueopac ) %]<span class="restricted">([% item.restrictedvalueopac | html %])</span>[% END %]</span>
72 <span class="item-status notforloan">Not for loan [% IF ( item.restrictedvalueopac ) %]<span class="restricted">([% item.restrictedvalueopac | html %])</span>[% END %]</span>
74 [% ELSIF NOT ( item.isa('Koha::Item') ) AND item.notforloan_per_itemtype %]
75 [% SET itemavailable = 0 %]
76 <span class="item-status notforloan">Not for loan [% IF ( item.restrictedvalueopac ) %]<span class="restricted">([% item.restrictedvalueopac | html %])</span>[% END %]</span>
79 [% IF ( item.damaged ) %]
80 [% SET itemavailable = 0 %]
81 [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => item.damaged, opac => 1 ) %]
82 [% IF av_lib_include %]
83 <span class="item-status damaged">[% av_lib_include | html %]</span>
85 <span class="item-status damaged">Item damaged</span>
89 [% IF NOT ( item.isa('Koha::Item') ) AND item.on_order %][%# on_order is only set from opac-detail.pl %]
90 [% SET itemavailable = 0 %]
91 <span class="item-status onorder">On order</span>
94 [% IF item.has_pending_hold %]
95 [% SET itemavailable = 0 %]
96 <span class="item-status pendinghold">Pending hold</span>
99 [% IF ( itemavailable ) %]
100 [% IF NOT item.isa('Koha::Item') %][% SET restrictedvalueopac = item.restrictedvalueopac %][% END %]
101 <span class="item-status available">Available [% IF restrictedvalueopac %]<span class="restricted">([% restrictedvalueopac | html %])</span>[% END %]</span>