Bug 30082: Bibliographic details tab missing when user can't add local cover image

This patch corrects the template logic which determines whether the
"Images" tab should be displayed on the bibliographic detail page. The
"Images" tab should display whenever local cover images are enabled, not
just if the user has permission to manage cover images.

To test, apply the patch and go to Administration -> System preferences.

- Enable the LocalCoverImages system preference.
- Locate and view the detail page for a bibliographic record in the
  catalog which doesn't have a local cover image attached.

  - If you are logged in as a user with upload_local_cover_images
    permission you should see an "Images" tab with the message "No
    images have been uploaded for this bibliographic record yet" and an
    upload button.
  - If you are logged in as a user without upload_local_cover_images
    permission you should see an "Images" tab with just the "No
    images..." message.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Owen Leonard 2022-02-11 15:24:43 +00:00 committed by Fridolin Somers
parent bafd7cff70
commit adb11b866b

View file

@ -275,11 +275,9 @@
[% IF suggestions.count %]<li><a href="#suggestion_details">Suggestion details</a></li>[% END %]
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li><a href="#editions">Editions</a></li>[% END %][% END %]
[% IF ( LocalCoverImages ) %]
[% IF ( localimages.count || CAN_user_tools_upload_local_cover_images ) %]
<li>
<a href="#images">Images ([% localimages.count || 0 | html %])</a>
</li>
[% END %]
<li>
<a href="#images">Images ([% localimages.count || 0 | html %])</a>
</li>
[% END %]
[% IF HTML5MediaEnabled && HTML5MediaSets.size %]<li id="media_tab"><a href="#html5media">Play media</a></li>[% END %]
[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]