Bug 37399: Fix showing itemtype on holdings table

If syspref "noItemTypeImages" is disabled, holdings table won't display
itemtype column. This patch fixes this.

To reproduce:
1. Enable syspref "noItemTypeImages".
2. Find biblio with items.
   => Note that itemtype column is displayed on holdings table.
3. Disable syspref "noItemTypeImages".
   => Itemtype column is no longer displayed on holdings table.
4. Apply this patch.
   => Now column should be displayed correctly.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 313f7e86b8)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Emmi Takkinen 2024-07-18 12:34:12 +03:00 committed by Lucas Gass
parent 8add61d7f3
commit 120d987d92
1 changed files with 2 additions and 2 deletions

View File

@ -345,14 +345,14 @@
orderable: true,
render: function (data, type, row, meta) {
let node = '';
let item_type_description = row._strings.item_type_id.str;
[% UNLESS noItemTypeImages %]
let image_location = item_type_image_locations[row.item_type_id];
let item_type_description = row._strings.item_type_id.str;
node += image_location
? '<img src="%s" alt="%s" title="%s" /> '.format(escape_str(image_location), escape_str(item_type_description), escape_str(item_type_description))
: '';
node += '<span class="itypedesc itypetext">%s</span>'.format(escape_str(item_type_description));
[% END %]
node += '<span class="itypedesc itypetext">%s</span>'.format(escape_str(item_type_description));
return node;
}
},