From ebe9b4110e3c86bd50ec6b9676c6982936563249 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 18 Aug 2020 15:56:02 +0200 Subject: [PATCH] Bug 26145: Hide 'Upload image' if no CoverImage pref is set If LocalCoverImages AND OPACLocalCoverImages are disabled, we should not let the ability to upload an image for the items. We should also hide the column "cover image" in the tables Signed-off-by: Heather Hernandez --- .../prog/en/modules/catalogue/detail.tt | 20 ++++++++++++-------- .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 5 +++-- 2 files changed, 15 insertions(+), 10 deletions(-) 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 2e0574cc47..ea0de4e55c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -283,7 +283,7 @@ [% IF (StaffDetailItemSelection) %][% END %] - [% IF ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %] + [% IF Koha.Preference('LocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %] Cover image [% END %] [% IF ( item_level_itypes ) %]Item type[% END %] @@ -324,7 +324,7 @@ [% END %] - [% IF ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %] + [% IF Koha.Preference('LocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %]
@@ -550,12 +550,16 @@ Note that permanent location is a code, and location may be an authval. [% IF CAN_user_editcatalogue_edit_items %] [% UNLESS item.cannot_be_edited %] - + [% IF Koha.Preference('LocalCoverImages') OR Koha.Preference('OPACLocalCoverImages') %] + + [% ELSE %] + Edit + [% END %] [% END %] [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index 1c3cbf464c..ffd88163ae 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1210,7 +1210,8 @@ - [% IF ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %] + + [% IF Koha.Preference('OPACLocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %] [% END %] [% IF ( item_level_itypes ) %] @@ -1265,7 +1266,7 @@ [% END %] - [% IF ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %] + [% IF Koha.Preference('OPACLocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %]
Cover image
[% FOR image IN ITEM_RESULT.cover_images %]
-- 2.11.0