Bug 7626 - Delete multiple tags at once
Summary: Delete multiple tags at once
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Aleisha Amohia
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-29 17:51 UTC by Owen Leonard
Modified: 2017-12-07 22:16 UTC (History)
3 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 7626 - Delete multiple tags at once (2.72 KB, patch)
2012-02-29 17:53 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 7626: Delete multiple tags in OPAC at once (5.92 KB, patch)
2017-02-15 00:07 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 7626: Delete multiple tags in OPAC at once (6.09 KB, patch)
2017-02-15 20:54 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 7626: Delete multiple tags in OPAC at once (6.16 KB, patch)
2017-02-16 10:38 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2012-02-29 17:51:01 UTC
opac-tags.pl is written in such a way that it's simple to pass multiple tag ids for deletion. If we add a checkbox by each tag in the user's tags list they can select tags to delete and submit many at once.

The problem with this is a potential conflict with the individual "delete" buttons in each row of the tags table. Each one of those is a submit button as well, named with the tag id to be deleted. What if I select multiple tags, then decide I just want to delete one by clicking the delete button in that row? The script will still pass data for each checked tag and delete them.

A javascript solution to this problem would be fairly simple. However, the tags feature currently works well without javascript and I'd hate to add that dependency.

Options: 

1) Forget about multiple tag deletion. 
2) Get rid of the "delete" button on each line of the tags table and force the user to check boxes for deletions (like we do with items on a list). 
3) Something else, like re-writing the way opac-tags.pl handles deletions.
Comment 1 Owen Leonard 2012-02-29 17:53:59 UTC
Created attachment 7949 [details] [review]
Bug 7626 - Delete multiple tags at once

This patch demonstrates that it is possible with a template
change to allow a patron to delete multiple tags at once.
It is a proof of concept and should not be used until
work is done to address the issues raised in Bug 7626
Comment 2 Aleisha Amohia 2017-02-15 00:07:19 UTC
Created attachment 60225 [details] [review]
Bug 7626: Delete multiple tags in OPAC at once

This patch removes the individual 'Delete' buttons for every tag as
suggested in Comment 0. It adds a checkbox to every tag, with a 'Delete
selected tags' button at the bottom of the table. This patch also adds a
function to check if any checkboxes have been checked before submitting
the form (only works with JS enabled).

To test:
1) Find a record in the OPAC and add some tags to it
2) Go to your tags and notice the checkboxes, no more delete buttons for
each tag
3) Click 'Delete selected tags' button without selecting any tags
4) Confirm alert shows up. Click OK
5) Select one or more tags and click 'Delete selected tags' button
6) Confirm delete is successful and correct number of deleted tags shows
up

Sponsored-by: Catalyst IT
Comment 3 Marc Véron 2017-02-15 20:54:29 UTC
Created attachment 60294 [details] [review]
Bug 7626: Delete multiple tags in OPAC at once

This patch removes the individual 'Delete' buttons for every tag as
suggested in Comment 0. It adds a checkbox to every tag, with a 'Delete
selected tags' button at the bottom of the table. This patch also adds a
function to check if any checkboxes have been checked before submitting
the form (only works with JS enabled).

To test:
1) Find a record in the OPAC and add some tags to it
2) Go to your tags and notice the checkboxes, no more delete buttons for
each tag
3) Click 'Delete selected tags' button without selecting any tags
4) Confirm alert shows up. Click OK
5) Select one or more tags and click 'Delete selected tags' button
6) Confirm delete is successful and correct number of deleted tags shows
up

Sponsored-by: Catalyst IT

Followed test plan, works as expected
Signed-off-by: Marc Véron <veron@veron.ch>
Comment 4 Jonathan Druart 2017-02-16 10:38:06 UTC
Created attachment 60310 [details] [review]
Bug 7626: Delete multiple tags in OPAC at once

This patch removes the individual 'Delete' buttons for every tag as
suggested in Comment 0. It adds a checkbox to every tag, with a 'Delete
selected tags' button at the bottom of the table. This patch also adds a
function to check if any checkboxes have been checked before submitting
the form (only works with JS enabled).

To test:
1) Find a record in the OPAC and add some tags to it
2) Go to your tags and notice the checkboxes, no more delete buttons for
each tag
3) Click 'Delete selected tags' button without selecting any tags
4) Confirm alert shows up. Click OK
5) Select one or more tags and click 'Delete selected tags' button
6) Confirm delete is successful and correct number of deleted tags shows
up

Sponsored-by: Catalyst IT

Followed test plan, works as expected
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Kyle M Hall (khall) 2017-02-17 17:11:44 UTC
Pushed to master for 17.05, thanks Aleisha!
Comment 6 Katrin Fischer 2017-02-19 20:46:56 UTC
Always happy to see one of those old 4-digit bug numbers resolved!

This won't get ported back to 16.11.x as it is an enhancement.