From 96bb6989049bca6d48d962232a77fdb91c5d04e7 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 --- 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 96b3a31a68..b8ba081de4 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 ea0de4e55c..63f9d43ac7 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 @@ -1270,8 +1270,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.20.1