From 326c0156f43b0bc04f97307b41230f70542df276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20Rodr=C3=ADguez?= Date: Thu, 5 Sep 2024 09:22:19 +0200 Subject: [PATCH] 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 Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize --- .../includes/html_helpers/tables/items/catalogue_detail.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc index 4a3d347a5b..099cfdd6fd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc @@ -485,7 +485,7 @@ nodes += '%s'.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 += '%s'.format(_("Not for loan")) + ( not_for_loan_lib ? ' (%s)'.format(escape_str(not_for_loan_lib)) : '' ) + ''; } @@ -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 += ' %s'.format(_("Available")) }