Bug 35924 - The 'checkin slip' button should not be available for patrons whose privacy is set to never
Summary: The 'checkin slip' button should not be available for patrons whose privacy i...
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Kyle M Hall
QA Contact: Victor Grousset/tuxayo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-26 18:31 UTC by Nick Clemens (kidclamp)
Modified: 2024-03-19 20:37 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.04


Attachments
Bug 35924: Hide the print checkins button on the patron screens for patron's who always anonymize (1.85 KB, patch)
2024-01-29 11:58 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 35924: Hide the print checkins button on the checkin screen for patron's who always anonymize (2.00 KB, patch)
2024-01-29 11:58 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 35924: Hide the print checkins button on the patron screens for patron's who always anonymize (1.91 KB, patch)
2024-02-02 21:39 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 35924: Hide the print checkins button on the checkin screen for patron's who always anonymize (2.06 KB, patch)
2024-02-02 21:39 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 35924: Hide the print checkins button on the patron screens for patron's who always anonymize (1.96 KB, patch)
2024-03-03 00:10 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 35924: Hide the print checkins button on the checkin screen for patron's who always anonymize (2.11 KB, patch)
2024-03-03 00:10 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 35924: (QA follow-up): Comment magic number (patron.privacy < 2) (2.35 KB, patch)
2024-03-03 00:10 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2024-01-26 18:31:17 UTC
If a patron anonymizes their checkins, the checkin slip cannot retrieve any info to print the checkin slip. We should not show the button in this scenario
Comment 1 Kyle M Hall 2024-01-29 11:58:08 UTC
Created attachment 161592 [details] [review]
Bug 35924: Hide the print checkins button on the patron screens for patron's who always anonymize

If a patron anonymizes their checkins, the checkin slip cannot retrieve any info to print the checkin slip. We should not show the button in this scenario

Test Plan:
1) Set a patron's privacy to "Never"
2) Note the "Print checkin slip" option in the Print button on the
   patrons toolbar displays
3) Apply this patch
4) Reload the page
5) Note the option is now missing
6) Set the patron's privacy to "Forever" or "Default"
7) Reload the page
8) Note the print checkins option is back!
Comment 2 Kyle M Hall 2024-01-29 11:58:18 UTC
Created attachment 161593 [details] [review]
Bug 35924: Hide the print checkins button on the checkin screen for patron's who always anonymize

Test Plan:
1) Set a patron's privacy to "Never"
2) Check out a few items to a patron
3) Check in one item
4) Note the "Print checkin slip" diplays
3) Apply this patch
4) Check in an  item
5) Note the option is now missing
6) Set the patron's privacy to "Forever" or "Default"
7) Check in an item
8) Note the print checkins option is back!
Comment 3 Andrew Fuerste-Henry 2024-02-02 21:39:19 UTC
Created attachment 161734 [details] [review]
Bug 35924: Hide the print checkins button on the patron screens for patron's who always anonymize

If a patron anonymizes their checkins, the checkin slip cannot retrieve any info to print the checkin slip. We should not show the button in this scenario

Test Plan:
1) Set a patron's privacy to "Never"
2) Note the "Print checkin slip" option in the Print button on the
   patrons toolbar displays
3) Apply this patch
4) Reload the page
5) Note the option is now missing
6) Set the patron's privacy to "Forever" or "Default"
7) Reload the page
8) Note the print checkins option is back!

Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Comment 4 Andrew Fuerste-Henry 2024-02-02 21:39:21 UTC
Created attachment 161735 [details] [review]
Bug 35924: Hide the print checkins button on the checkin screen for patron's who always anonymize

Test Plan:
1) Set a patron's privacy to "Never"
2) Check out a few items to a patron
3) Check in one item
4) Note the "Print checkin slip" diplays
3) Apply this patch
4) Check in an  item
5) Note the option is now missing
6) Set the patron's privacy to "Forever" or "Default"
7) Check in an item
8) Note the print checkins option is back!

Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Comment 5 Victor Grousset/tuxayo 2024-02-18 06:49:55 UTC
> If a patron anonymizes their checkins, the checkin slip cannot retrieve any info to print the checkin slip. 

Does that makes sense? Isn't that a bug instead?
It's just for arbitrary technical reasons that the slip can't get the info. This info is still there on checkin, but it's immediately deleted. And the slip is an optional checkin step that is on a separate request.

> We should not show the button in this scenario

But if nobody really complains and can do or fund work to complexify slip handling then it's ok to at least be consistent in the current simpler slip implementation that isn't compatible with patron privacy = never
Because that's an undisputable bug and the above is more between a bug and two features that have not their fullest scope possible and don't work together.

So ok I get it now ^^

---

Is it possible to avoid the two times there is a magic number in the patch? (patron.privacy < 2)

I'm not sure if it's simple from a template to access something like a constant that would be defined in Koha/Patron.pm or Koha/Schema/Result/Borrower.pm or somewhere relevant.
Any ideas? Magic numbers often require to go digging their meaning and the place is often not obvious.
borrowers.privacy DB comment doesn't list the values :(

If nothing simple then at least a TT comment just next the [% IF [...] %] tag. I can add it in a follow-up. Just hopping for better ideas that can reasonably be done in this ticket.
Comment 6 Victor Grousset/tuxayo 2024-03-03 00:10:02 UTC
Created attachment 162696 [details] [review]
Bug 35924: Hide the print checkins button on the patron screens for patron's who always anonymize

If a patron anonymizes their checkins, the checkin slip cannot retrieve any info to print the checkin slip. We should not show the button in this scenario

Test Plan:
1) Set a patron's privacy to "Never"
2) Note the "Print checkin slip" option in the Print button on the
   patrons toolbar displays
3) Apply this patch
4) Reload the page
5) Note the option is now missing
6) Set the patron's privacy to "Forever" or "Default"
7) Reload the page
8) Note the print checkins option is back!

Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 7 Victor Grousset/tuxayo 2024-03-03 00:10:05 UTC
Created attachment 162697 [details] [review]
Bug 35924: Hide the print checkins button on the checkin screen for patron's who always anonymize

Test Plan:
1) Set a patron's privacy to "Never"
2) Check out a few items to a patron
3) Check in one item
4) Note the "Print checkin slip" diplays
3) Apply this patch
4) Check in an  item
5) Note the option is now missing
6) Set the patron's privacy to "Forever" or "Default"
7) Check in an item
8) Note the print checkins option is back!

Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 8 Victor Grousset/tuxayo 2024-03-03 00:10:08 UTC
Created attachment 162698 [details] [review]
Bug 35924: (QA follow-up): Comment magic number (patron.privacy < 2)
Comment 9 Victor Grousset/tuxayo 2024-03-03 00:10:46 UTC
Works, makes sense, QA script happy, code looks good, passing QA :)
Comment 10 Katrin Fischer 2024-03-07 16:37:22 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 11 Fridolin Somers 2024-03-11 10:21:34 UTC
Pushed to 23.11.x for 23.11.04
Comment 12 Lucas Gass 2024-03-19 20:37:29 UTC
Doesn't apply cleanly to 23.05.x. No backport.