Bugzilla – Attachment 110681 Details for
Bug 26145
Add the ability to attach a cover image at item level
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26145: Hide 'Upload image' if no CoverImage pref is set
Bug-26145-Hide-Upload-image-if-no-CoverImage-pref-.patch (text/plain), 6.24 KB, created by
ByWater Sandboxes
on 2020-09-24 17:03:01 UTC
(
hide
)
Description:
Bug 26145: Hide 'Upload image' if no CoverImage pref is set
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2020-09-24 17:03:01 UTC
Size:
6.24 KB
patch
obsolete
>From ebe9b4110e3c86bd50ec6b9676c6982936563249 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >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 <heather_hernandez@nps.gov> >--- > .../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 @@ > <thead> > <tr> > [% IF (StaffDetailItemSelection) %]<th id="[% tab | html %]_checkbox" data-colname="[% tab | html %]_checkbox" class="NoSort"></th>[% 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 ) %] > <th id="[% tab | html %]_cover" data-colname="[% tab | html %]_cover">Cover image</th> > [% END %] > [% IF ( item_level_itypes ) %]<th id="[% tab | html %]_itype" data-colname="[% tab | html %]_itype">Item type</th>[% END %] >@@ -324,7 +324,7 @@ > <input type="checkbox" value="[% item.itemnumber | html %]" name="itemnumber" /> > </td> > [% 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 ) %] > <td class="cover"> > <div class="bookcoverimg"> > <div class="cover-slider"> >@@ -550,12 +550,16 @@ Note that permanent location is a code, and location may be an authval. > [% IF CAN_user_editcatalogue_edit_items %] > <td class="actions"> > [% UNLESS item.cannot_be_edited %] >- <div class="btn-group"> >- <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% item.biblionumber | html %]&itemnumber=[% item.itemnumber | html %]#edititem"><i class="fa fa-pencil"></i> Edit</a><a class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></a> >- <ul class="dropdown-menu pull-right"> >- <li><a href="/cgi-bin/koha/tools/upload-cover-image.pl?itemnumber=[% item.itemnumber | uri %]&filetype=image"><i class="fa fa-upload"></i> Upload image</a></li> >- </ul> >- </div> >+ [% IF Koha.Preference('LocalCoverImages') OR Koha.Preference('OPACLocalCoverImages') %] >+ <div class="btn-group"> >+ <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% item.biblionumber | html %]&itemnumber=[% item.itemnumber | html %]#edititem"><i class="fa fa-pencil"></i> Edit</a><a class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></a> >+ <ul class="dropdown-menu pull-right"> >+ <li><a href="/cgi-bin/koha/tools/upload-cover-image.pl?itemnumber=[% item.itemnumber | uri %]&filetype=image"><i class="fa fa-upload"></i> Upload image</a></li> >+ </ul> >+ </div> >+ [% ELSE %] >+ <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% item.biblionumber | html %]&itemnumber=[% item.itemnumber | html %]#edititem"><i class="fa fa-pencil"></i> Edit</a> >+ [% END %] > [% END %] > </td> > [% 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 @@ > <table class="table table-bordered table-striped" id="[% table_id | html %]"> > <thead> > <tr> >- [% 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 ) %] > <th id="item_cover" data-colname="item_cover">Cover image</th> > [% END %] > [% IF ( item_level_itypes ) %] >@@ -1265,7 +1266,7 @@ > <tr vocab="http://schema.org/" typeof="Offer"> > [% 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 ) %] > <td class="cover"> > [% FOR image IN ITEM_RESULT.cover_images %] > <div title="[% ITEM_RESULT.itemnumber | html %]" data-imagenumber="[% image.imagenumber | html %]" data-biblionumber="[% ITEM_RESULT.biblionumber | html %]" class="local-thumbnail-preview"></div> >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26145
:
109225
|
109226
|
110342
|
110343
|
110344
|
110345
|
110346
|
110347
|
110348
|
110349
|
110350
|
110351
|
110352
|
110353
|
110354
|
110675
|
110676
|
110677
|
110678
|
110679
|
110680
|
110681
|
110682
|
110683
|
110684
|
110685
|
110800
|
110861
|
110862
|
110863
|
110864
|
110865
|
110866
|
110867
|
110868
|
110869
|
110870
|
110871
|
110872
|
110873
|
110874
|
110875
|
111446
|
111447
|
111448
|
111449
|
111450
|
111451
|
111452
|
111453
|
111454
|
111455
|
111456
|
111457
|
111458