This will add a new tool for deleting records: biblios and authorities.
Created attachment 28764 [details] [review] Bug 12403: Add a batch record deletion This patch offers a new tool for deleting records. Biblios and authorities will can to be deleted with a simple list of biblionumber or authid. This feature adds: - a new pl/tt files tools/batch_delete_records - a new permission: tools > records_batchdel Test plan for biblios: 1/ There are two ways to generate a list of biblionumbers: - using the basket: do a search, add some biblio to your basket, open the basket and click on the "Action" button > "Delete" - generating a list from a report 2/ On the "Batch record deletion" tool verify: - biblios with issues cannot be deleted (checkbox disabled and line in red). - information is correct. - sort functions work on each columns. - the items, reserves and issues values are correct. 3/ After clicking on the "Delete selected recors" button, verify: - reserves, items and biblio have successful been deleted. - if an error occurs, the tool display an error message. Test plan for authority: 1/ Generate a list of authid using a report: 2/ On the "Batch record deletion" tool verify: - authorities are display with the summary. - the count usage (used in X biblios) is correct. 3/ After clicking on the "Delete selected recors" button, verify: - The authorities have successful been deleted. - if an error occurs, the tool display an error message.
Created attachment 28765 [details] [review] Bug 12403: Add the new permission tools_records_batchdelitem
Created attachment 28766 [details] [review] Bug 12403: Don't check disabled checkboxes
Hi there Jonathan! Great to be signing off your patches again! I am building batch removal of component parts on top of this feature.
Could you make a C4/Koha-module out of ($op eq 'delete') feature in batch_delete_records.pl? So it would be easier to reuse that.
(In reply to Olli-Antti Kivilahti from comment #5) > Could you make a C4/Koha-module out of ($op eq 'delete') feature in > batch_delete_records.pl? > > So it would be easier to reuse that. Hi Olli, There is no important logic in the pl file. Most of the code is error encapsulation. Where do you want to reuse this part of code?
Error encapsulation is important logic. :) Just automatically make a Z39.50 search to find all component parts for a record, then ask does the user want to remove all of them, then remove all of them + parent record. But I got it covered. Component parts don't have items so there are no different states to check for.
Hi Jonathan, FAIL koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt FAIL forbidden patterns forbidden pattern: To include datatables files, please use the include file (see bug 10868) (line 6) Captured by your own code :) [http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10868#c4]
Created attachment 29565 [details] [review] Bug 12403: Add a batch record deletion This patch offers a new tool for deleting records. Biblios and authorities will can to be deleted with a simple list of biblionumber or authid. This feature adds: - a new pl/tt files tools/batch_delete_records - a new permission: tools > records_batchdel Test plan for biblios: 1/ There are two ways to generate a list of biblionumbers: - using the basket: do a search, add some biblio to your basket, open the basket and click on the "Action" button > "Delete" - generating a list from a report 2/ On the "Batch record deletion" tool verify: - biblios with issues cannot be deleted (checkbox disabled and line in red). - information is correct. - sort functions work on each columns. - the items, reserves and issues values are correct. 3/ After clicking on the "Delete selected recors" button, verify: - reserves, items and biblio have successful been deleted. - if an error occurs, the tool display an error message. Test plan for authority: 1/ Generate a list of authid using a report: 2/ On the "Batch record deletion" tool verify: - authorities are display with the summary. - the count usage (used in X biblios) is correct. 3/ After clicking on the "Delete selected recors" button, verify: - The authorities have successful been deleted. - if an error occurs, the tool display an error message.
Created attachment 29566 [details] [review] Bug 12403: Add the new permission tools_records_batchdelitem
Created attachment 29567 [details] [review] Bug 12403: Don't check disabled checkboxes
(In reply to Bernardo Gonzalez Kriegel from comment #8) > Captured by your own code :) > [http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10868#c4] Ooops :) Actually I rebased this patch from an old version and I forgot to launch the qa script. Note that the qa script still raises an error: FAIL tools/batch_delete_records.pl FAIL valid Smartmatch is experimental Useless use of '\'; doesn't escape metacharacter '(' But it is not relevant, it's just because the script uses C4::Authorities (which raises this warning).
Hi Jonathan, testing again. Now koha-qa pass, but: 1) Can't delete biblio records, got something like Can't use string ("51") as a HASH ref while "strict refs" in use at /home/bgkriegel/kohaclone/C4/Reserves.pm line 292 2) Perhaps ergonomic issue, when you put some records on cart, and go to actions 'delete' what you get is the full tools > batch record deletion page, not a big big deal. 3) Deleting authorities works, but the message is confusing It said 0 / 1 records have successfully been deleted. Some errors occurred for one successful deletion, should be 1 / 1 i think
Created attachment 30986 [details] [review] Bug 12403: Add a batch record deletion This patch offers a new tool for deleting records. Biblios and authorities will can to be deleted with a simple list of biblionumber or authid. This feature adds: - a new pl/tt files tools/batch_delete_records - a new permission: tools > records_batchdel Test plan for biblios: 1/ There are two ways to generate a list of biblionumbers: - using the basket: do a search, add some biblio to your basket, open the basket and click on the "Action" button > "Delete" - generating a list from a report 2/ On the "Batch record deletion" tool verify: - biblios with issues cannot be deleted (checkbox disabled and line in red). - information is correct. - sort functions work on each columns. - the items, reserves and issues values are correct. 3/ After clicking on the "Delete selected recors" button, verify: - reserves, items and biblio have successful been deleted. - if an error occurs, the tool display an error message. Test plan for authority: 1/ Generate a list of authid using a report: 2/ On the "Batch record deletion" tool verify: - authorities are display with the summary. - the count usage (used in X biblios) is correct. 3/ After clicking on the "Delete selected recors" button, verify: - The authorities have successful been deleted. - if an error occurs, the tool display an error message.
Created attachment 30987 [details] [review] Bug 12403: Add the new permission tools_records_batchdelitem
(In reply to Bernardo Gonzalez Kriegel from comment #13) > Hi Jonathan, testing again. Thanks Bernardo! > 1) Can't delete biblio records, got something like > > Can't use string ("51") as a HASH ref while "strict refs" in use at > /home/bgkriegel/kohaclone/C4/Reserves.pm line 292 Arg wrong call to GetReservesFromBiblionumber, should be fixed now. > 2) Perhaps ergonomic issue, when you put some records on cart, and go to > actions 'delete' what you get is the full tools > batch record deletion > page, not a big big deal. It's what is expected. What are you expected? > 3) Deleting authorities works, but the message is confusing > It said > > 0 / 1 records have successfully been deleted. Some errors occurred > > for one successful deletion, should be 1 / 1 i think Fixed.
Created attachment 32252 [details] [review] Bug 12403: Add a batch record deletion This patch offers a new tool for deleting records. Biblios and authorities will can to be deleted with a simple list of biblionumber or authid. This feature adds: - a new pl/tt files tools/batch_delete_records - a new permission: tools > records_batchdel Test plan for biblios: 1/ There are two ways to generate a list of biblionumbers: - using the basket: do a search, add some biblio to your basket, open the basket and click on the "Action" button > "Delete" - generating a list from a report 2/ On the "Batch record deletion" tool verify: - biblios with issues cannot be deleted (checkbox disabled and line in red). - information is correct. - sort functions work on each columns. - the items, reserves and issues values are correct. 3/ After clicking on the "Delete selected recors" button, verify: - reserves, items and biblio have successful been deleted. - if an error occurs, the tool display an error message. Test plan for authority: 1/ Generate a list of authid using a report: 2/ On the "Batch record deletion" tool verify: - authorities are display with the summary. - the count usage (used in X biblios) is correct. 3/ After clicking on the "Delete selected recors" button, verify: - The authorities have successful been deleted. - if an error occurs, the tool display an error message. Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Created attachment 32253 [details] [review] Bug 12403: Add the new permission tools_records_batchdelitem Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Working on this now.
I like this. :) A possible enhancement I'd like to see would be adding an order and subscription count to the table as well. This would match the checks we do in acquisitions to make sure we don't delete something, that would have unwanted consequences. But not a blocker.
Created attachment 32778 [details] [review] [PASSED QA] Bug 12403: Add a batch record deletion This patch offers a new tool for deleting records. Biblios and authorities will can to be deleted with a simple list of biblionumber or authid. This feature adds: - a new pl/tt files tools/batch_delete_records - a new permission: tools > records_batchdel Test plan for biblios: 1/ There are two ways to generate a list of biblionumbers: - using the basket: do a search, add some biblio to your basket, open the basket and click on the "Action" button > "Delete" - generating a list from a report 2/ On the "Batch record deletion" tool verify: - biblios with issues cannot be deleted (checkbox disabled and line in red). - information is correct. - sort functions work on each columns. - the items, reserves and issues values are correct. 3/ After clicking on the "Delete selected recors" button, verify: - reserves, items and biblio have successful been deleted. - if an error occurs, the tool display an error message. Test plan for authority: 1/ Generate a list of authid using a report: 2/ On the "Batch record deletion" tool verify: - authorities are display with the summary. - the count usage (used in X biblios) is correct. 3/ After clicking on the "Delete selected recors" button, verify: - The authorities have successful been deleted. - if an error occurs, the tool display an error message. Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 32779 [details] [review] [PASSED QA] Bug 12403: Add the new permission tools_records_batchdelitem Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 32780 [details] [review] Bug 12403: Follow-up - fixing a few typos - Fixes the permission on the tools page - Fixes some capitalization - Changes 'Reserves' to 'Holds'
Created attachment 32845 [details] [review] Bug 12403 [Follow-up] Batch record deletion This follow-up makes several changes to language and markup with one change in behavior: - Updated permission description to avoid the use of the term "biblio" - Updated batch delete template to avoid the use of the term "biblio" and to improve clarity. - Replaced instances of terms "issue" and "reserve" with "checkout" and "hold" respectively. - On bibliographic record batch delete, wrap biblionumber in <label>. - On bibliographic record batch delete, show subtitle via Keywords to MARC mapping. - On bibliographic record batch delete, respect BiblioDefaultView system preference. - In the staff client cart, move batch delete link from "Action" menu to text link below (alongside "add to list" and "place hold"). The buttons are actions which affect the whole Cart. The links are actions which can be applied to selected items. I think this change makes it more consistent with the kind of operation being performed. To test: - Submit a batch of bibliographic records and confirm that the list of titles shows subtitle data as defined in Keywords to MARC mapping. Confirm also that the title links respect your BiblioDefaultView system preference. - Perform a catalog search, select several titles, and add them to the Cart. Open the Cart and test the "Batch delete" link with and without titles selected. Test as a user who lacks batch biblio delete permission and confirm that the link does not appear.
Created attachment 32853 [details] [review] [SIGNED-OFF] Bug 12403: Follow-up - fixing a few typos - Fixes the permission on the tools page - Fixes some capitalization - Changes 'Reserves' to 'Holds' Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Created attachment 32854 [details] [review] [SIGNED-OFF] Bug 12403 [Follow-up] Batch record deletion This follow-up makes several changes to language and markup with one change in behavior: - Updated permission description to avoid the use of the term "biblio" - Updated batch delete template to avoid the use of the term "biblio" and to improve clarity. - Replaced instances of terms "issue" and "reserve" with "checkout" and "hold" respectively. - On bibliographic record batch delete, wrap biblionumber in <label>. - On bibliographic record batch delete, show subtitle via Keywords to MARC mapping. - On bibliographic record batch delete, respect BiblioDefaultView system preference. - In the staff client cart, move batch delete link from "Action" menu to text link below (alongside "add to list" and "place hold"). The buttons are actions which affect the whole Cart. The links are actions which can be applied to selected items. I think this change makes it more consistent with the kind of operation being performed. To test: - Submit a batch of bibliographic records and confirm that the list of titles shows subtitle data as defined in Keywords to MARC mapping. Confirm also that the title links respect your BiblioDefaultView system preference. - Perform a catalog search, select several titles, and add them to the Cart. Open the Cart and test the "Batch delete" link with and without titles selected. Test as a user who lacks batch biblio delete permission and confirm that the link does not appear. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Work as described, no koha-qa errors I love the rewording, we always translated 'biblio' as 'bibliographic record', it makes a lot of sense. Tested using direct input of biblionumber or cart, subtitle display shows correctly, link respect preference, user without permission cant acces the tool or links.
Created attachment 32859 [details] [review] [PASSED QA] Bug 12403: Add a batch record deletion This patch offers a new tool for deleting records. Biblios and authorities will can to be deleted with a simple list of biblionumber or authid. This feature adds: - a new pl/tt files tools/batch_delete_records - a new permission: tools > records_batchdel Test plan for biblios: 1/ There are two ways to generate a list of biblionumbers: - using the basket: do a search, add some biblio to your basket, open the basket and click on the "Action" button > "Delete" - generating a list from a report 2/ On the "Batch record deletion" tool verify: - biblios with issues cannot be deleted (checkbox disabled and line in red). - information is correct. - sort functions work on each columns. - the items, reserves and issues values are correct. 3/ After clicking on the "Delete selected recors" button, verify: - reserves, items and biblio have successful been deleted. - if an error occurs, the tool display an error message. Test plan for authority: 1/ Generate a list of authid using a report: 2/ On the "Batch record deletion" tool verify: - authorities are display with the summary. - the count usage (used in X biblios) is correct. 3/ After clicking on the "Delete selected recors" button, verify: - The authorities have successful been deleted. - if an error occurs, the tool display an error message. Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 32860 [details] [review] [PASSED QA] Bug 12403: Add the new permission tools_records_batchdelitem Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 32861 [details] [review] [PASSED QA] Bug 12403: Follow-up - fixing a few typos - Fixes the permission on the tools page - Fixes some capitalization - Changes 'Reserves' to 'Holds' Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 32862 [details] [review] [PASSED QA] Bug 12403 [Follow-up] Batch record deletion This follow-up makes several changes to language and markup with one change in behavior: - Updated permission description to avoid the use of the term "biblio" - Updated batch delete template to avoid the use of the term "biblio" and to improve clarity. - Replaced instances of terms "issue" and "reserve" with "checkout" and "hold" respectively. - On bibliographic record batch delete, wrap biblionumber in <label>. - On bibliographic record batch delete, show subtitle via Keywords to MARC mapping. - On bibliographic record batch delete, respect BiblioDefaultView system preference. - In the staff client cart, move batch delete link from "Action" menu to text link below (alongside "add to list" and "place hold"). The buttons are actions which affect the whole Cart. The links are actions which can be applied to selected items. I think this change makes it more consistent with the kind of operation being performed. To test: - Submit a batch of bibliographic records and confirm that the list of titles shows subtitle data as defined in Keywords to MARC mapping. Confirm also that the title links respect your BiblioDefaultView system preference. - Perform a catalog search, select several titles, and add them to the Cart. Open the Cart and test the "Batch delete" link with and without titles selected. Test as a user who lacks batch biblio delete permission and confirm that the link does not appear. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Work as described, no koha-qa errors I love the rewording, we always translated 'biblio' as 'bibliographic record', it makes a lot of sense. Tested using direct input of biblionumber or cart, subtitle display shows correctly, link respect preference, user without permission cant acces the tool or links. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 32863 [details] [review] [PASSED QA] Bug 12403: Add a batch record deletion This patch offers a new tool for deleting records. Biblios and authorities will can to be deleted with a simple list of biblionumber or authid. This feature adds: - a new pl/tt files tools/batch_delete_records - a new permission: tools > records_batchdel Test plan for biblios: 1/ There are two ways to generate a list of biblionumbers: - using the basket: do a search, add some biblio to your basket, open the basket and click on the "Action" button > "Delete" - generating a list from a report 2/ On the "Batch record deletion" tool verify: - biblios with issues cannot be deleted (checkbox disabled and line in red). - information is correct. - sort functions work on each columns. - the items, reserves and issues values are correct. 3/ After clicking on the "Delete selected recors" button, verify: - reserves, items and biblio have successful been deleted. - if an error occurs, the tool display an error message. Test plan for authority: 1/ Generate a list of authid using a report: 2/ On the "Batch record deletion" tool verify: - authorities are display with the summary. - the count usage (used in X biblios) is correct. 3/ After clicking on the "Delete selected recors" button, verify: - The authorities have successful been deleted. - if an error occurs, the tool display an error message. Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 32864 [details] [review] [PASSED QA] Bug 12403: Add the new permission tools_records_batchdelitem Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 32865 [details] [review] [PASSED QA] Bug 12403: Follow-up - fixing a few typos - Fixes the permission on the tools page - Fixes some capitalization - Changes 'Reserves' to 'Holds' Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 32866 [details] [review] [PASSED QA] Bug 12403 [Follow-up] Batch record deletion This follow-up makes several changes to language and markup with one change in behavior: - Updated permission description to avoid the use of the term "biblio" - Updated batch delete template to avoid the use of the term "biblio" and to improve clarity. - Replaced instances of terms "issue" and "reserve" with "checkout" and "hold" respectively. - On bibliographic record batch delete, wrap biblionumber in <label>. - On bibliographic record batch delete, show subtitle via Keywords to MARC mapping. - On bibliographic record batch delete, respect BiblioDefaultView system preference. - In the staff client cart, move batch delete link from "Action" menu to text link below (alongside "add to list" and "place hold"). The buttons are actions which affect the whole Cart. The links are actions which can be applied to selected items. I think this change makes it more consistent with the kind of operation being performed. To test: - Submit a batch of bibliographic records and confirm that the list of titles shows subtitle data as defined in Keywords to MARC mapping. Confirm also that the title links respect your BiblioDefaultView system preference. - Perform a catalog search, select several titles, and add them to the Cart. Open the Cart and test the "Batch delete" link with and without titles selected. Test as a user who lacks batch biblio delete permission and confirm that the link does not appear. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Work as described, no koha-qa errors I love the rewording, we always translated 'biblio' as 'bibliographic record', it makes a lot of sense. Tested using direct input of biblionumber or cart, subtitle display shows correctly, link respect preference, user without permission cant acces the tool or links. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
*** Bug 12050 has been marked as a duplicate of this bug. ***
Patches pushed to master. Thanks Jonathan!