Bug 30633: Default to 'Current library' if item_level_itypes is off

We cannot set the default value in the yaml file dynamically.
This is not ideal but we are going to modify the default "Item type" if
item-level_itypes is off.

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4bcb11b69e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Jonathan Druart 2025-10-17 14:59:04 +02:00 committed by Paul Derscheid
parent a62d2cd217
commit 4387d4af64
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
1 changed files with 7 additions and 0 deletions

View File

@ -1907,6 +1907,13 @@
[% END # /IF OpacBrowseResults %]
var holdingst_table_settings = [% TablesSettings.GetTableSettings( 'opac', 'biblio-detail', 'holdingst', 'json' ) | $raw %];
[% IF ( !item_level_itypes || Koha.Preference('BiblioItemtypeInfo') ) %]
// The default in the yaml file is 1 "Item type".
// If item-level_itypes is off the column will not appear, then select column 2 "Current library"
if (holdingst_table_settings.default_sort_order == 1) {
holdingst_table_settings.default_sort_order = 2;
}
[% END %]
var otherholdingst_table_settings = JSON.parse(JSON.stringify(holdingst_table_settings)); // Clone
let column;