From 8cc1f02a9481682a8230f2cf57cad6193effa460 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 18 Aug 2020 16:16:50 +0200 Subject: [PATCH] Bug 26145: Add the "Cover image" column to the table settings The new column can now be hidden by the table settings Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- admin/columns_settings.yml | 4 ++++ koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml index f8d92d2e08..75d971ab72 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -272,6 +272,8 @@ modules: columnname: holdings_checkbox cannot_be_toggled: 1 cannot_be_modified: 1 + - + columnname: holdings_cover_image - columnname: holdings_itype - @@ -327,6 +329,8 @@ modules: columnname: otherholdings_checkbox cannot_be_toggled: 1 cannot_be_modified: 1 + - + columnname: otherholdings_cover_image - columnname: otherholdings_itype - diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index f9b0382037..5d90adcb77 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -284,7 +284,7 @@ [% IF (StaffDetailItemSelection) %][% END %] [% IF Koha.Preference('LocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %] - Cover image + Cover image [% END %] [% IF ( item_level_itypes ) %]Item type[% END %] Current library @@ -1269,8 +1269,12 @@ Note that permanent location is a code, and location may be an authval. $(document).ready(function() { var ids = ['holdings_table', 'otherholdings_table']; var columns_settings = [ [% TablesSettings.GetColumns('catalogue', 'detail','holdings_table','json') | $raw %], [% TablesSettings.GetColumns('catalogue', 'detail','otherholdings_table','json') | $raw %] ]; + var has_images = ["[% itemloop_has_images %]", "[% otheritemloop_has_images %]"]; for (var i in ids) { var id = ids[i]; + if ( !has_images[i] ) { // remove the cover_image column + columns_settings.splice(1,1); + } var dt_parameters = { 'sDom': 't', 'bPaginate': false, -- 2.39.5