Bug 41778: Fix broken display of not for loan status on item detail page

This patch makes some corrections to the way the item detail page
template defines and display an item's not for loan status.

To test you must have at least one not-for-loan item attached to a
bibliographic record.

- If necessary, edit an item to set a "Not for loan" status.
- View the bibliographic detail page for that item's record.
- Click the "Items" tab from the bibliographic detail page.
- Find the section on the page showing the item you edited.
  - You should see "Barcode XXXX" (or "Item number XXXX") along with the
    not for loan status you defined.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This commit is contained in:
Owen Leonard 2026-02-05 12:27:26 -05:00 committed by Martin Renvoize
parent b38c0fb9eb
commit e89b043440
No known key found for this signature in database
GPG Key ID: 2D86E0EAEC83711B
1 changed files with 6 additions and 6 deletions

View File

@ -137,6 +137,11 @@
[% FOREACH ITEM_DAT IN ITEM_DATA %]
<div id="container[% ITEM_DAT.itemnumber | html %]">
[% SET not_for_loan = 0 %]
[% IF ITEM_DAT.notforloan || ITEM_DAT.effective_itemtype.notforloan %]
[% SET not_for_loan = 1 %]
[% SET not_for_loan_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => ITEM_DAT.notforloan ) %]
[% END %]
<h3 id="item[% ITEM_DAT.itemnumber | html %]" class="expanded">
<i class="fa fa-caret-down" title="Collapse this section"></i>
[% IF ITEM_DAT.barcode -%]
@ -144,14 +149,9 @@
[% ELSE -%]
Item number [% ITEM_DAT.itemnumber | html %]
[% END %]
[% IF not_for_loan %][% not_for_loan_description | html %][% END %]
[% IF not_for_loan %]([% not_for_loan_description | html %])[% END %]
</h3>
<div id="collapse_item[% ITEM_DAT.itemnumber | html %]" class="page-section clearfix">
[% SET not_for_loan = 0 %]
[% IF ITEM_DAT.notforloan || ITEM_DAT.effective_itemtype.notforloan %]
[% SET not_for_loan = 1 %]
[% SET not_for_loan_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %]
[% END %]
[% IF withdraw_error %]
<div class="alert alert-warning">
[% IF withdraw_error == 'intransit_cannot_withdraw' %]