Bug 23349

Summary: Add batch operations to staff interface catalog search results
Product: Koha Reporter: Marjorie Barry-Vila <marjorie.barry-vila>
Component: CatalogingAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: 1joynelson, aholt, kohadevinim, m.de.rooy, patrick.robitaille
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
With this enhancement there is a new "Edit" menu on the catalog search that allows to "Batch edit", "Batch delete," and "Merge" selected records from the result list.
Version(s) released in:
20.05.00
Circulation function:
Bug Depends on:    
Bug Blocks: 25659, 26859, 30720    
Attachments: Bug 23349: Add batch operations to staff interface catalog search results
Bug 23349: Add batch operations to staff interface catalog search results
Bug 23349: Add batch operations to staff interface catalog search results
Bug 23349: (follow-up) Correct translation function
Bug 23349: Add batch operations to staff interface catalog search results
Bug 23349: (follow-up) Correct translation function

Description Marjorie Barry-Vila 2019-07-19 15:27:58 UTC
Hi,
It would be interesting to be able to merge records from a list of results (catalogue/search.pl).
The search results in cataloguing/addbooks.pl, where you can merge records, does not filter by document type or other status.

Regards
Marjorie
Comment 1 Owen Leonard 2020-04-06 20:49:34 UTC Comment hidden (obsolete)
Comment 2 Abbey Holt 2020-04-07 15:27:27 UTC
After checking one box and selecting "Batch delete" the following message appears: "You must select at least one record." 

The rest of the testing was successful.
Comment 3 Devinim 2020-04-07 18:08:27 UTC
Hi Owen,

We applied the patch and saw the Edit button but when we checked one of the search, edit button was still disabled.
Comment 4 Owen Leonard 2020-04-09 13:55:03 UTC
Created attachment 102620 [details] [review]
Bug 23349: Add batch operations to staff interface catalog search results

This patch adds three new options to the staff interface catalog search
results for users with cataloging permission: batch edit, batch delete,
and merge. The choices are found in an "Edit" menu which is disabled by
default. Checking any boxes in the search results table enables the
button.

To test, apply the patch and log in to Koha as a user with
edit_catalogue permission.

 - Perform a search in the catalog
 - You should see a disabled "Edit" button in the toolbar at the top of
   the search results table.
 - Check a single checkbox. The button should become enabled.
   - Test the "Batch edit" and "Batch delete" menu items. They should
     work correctly.
   - Test the "Merge records" item. It should warn you that you must
     select at least two records.
 - Check more than one checkbox and test each menu item again. All
   should work as expected.
 - Log in to the staff client as a user who does not have edit_catalogue
   permission. The "Edit" menu should no longer appear on the search
   results page.
Comment 5 Owen Leonard 2020-04-09 13:58:44 UTC
(In reply to Abbey Holt from comment #2)
> After checking one box and selecting "Batch delete" the following message
> appears: "You must select at least one record." 

This should now be fixed.


(In reply to Devinim from comment #3)
> We applied the patch and saw the Edit button but when we checked one of the
> search, edit button was still disabled.

I could not reproduce this problem. Could you clear your browser cache and try the new patch? Thanks!
Comment 6 ByWater Sandboxes 2020-04-09 14:21:52 UTC
Created attachment 102621 [details] [review]
Bug 23349: Add batch operations to staff interface catalog search results

This patch adds three new options to the staff interface catalog search
results for users with cataloging permission: batch edit, batch delete,
and merge. The choices are found in an "Edit" menu which is disabled by
default. Checking any boxes in the search results table enables the
button.

To test, apply the patch and log in to Koha as a user with
edit_catalogue permission.

 - Perform a search in the catalog
 - You should see a disabled "Edit" button in the toolbar at the top of
   the search results table.
 - Check a single checkbox. The button should become enabled.
   - Test the "Batch edit" and "Batch delete" menu items. They should
     work correctly.
   - Test the "Merge records" item. It should warn you that you must
     select at least two records.
 - Check more than one checkbox and test each menu item again. All
   should work as expected.
 - Log in to the staff client as a user who does not have edit_catalogue
   permission. The "Edit" menu should no longer appear on the search
   results page.

Signed-off-by: Abbey Holt <aholt@dubuque.lib.ia.us>
Comment 7 Owen Leonard 2020-04-14 18:10:21 UTC
Changing status to "Signed off" based on comment 6.
Comment 8 Katrin Fischer 2020-04-14 21:48:09 UTC
Hi Owen, please check the strings in the js file - they are not showing up for me in the *messages-js.po file!
Comment 9 Owen Leonard 2020-04-17 15:29:06 UTC
Created attachment 103171 [details] [review]
Bug 23349: (follow-up) Correct translation function

This patch corrects the translation function inside results.js. It
should be two underscores instead of one.
Comment 10 Katrin Fischer 2020-04-18 02:18:18 UTC
Created attachment 103190 [details] [review]
Bug 23349: Add batch operations to staff interface catalog search results

This patch adds three new options to the staff interface catalog search
results for users with cataloging permission: batch edit, batch delete,
and merge. The choices are found in an "Edit" menu which is disabled by
default. Checking any boxes in the search results table enables the
button.

To test, apply the patch and log in to Koha as a user with
edit_catalogue permission.

 - Perform a search in the catalog
 - You should see a disabled "Edit" button in the toolbar at the top of
   the search results table.
 - Check a single checkbox. The button should become enabled.
   - Test the "Batch edit" and "Batch delete" menu items. They should
     work correctly.
   - Test the "Merge records" item. It should warn you that you must
     select at least two records.
 - Check more than one checkbox and test each menu item again. All
   should work as expected.
 - Log in to the staff client as a user who does not have edit_catalogue
   permission. The "Edit" menu should no longer appear on the search
   results page.

Signed-off-by: Abbey Holt <aholt@dubuque.lib.ia.us>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Katrin Fischer 2020-04-18 02:18:23 UTC
Created attachment 103191 [details] [review]
Bug 23349: (follow-up) Correct translation function

This patch corrects the translation function inside results.js. It
should be two underscores instead of one.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Katrin Fischer 2020-04-18 02:20:02 UTC
One of Owen's magical patches :)

I only have one little concern/thing I am not sure about, maybe to have a second look at later: If you check the checkboxes, choose one of the batch features and then use "back" in the browser (maybe you have chosen the wrong one), the checkboxes are still checked, but the "Edit" pull down is disabled.
You have to uncheck/check something for it to unlock again.
Comment 13 Katrin Fischer 2020-04-18 02:35:14 UTC
Another little thing: We have the browse feature now that can carry checkboxes over multiple pages - having the edit do this as well would be pretty awesome.

This will still ease people's pain a lot, especially when merging records. It's always a bit hard to explain in training that you have to use the more limited cataloguing search for this.
Comment 14 Martin Renvoize (ashimema) 2020-04-20 12:38:22 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 15 Joy Nelson 2020-05-07 21:43:34 UTC
enhancement not backported to 19.11.x