Bug 15023: Allow patron anonymize/bulk delete tool to be limited by branch
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 27 Jun 2016 15:12:52 +0000 (12:12 -0300)
committerKyle M Hall <kyle@bywatersolutions.com>
Wed, 24 Aug 2016 11:37:02 +0000 (11:37 +0000)
commit38c461f258292adb6199f2b0f261ecc3280b6aa5
tree7a4787a220d6638c80bd83f8ccb188525b9dab6b
parentadbcaa99f4f1a0dc3c739cb15b4d3039d2a79c9e
Bug 15023: Allow patron anonymize/bulk delete tool to be limited by branch

This patch makes the bulk patron delete/anonymize functionality be limited
by branch. It does so by adding a branch selection dropdown and using the
already defined APIs for filtering by branch.

It makes use of C4::Branches::onlymine for the IndependentBranches use case
and it adds a way to call it from the Branches template plugin.

To test:
- Apply the patch
1) Have a superlibrarian user
- Go to Tools > Batch patron deletion/anonymization
=> SUCCESS: Verify you can pick a branch (or all of them)
- Try doing some operations
=> SUCCESS: Verify the selection is respected, and carried around all steps
2) Have a user with tools/delete_anonymize_patrons permissions
- Set IndependentBranches on
- Go to Tools > Batch patron deletion/anonymization
=> SUCCESS: It picks the librarian's branch and doesn't let us choose another one
- Try doing some operations
=> SUCCESS: Verify the user's branch is respected, and carried around all steps
- Sign off :-D

Sponsored-by: VOKAL
Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha/Template/Plugin/Branches.pm
koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt
tools/cleanborrowers.pl