[Bug 7813] New: Add ability to delete local cover images
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7813 Priority: P5 - low Change sponsored?: --- Bug ID: 7813 Assignee: oleonard@myacpl.org Summary: Add ability to delete local cover images QA Contact: koha.sekjal@gmail.com Severity: enhancement Classification: Unclassified OS: All Reporter: magnus@enger.priv.no Hardware: All Status: NEW Version: master Component: OPAC Product: Koha Bug 1633 introduced the possibility of local cover images, but without the means to delete images once they have been added. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7813 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |jcamins@cpbibliography.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7813 Magnus Enger <magnus@enger.priv.no> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nengard@gmail.com --- Comment #1 from Magnus Enger <magnus@enger.priv.no> --- *** Bug 9119 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7813 Melia Meggs <melia@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - low |P3 CC| |melia@bywatersolutions.com --- Comment #2 from Melia Meggs <melia@bywatersolutions.com> --- So if you upload an image that you don't like, you have no means of getting rid of it except by replacing it with something else? Seems like there really should be an option to delete an image. I'm going to bump up the importance a little. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7813 Liz Rea (CatalystIT) <liz@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |liz@catalyst.net.nz --- Comment #3 from Liz Rea (CatalystIT) <liz@catalyst.net.nz> --- I agree - we need to be able to remove them. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7813 keinequal@att.net changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |keinequal@att.net --- Comment #4 from keinequal@att.net --- So, how is the ability to delete the local cover image different/similar from the ability to delete the image of the patron? There should not be that much difference in code. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7813 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz --- Comment #5 from Chris Cormack <chris@bigballofwax.co.nz> --- (In reply to comment #4)
So, how is the ability to delete the local cover image different/similar from the ability to delete the image of the patron? There should not be that much difference in code.
A great learning exercise would be to look .. then send a patch implementing the feature :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7813 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Patch complexity|--- |Small patch Change sponsored?|--- |Sponsored Assignee|jcamins@cpbibliography.com |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7813 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7813 --- Comment #6 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 20761 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=20761&action=edit Bug 7813: Ability to delete local cover images This patch adds the ability to delete local cover images from the detail page. It adds a 'x' button to trigger the deletion. It occurs using a new SVC script called cover_images that accepts the following parameters: - action - biblionumber (used for checking imagenumber validity) - imagenumber (repeatable) It then deletes all valid images passed and returns a JSON object containing the imagenumbers and the deletion status (1/0). The operation is triggered using jQuery.ajax, and with the response the corresponding images get deleted. Note: currently one image is deleted at a time, but the code is there to be used. To test: - Open the detail page fr a biblionumber containing one or more cover images, go to its images tab. - Apply the patch, reload the page, go to the images tab. - Thumbnails should look better than before ;-) - An 'X' button should show below each cover. - Clicking the 'X' button should trigger an alert message asking for confirmation. a) Cancel: nothing happens, reload the page and check nothing got deleted. b) Accept: the deleted image should be gone, reload the page to check it doesn't exist anymore and is not a browser/DOM manipulation trick. - Signoff Note: check having more cover images than those that fit the width and see it wraps fine. Any comments are welcome, this is WIP. Thanks To+ P.S. I chose not to implement every possible action on the svc script, but another bug could be filled for more improvements. Sponsored-by: Universidad Nacional de Cordoba -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7813 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7813 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #20761|0 |1 is obsolete| | --- Comment #7 from David Cook <dcook@prosentient.com.au> --- Created attachment 20763 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=20763&action=edit Bug 7813: Ability to delete local cover images This patch adds the ability to delete local cover images from the detail page. It adds a 'x' button to trigger the deletion. It occurs using a new SVC script called cover_images that accepts the following parameters: - action - biblionumber (used for checking imagenumber validity) - imagenumber (repeatable) It then deletes all valid images passed and returns a JSON object containing the imagenumbers and the deletion status (1/0). The operation is triggered using jQuery.ajax, and with the response the corresponding images get deleted. Note: currently one image is deleted at a time, but the code is there to be used. To test: - Open the detail page fr a biblionumber containing one or more cover images, go to its images tab. - Apply the patch, reload the page, go to the images tab. - Thumbnails should look better than before ;-) - An 'X' button should show below each cover. - Clicking the 'X' button should trigger an alert message asking for confirmation. a) Cancel: nothing happens, reload the page and check nothing got deleted. b) Accept: the deleted image should be gone, reload the page to check it doesn't exist anymore and is not a browser/DOM manipulation trick. - Signoff Note: check having more cover images than those that fit the width and see it wraps fine. Any comments are welcome, this is WIP. Thanks To+ P.S. I chose not to implement every possible action on the svc script, but another bug could be filled for more improvements. Sponsored-by: Universidad Nacional de Cordoba Signed-off-by: David Cook <dcook@prosentient.com.au> Works as described. This is a nice addition! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7813 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #8 from David Cook <dcook@prosentient.com.au> --- Alas, when I try in 3.8.0 (after manually merging the patch with the code), I get this error: Uncaught Syntax error, unrecognized expression: [{"imagenumber":"13","deleted":1}] jquery.js:19 F.filter jquery.js:19 F jquery.js:19 F jquery.js:19 o.fn.o.find jquery.js:12 jQuery.fn.find jquery.hotkeys.min.js:1 o.fn.o.init jquery.js:12 l.jQuery.l.$ jquery.js:12 $.ajax.success detail.pl?biblionumber=179:102 I jquery.js:19 N jquery.js:19 Maybe I made a mistake doing the merge? Or maybe an older version of jQuery has a harder time processing JSON but that seems strange... -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7813 --- Comment #9 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to David Cook from comment #8)
Alas, when I try in 3.8.0 (after manually merging the patch with the code), I get this error:
Uncaught Syntax error, unrecognized expression: [{"imagenumber":"13","deleted":1}] jquery.js:19
Maybe I made a mistake doing the merge? Or maybe an older version of jQuery has a harder time processing JSON but that seems strange...
I'm not sure about that one, but it might be due to: - wrong jquery version (incorrectly processing the application/json content-type) - wrong JSON Perl library (not outputting the right format) I'd like to note that I used bootstrap on this patch, and there are some visual gli-glitches when merging into 3.8.x. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7813 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7813 --- Comment #10 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 21272 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=21272&action=edit Bug 7813: Followup Ability to delete local cover images This patch: - displays a js alert if a problem occurred on deleting the image on the server. - adds a class for the new span (in order to avoid future problem, if someone adds a new span). - adds a title for the [x] link. - deal with the upload_local_cover_images permission (don't display the delete link if the logged in user does not have it). - changes the license version. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7813 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m --- Comment #11 from Jonathan Druart <jonathan.druart@biblibre.com> --- Hi Tomás, I think this followup improves yours. Could you have a look at it and add a signoff if you agree? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7813 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7813 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #21272|0 |1 is obsolete| | --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 21275 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=21275&action=edit Bug 7813: Followup Ability to delete local cover images This patch: - displays a js alert if a problem occurred on deleting the image on the server. - adds a class for the new span (in order to avoid future problem, if someone adds a new span). - adds a title for the [x] link. - deal with the upload_local_cover_images permission (don't display the delete link if the logged in user does not have it). - changes the license version. Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> I like the ehancements to the original patch and work as expected. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7813 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA QA Contact| |jonathan.druart@biblibre.co | |m --- Comment #13 from Jonathan Druart <jonathan.druart@biblibre.com> --- Marked as Passed QA. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7813 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #20763|0 |1 is obsolete| | --- Comment #14 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 21276 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=21276&action=edit Bug 7813: Ability to delete local cover images This patch adds the ability to delete local cover images from the detail page. It adds a 'x' button to trigger the deletion. It occurs using a new SVC script called cover_images that accepts the following parameters: - action - biblionumber (used for checking imagenumber validity) - imagenumber (repeatable) It then deletes all valid images passed and returns a JSON object containing the imagenumbers and the deletion status (1/0). The operation is triggered using jQuery.ajax, and with the response the corresponding images get deleted. Note: currently one image is deleted at a time, but the code is there to be used. To test: - Open the detail page fr a biblionumber containing one or more cover images, go to its images tab. - Apply the patch, reload the page, go to the images tab. - Thumbnails should look better than before ;-) - An 'X' button should show below each cover. - Clicking the 'X' button should trigger an alert message asking for confirmation. a) Cancel: nothing happens, reload the page and check nothing got deleted. b) Accept: the deleted image should be gone, reload the page to check it doesn't exist anymore and is not a browser/DOM manipulation trick. - Signoff Note: check having more cover images than those that fit the width and see it wraps fine. Any comments are welcome, this is WIP. Thanks To+ P.S. I chose not to implement every possible action on the svc script, but another bug could be filled for more improvements. Sponsored-by: Universidad Nacional de Cordoba Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7813 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #21275|0 |1 is obsolete| | --- Comment #15 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 21277 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=21277&action=edit Bug 7813: Followup Ability to delete local cover images This patch: - displays a js alert if a problem occurred on deleting the image on the server. - adds a class for the new span (in order to avoid future problem, if someone adds a new span). - adds a title for the [x] link. - deal with the upload_local_cover_images permission (don't display the delete link if the logged in user does not have it). - changes the license version. Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> I like the ehancements to the original patch and work as expected. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7813 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |gmcharlt@gmail.com --- Comment #16 from Galen Charlton <gmcharlt@gmail.com> --- Pushed to master, along with a follow-up that replaces the "×" symbol with more descriptive text to make it easier for users and translators. Thanks, Tomás and Jonathan! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7813 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable --- Comment #17 from Tomás Cohen Arazi <tomascohen@gmail.com> --- This patch has been pushed to 3.12.x, will be in 3.12.7. Long standing usability bug solved :-D -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org