Allow caching of images
Add nginx installation to Debian package
Revert "Bug 7984 [SIGNED-OFF] - Fix the upload_local_cover_images permission"

This reverts commit 86ed40f478b5eeda0ffab430404139c26a46c59a.
Revert "Bug 1633 follow-up: Fix jenkins tests"

This reverts commit 42134b8ce45734fc94bf3e5d69ea60a12e48a73f.
Revert "Allow caching of images"

This reverts commit 698237bf76745ebfbd62e0c3763045103535eb6c.
Revert "Bug 1633: QA follow-up"

This reverts commit 4c6a5027c41aed431f45b6cb1a8f455ae5d72fcc.
Revert "Bug 1633 - Interface revisions for the staff client"

This reverts commit bea5688beaf912e4acd75ec8be20bed04d592909.

Conflicts:

	koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css
Revert "Bug 1633: [SIGNED-OFF] Don't show image tab when inappropriate"

This reverts commit 28fa973faeb2dd32fee1f35ce0554a170422f565.
Revert "Bug 1633 - [SIGNED-OFF] Add ability to take book cover images from local img db"

This reverts commit e454a065a984392ec2e14691146069416199e11a.

Conflicts:

	koha-tmpl/opac-tmpl/prog/en/css/opac.css
Revert "Bug 1633: [SIGNED-OFF] Display local cover images"

This reverts commit 317e769a2b948f88c7fdc9622ff3e921634cfe59.

Conflicts:

	koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css
Revert "Bug 1633: [SIGNED-OFF] Add support for uploading images to Koha"

This reverts commit 36c83f4d79c96bc1a85131cffe66e8ea95ab3c24.

Conflicts:

	installer/data/mysql/sysprefs.sql
Bug 1633: [SIGNED-OFF] Add support for uploading images to Koha

A frequently-requested feature for Koha, especially by special libraries, is
the ability to upload local cover images into Koha.

This patch adds a bibliocoverimage table, and image handling code in the
C4::Images module. Key features of the implementation include:
1. The ability to have multiple cover images for a biblio
2. Handling for "full size" (800x600) and thumbnail-size (200x140) images
3. Uploading images directly from the record view

The image display functionality by Koustubha Kale of Anant Corporation will
follow in a second patch.

Special thanks to Koustubha Kale and Anant Corporation for the initial
implementation of local cover images, and to Chris Nighswonger of Foundation
Bible College for his prior work on patron images.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Will add comments on Bugzilla.

Patch failed to apply because installer/data/mysql/sysprefs.sql had changed in master.
Corrected the same with this new patch.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 1633: [SIGNED-OFF] Display local cover images

This patch adds display of local cover images in the following places:
1. OPAC Results page
2. OPAC Details page
3. Separate image viewer page for the OPAC
4. Intranet Details page
5. Separate image viewer page for the Intranet

Display in the Details and (OPAC) Results pages is handled via Javascript
rather than via direct embedding, to better handle the situation where most
records have local cover images, but a few do not.

Local cover images do not currently display in the Intranet Results page

How to use/test :
Assign user permission to the user Tools > (upload_local_cover_images Upload
local cover images).  In order to upload local  images, login to the staff
client. Go to Home > Tools > Upload Cover Images. Here you can upload cover
images either singly or in bulk in the form of a zip file.  If uploading
singly, click on image file, browse the image from your local disk, type in
the biblio number of the catalogue entry and press upload.  If uploading in
bulk as a zip file, the zip file must contain (in addition to cover images)
one text file named either datalink.txt OR idlink.txt. This file should
have mapping of biblionumber to image file name in the zip one per line
with comma or tab as delimiters. For example:

1, scanned_cover_image_of_bib_no_1.jpg
2, scanned_cover_image_of_bib_no_1.jpg

Cover images will be resized to a large image of 800x600 and a thumbnail of
200x140. Depending on the setting of AllowMultipleCovers, it is possible to
upload multiple images for a single bibliographic record. However, even if
multiple covers are permitted, you have the option of replacing the existing
covers by checking the "Replace existing covers" option on the upload screen.

1. The patch adds a menu link in Tools from where you can upload local cover
   images
2. It adds a user permission to enable access control to this menu item under
   Tools
3. It adds a system preference OPACLocalCoverImages under Enhanced Content.
   This needs to be turned on to show local cover images in OPAC.

Once you have uploaded local images, if you search for the biblio, the local
cover should show up in search as well as search detail pages in the OPAC, and
the details view in the Intranet.

Koustubha Kale is working on another patch which will allow us to set a cover
image source priority in system preferences, and which will then gracefully
fail over to the next source if image is not available from the first choice
source.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Signed-off-by: Koustubha Kale <kmkale@anantcorp.com>

Rebased the patch because it was failing with koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css due to changes pushed in master.
Applies cleanly now.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 1633 - [SIGNED-OFF] Add ability to take book cover images from local img db

OPAC Template revisions:

- Revised OPAC imageviewer template to match structure of
  other OPAC pages (with masthead search, footer, etc)
- Added link back to detail page (controlled by
  BiblioDefaultView preference)
- Added link style to thumbnails on opac-detail to add a sense of
  "clickability" to them
- Revised OPAC imageviewer template to allow it to function
  with JavaScript turned off. Now even without JS main image
  will load, thumbnails will be properly styled, and thumbnail
  links will work.
- Changes to the script are only to pass missing variables
  to the template

TODO: Corresponding changes for the staff client
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Signed-off-by: Koustubha Kale <kmkale@anantcorp.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 1633: [SIGNED-OFF] Don't show image tab when inappropriate

This patch corrects the bug spotted by Owen Leonard where the Images tab was
showing up even for records that didn't have local cover images attached to
them. The tab is now hidden on the OPAC for records that don't have any
images. In the Intranet, an Images tab will show for staff with permission
to upload images, suggesting that they do so. For staff without that
permission, the tab is not shown.

This permission also disables returning images via the opac-image.pl and
catalogue/image.pl scripts when local cover images have been disabled.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Signed-off-by: Koustubha Kale <kmkale@anantcorp.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 1633 - Interface revisions for the staff client

This patch revises the image viewer page to match other
biblio detail pages: a toolbar, a sidebar menu, etc.

Additional data is now pulled by imageviewer.pl in order
to provide information necessary for the proper functioning
of the toolbar and menus: item counts, hold availability,
biblio view options.

Other changes have been made to match the changes in the
OPAC interface like styling of the images and no-javascript
compatibility

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Magnus Enger <magnus@enger.priv.no>

Patch failed to apply because of multiple Content-Type lines in the patch.
Corrected the same with this new patch.

http://bugs.koha-community.org/show_bug.cgi?id=6473
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 1633: QA follow-up

* Show the "Upload images" button when OPACLocalCoverImages is enabled but
LocalCoverImages (i.e. local cover images on the staff client) is not
* Correct copyright and license comments in new files
* perltidy and replace tabs by four spaces

Signed-off-by: Koustubha Kale <kmkale@anantcorp.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 1633 localcoverimages, updatedatabase & kohaversion for pushing

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 1633 follow-up: Fix jenkins tests

The previous patches missed adding the upload_local_cover_images permission to
languages other than en, and used a forbidden TT construct, giving jenkins
agitas and indigestion. This patch adds the permission to other languages and
corrects the syntax.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 1633, follow-up, french string

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>