From 176a678fbe7ee1a8484c0123358e97a5d73487c5 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: Katrin Fischer Signed-off-by: Jonathan Druart --- .../prog/en/modules/catalogue/detail.tt | 20 +++++++++++-------- .../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 881bcaf687..f9b0382037 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 261b1b36dd..a88a7caf0b 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.39.5