Bug 37840: Fix item status in the Intranet detail page when the item has a item type not for loan

When the item type is not for loan, the item status must be "Not for loan". Now in the Intranet status is Available while in the OPAC it's Not for loan.

Test plan:
1 Define an item type as "Not for loan"
2 Add or edit an item so that its item type is "Not for loan"
3 Check that the status in the Intranet detail page shows Available while the OPAC detail page shows "Not for loan"
4 Apply patch, restart services
5 Check that the status is now "Not for loan" in both Intranet and OPAC

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Adolfo Rodríguez 2024-09-05 09:22:19 +02:00 committed by Martin Renvoize
parent 3615baf92f
commit 326c0156f4
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F

View file

@ -485,7 +485,7 @@
nodes += '<span class="dmg">%s</span>'.format(escape_str(damaged_lib));
}
if ( row.not_for_loan_status || item_types_notforloan[row.item_type_id] ) {
if ( row.not_for_loan_status || item_types_notforloan.get(row.item_type_id) ) {
let not_for_loan_lib = av_not_for_loan.get(row.not_for_loan_status.toString());
nodes += '<span class="notforloan">%s'.format(_("Not for loan")) + ( not_for_loan_lib ? '<span class="reason"> (%s)</span>'.format(escape_str(not_for_loan_lib)) : '' ) + '</span>';
}
@ -525,7 +525,7 @@
}
[% END %]
if ( ! ( row.not_for_loan_status || item_types_notforloan[row.item_type_id] || row.checked_out_date || row.lost_status || row.withdrawn || row.damaged_status || row.transfer || row.first_hold || row.recall ) ) {
if ( ! ( row.not_for_loan_status || item_types_notforloan.get(row.item_type_id) || row.checked_out_date || row.lost_status || row.withdrawn || row.damaged_status || row.transfer || row.first_hold || row.recall ) ) {
nodes += ' <span>%s</span>'.format(_("Available"))
}