Bug 26145: Add the ability to upload a cover image per item
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 28 Jul 2020 19:18:20 +0000 (21:18 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 12 Oct 2020 09:28:41 +0000 (11:28 +0200)
commitc3f2993bdbbd8453c3b604c5d2cf43dc9ee27c88
treee060007f5ba9cb2c4a750e50e84a19a534d0186a
parentff17013a65036200fb0cb208107dc9f70778c49c
Bug 26145: Add the ability to upload a cover image per item

This patchset adds the ability to attach cover images at item level.
This commit message will explain the different patches that are
following.

The main idea is to have cover images for a given item. This is useful
for a bibliographic record linked with a subscription. Each item could
have the cover image for the serial numbers.

In this first patch there is a limitation to allow only 1 cover per
item, but a later patch will remove it. That way we will take advantage
of the recent work done to display nicely cover images (bug 25031), and
reuse it in this development (staff interface only).

In order to use a flexible and robust code, the legacy C4 code
(C4::Images) has been moved to Koha::CoverImages. Also the DB table
biblioimages has been renamed cover_images.

Test plan (for the whole patch set):
0. Turn off AllowMultipleCovers
1. Create a new bibliographic record and items
2. Attach a cover image to the bibliographic record
3. In the item list of the bibliographic detail page, you will notice a
new "Upload image" action. Select it
4. Select an image
=> Notice the new column in the item table
5. Upload another image
=> You cannot upload 2 images, you are going to replace the existing one
6. Turn on AllowMultipleCovers
7. Attach another image to the image
=> Notice the 2 images are displayed nicely, with navigation controls
8. Confirm you can view an image if you click on it and you can delete it
9. Test the OPAC view now
=> Cover image for items are displayed in the table, there is no
navigation controls here however.

Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Images.pm
catalogue/detail.pl
catalogue/imageviewer.pl
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/imageviewer.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload-images.tt
svc/cover_images
tools/upload-cover-image.pl