Bug 12559: Wrong message if all cover images deleted
authorTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 11 Jul 2014 18:35:27 +0000 (15:35 -0300)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 18 Jul 2014 13:41:27 +0000 (10:41 -0300)
commitd020e0a5a1e22525cf8d0ee8e3f15ac09a7bb9ed
treea2b6c84905f04e4137c17bc93795275e3d26ec67
parent62a08be95b575f0cbc861f44505b06c42283d38c
Bug 12559: Wrong message if all cover images deleted

If a record contains a (one or more) local cover image and it is deleted, a wrong message is presented in the UI.

To reproduce:
 - Have LocalCoverImages set to "Display" and AllowMultipleCovers set to "Allow".
 - Go to the detail page of a record that has no images attached.
 - The 'Images' tab conveniently shows the following message:
   "No images have been uploaded..."
 - Use the "upload" link to add a local cover to the record
 - Complete the process, and "view final record".
 - The 'Images' tab shows the added cover.
 - Delete the cover image using the link below the cover.
=> FAIL: 'Click on an image...' message still shows instead of 'No images have been...'

To test:
 - Apply the patch
 - Repeat the previous steps
=> SUCCESS : 'No images have been...'

Bonus points: previous code didn't show a message at all if the user didn't have
permissions to upload local cover images. I've split the message  in two:
 - 'No images have been...' (for everyone)
 - 'Please upload (link)...' (for those with the right permissions :-D

Regards
To+

Edit: I used JavaScript to inject the 'No images...' message to aid localization.
It can be improved once we fix some stuff in the translation scripts to better support
placeholders/variables in the templates.

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt