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.
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
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
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>
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>
Pushed to master for 17.05, thanks Aleisha!
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.