Bug 32611: Not for loan items don't show the specific not for loan value in OPAC...
authorOwen Leonard <oleonard@myacpl.org>
Thu, 23 Feb 2023 17:10:32 +0000 (17:10 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 27 Feb 2023 14:39:58 +0000 (11:39 -0300)
This patch corrects what appear to be some copy-paste errors which
resulted in the "not for loan" authorized value description not
displaying, instead the generic "Not for loan" is shown.

The patch also adds another case for displaying the item restricted
status. Previously items.restricted would only display if the item
*also* had a notforloan value.

To test it's probably easiest to find a record with multiple items and
set various item statuses (damaged, notforloan, lost, restricted) and
confirm that the right description is shown.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc

index 0d5713d..aac8ece 100644 (file)
 [% END %]
 
 
-[% SET restricted_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn, opac => 1 ) %]
+[% SET restricted_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.restricted', authorised_value => item.restricted, opac => 1 ) %]
 [% IF item.notforloan %]
     [% SET itemavailable = 0 %]
-    [% notforloan_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn, opac => 1 ) %]
+    [% notforloan_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan, opac => 1 ) %]
     [% IF notforloan_lib %]
         <span class="item-status notforloan">[% notforloan_lib | html %] [% IF restricted_lib %]<span class="restricted">([% restricted_lib | html %])</span>[% END %]</span>
     [% ELSE %]
 [% ELSIF item.itemtype.notforloan %]
     [% SET itemavailable = 0 %]
     <span class="item-status notforloan">Not for loan [% IF restricted_lib %]<span class="restricted">([% restricted_lib | html %])</span>[% END %]</span>
+[% ELSE %]
+    [% IF restricted_lib %]
+        <span class="item-status restricted">[% restricted_lib | html %]</span>
+    [% END %]
 [% END %]
 
 [% IF ( item.bundle_host ) %]