Fridolin Somers
4159512fc5
Actually catalog detail page shows for damaged and lost items the authorized value description if exists. We must do the same for withdrawn information. Test plan : 1) Set for items a subfield linked to items.withdrawn and using the authorized value category 'WITHDRAWN' 2) Edit the authorized value category to add value '2' and description 'Eaten by dog' 3) Edit an item to set this withdrawn value 4) Go to staff interface and look at items in record detail page /cgi-bin/koh/catalogue/detail.pl : => Without patch you see 'Withdrawn' and with patch you see 'Eaten by dog' 5) Go to OPAc and look at items in record detail page /cgi-bin/koha/opac-detail.pl : => Without patch you see 'Withdrawn' and with patch you see 'Eaten by dog' Signed-off-by: delaye <stephane.delaye@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
95 lines
4.1 KiB
HTML
95 lines
4.1 KiB
HTML
[% USE AuthorisedValues %]
|
|
[% SET itemavailable = 1 %]
|
|
|
|
[%#- 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 ) %]
|
|
[% SET itemavailable = 0 %]
|
|
[% av_lib_include = AuthorisedValues.GetByCode( 'LOST', item.itemlost, 1 ) %]
|
|
[% IF ( av_lib_include ) %]
|
|
<span class="item-status lost">[% av_lib_include %]</span>
|
|
[% ELSE %]
|
|
<span class="item-status lost">Item lost</span>
|
|
[% END %]
|
|
[% END %]
|
|
|
|
[% IF item.isa('Koha::Item') %]
|
|
[% 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 %]
|
|
[% IF datedue %]
|
|
[% SET itemavailable = 0 %]
|
|
[% IF onsite_checkout %]
|
|
[% IF ( OPACShowCheckoutName ) %]
|
|
<span class="item-status checkedout">Currently in local use by [% item.firstname %] [% item.surname %] [% IF ( item.cardnumber ) %]([% item.cardnumber %])[% END %]</span>
|
|
[% ELSE %]
|
|
<span class="item-status checkedout">Currently in local use</span>
|
|
[% END %]
|
|
[% ELSE %]
|
|
[% IF ( OPACShowCheckoutName ) %]
|
|
<span class="item-status checkedout">Checked out to [% item.firstname %] [% item.surname %] [% IF ( item.cardnumber ) %]([% item.cardnumber %])[% END %]</span>
|
|
[% ELSE %]
|
|
<span class="item-status checkedout">Checked out</span>
|
|
[% END %]
|
|
[% END %]
|
|
[% END %]
|
|
|
|
[% 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 %]
|
|
<span class="item-status intransit">In transit from [% Branches.GetName( item.transfertfrom ) %]
|
|
to [% Branches.GetName( item.transfertto ) %] since [% item.transfertwhen | $KohaDates %]</span>
|
|
[% END %]
|
|
|
|
[% IF NOT( item.isa('Koha::Item') ) AND item.waiting %] [%# Not sure where does come from this waiting flag %]
|
|
[% SET itemavailable = 0 %]
|
|
<span class="item-status onhold">On hold</span>
|
|
[% END %]
|
|
|
|
[% IF ( item.withdrawn ) %]
|
|
[% SET itemavailable = 0 %]
|
|
[% av_lib_include = AuthorisedValues.GetByCode( 'WITHDRAWN', item.withdrawn, 1 ) %]
|
|
[% IF av_lib_include %]
|
|
<span class="item-status withdrawn">[% av_lib_include %]</span>
|
|
[% ELSE %]
|
|
<span class="item-status withdrawn">Item withdrawn</span>
|
|
[% END %]
|
|
[% END %]
|
|
|
|
|
|
[% IF NOT ( item.isa('Koha::Item') ) AND item.itemnotforloan %]
|
|
[% SET itemavailable = 0 %]
|
|
[% IF ( item.notforloanvalueopac ) %]
|
|
<span class="item-status notforloan">[% item.notforloanvalueopac %] [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %]</span>
|
|
[% ELSE %]
|
|
<span class="item-status notforloan">Not for loan [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %]</span>
|
|
[% END %]
|
|
[% ELSIF NOT ( item.isa('Koha::Item') ) AND item.notforloan_per_itemtype %]
|
|
[% SET itemavailable = 0 %]
|
|
<span class="item-status notforloan">Not for loan [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %]</span>
|
|
[% END %]
|
|
|
|
[% IF ( item.damaged ) %]
|
|
[% SET itemavailable = 0 %]
|
|
[% av_lib_include = AuthorisedValues.GetByCode( 'DAMAGED', item.damaged, 1 ) %]
|
|
[% IF av_lib_include %]
|
|
<span class="item-status damaged">[% av_lib_include %]</span>
|
|
[% ELSE %]
|
|
<span class="item-status damaged">Item damaged</span>
|
|
[% END %]
|
|
[% END %]
|
|
|
|
[% IF NOT ( item.isa('Koha::Item') ) AND item.on_order %][%# on_order is only set from opac-detail.pl %]
|
|
[% SET itemavailable = 0 %]
|
|
<span class="item-status onorder">On order</span>
|
|
[% END %]
|
|
|
|
[% IF ( itemavailable ) %]
|
|
[% IF NOT item.isa('Koha::Item') %][% SET restrictedopac = item.restrictedopac %][% END %]
|
|
<span class="item-status available">Available [% IF restrictedopac %]<span class="restricted">([% restrictedopac %])</span>[% END %]</span>
|
|
[% END %]
|