Bug 15037 - Batch checkout tab should be hidden for patrons not satisfying policy
Summary: Batch checkout tab should be hidden for patrons not satisfying policy
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on: 11759
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-20 13:58 UTC by Tomás Cohen Arazi
Modified: 2016-06-21 21:40 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 15037: Correctly check the patron categories on displaying the Batch checkout tab (1.83 KB, patch)
2015-10-21 13:12 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15037: Correctly check the patron categories on displaying the Batch checkout tab (2.09 KB, patch)
2015-10-21 20:31 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
[PASSED QA] Bug 15037: Correctly check the patron categories on displaying the Batch checkout tab (2.16 KB, patch)
2015-10-23 10:53 UTC, Kyle M Hall
Details | Diff | Splinter Review
[PASSED QA] Bug 15037: Correctly check the patron categories on displaying the Batch checkout tab (2.16 KB, patch)
2015-10-23 10:54 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2015-10-20 13:58:47 UTC
There's no use for the Batch checkout tab when the patron belongs to a category that is not listed in BatchCheckoutsValidCategories.

I belive the tab should be hidden in that case.
Comment 1 Jonathan Druart 2015-10-21 09:55:46 UTC
Could you please detail? The tab is hidden for me.
Comment 2 Tomás Cohen Arazi 2015-10-21 11:41:35 UTC
Steps to reproduce:
- Set BatchCheckouts to "allow"
- Set BatchCheckoutsValidCategories to ST
- Have a patron in another category (for example S)
- Go to that patron details
=> FAIL: You can see the "Batch checkouts" tab, if you choose it, Koh correctly says that patron category cannot be used for batch checkouts.
Comment 3 Jonathan Druart 2015-10-21 11:47:15 UTC
That's how I have tested, and it works here, weird.
Comment 4 Jonathan Druart 2015-10-21 13:12:38 UTC Comment hidden (obsolete)
Comment 5 Tomás Cohen Arazi 2015-10-21 20:31:47 UTC Comment hidden (obsolete)
Comment 6 Kyle M Hall 2015-10-23 10:53:50 UTC Comment hidden (obsolete)
Comment 7 Kyle M Hall 2015-10-23 10:54:08 UTC
Created attachment 43816 [details] [review]
[PASSED QA] Bug 15037: Correctly check the patron categories on displaying the Batch checkout tab

When checking for the patron categories allowed to use the batch
checkout, the comparison should be strict (eq).

Test plan:
0/ Do not apply this patch
1/ Create 2 patron categories ST and S
2/ Enable BatchCheckouts and define BatchCheckoutsValidCategories = S
3/ Create 2 patrons, 1 in the ST category and the other one in S
4/ On the patron detail page, you should see the "batch checkout" tab
for both patron
5/ Apply this patch
6/ The tab should only be displayed for the patron S

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Tested using an 'S' patron and allowing 'ST' patrons only, worked as expected.
Also tried setting &batch=1 to force it to show the batch page, and it says
I'm not allowed to do batch checkouts for that patron. Great!

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 8 Tomás Cohen Arazi 2015-10-23 13:52:44 UTC
Patch pushed to master.

Thanks Jonathan!