From d859e83c63a7cfc898027695816e9d3dd4a491ee Mon Sep 17 00:00:00 2001 From: Jake Deery Date: Fri, 6 Mar 2026 12:45:47 +0000 Subject: [PATCH] Bug 14962: (QA follow-up) Show permenant item type on detail.pl This patch continues work done to show permenant location, ccode, homebranch, and holdingbranch to the itype column on the details page. Sponsored-by: ByWater Solutions --- .../tables/items/catalogue_detail.inc | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 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 9ba9a148289..4d871e6e218 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 @@ -410,28 +410,32 @@ orderable: true, [% END %] render: function (data, type, row, meta) { - let node = ''; - [% IF Koha.Preference('UseDisplayModule') %] - let effective_item_type_description = row._strings.effective_item_type_id ? row._strings.effective_item_type_id.str : row.effective_item_type_id; + let nodes = ""; + let effective_item_type_id_str = row._strings.effective_item_type_id ? row._strings.effective_item_type_id.str : row.effective_item_type_id; + let item_type_id_str = row._strings.item_type_id ? row._strings.item_type_id.str : row.item_type_id; + + let image_location = item_type_image_locations[row.effective_item_type_id]; [% UNLESS noItemTypeImages %] - let image_location = item_type_image_locations[row.effective_item_type_id]; - node += image_location - ? ' '.format(escape_str(image_location), escape_str(effective_item_type_description), escape_str(effective_item_type_description)) + nodes += image_location + ? ' '.format(escape_str(image_location), escape_str(effective_item_type_id_str), escape_str(effective_item_type_id_str)) : ''; [% END %] - node += '%s'.format(escape_str(effective_item_type_description)); + + [% IF Koha.Preference('UseDisplayModule') %] + if (item_type_id_str != effective_item_type_id_str) { + nodes += ''; + nodes += ' '; + nodes += ' ' + escape_str(effective_item_type_id_str || ''); + nodes += ' '; + } else { + nodes += escape_str(effective_item_type_id_str || ''); + } [% ELSE %] - let item_type_description = row._strings.item_type_id ? row._strings.item_type_id.str : row.item_type_id; - [% UNLESS noItemTypeImages %] - let image_location = item_type_image_locations[row.item_type_id]; - node += image_location - ? ' '.format(escape_str(image_location), escape_str(item_type_description), escape_str(item_type_description)) - : ''; - [% END %] - node += '%s'.format(escape_str(item_type_description)); + nodes += escape_str(effective_item_type_id_str || ''); [% END %] - return node; + nodes = '' + nodes + ''; + return nodes; } }, [% END %] -- 2.50.1 (Apple Git-155)