Bug 37807

Summary: "Export today's checked in barcodes" not disabled when needed
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: PatronsAssignee: Jonathan Druart <jonathan.druart>
Status: Pushed to main --- QA Contact: Nick Clemens (kidclamp) <nick>
Severity: minor    
Priority: P5 - low CC: david, gmcharlt, kyle.m.hall, martin.renvoize, phil
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00
Circulation function:
Bug Depends on: 35402    
Bug Blocks:    
Attachments: Bug 37807: Disable "Export today's checked in barcodes" when needed
Bug 37807: Disable "Export today's checked in barcodes" when needed
Bug 37807: Disable "Export today's checked in barcodes" when needed

Description Jonathan Druart 2024-09-02 12:38:51 UTC
If patron has privacy==2 ("Never: Delete my history immediately"), the "Export today's checked in barcodes" button is supposed to be disabled, with a tooltip with an explanation, but it is not.
Comment 1 Jonathan Druart 2024-09-02 12:41:14 UTC
Created attachment 170938 [details] [review]
Bug 37807: Disable "Export today's checked in barcodes" when needed

If patron has privacy==2 ("Never: Delete my history immediately"), the "Export today's checked in barcodes" button is supposed to be disabled, with a tooltip with an explanation, but it is not.

Test plan:
Turn on OpacPrivacy and select "Never" in your privacy settings (OPAC)
Go to the circulation page for this patron (staff) and notice that the
export button (under "More") is disabled and has a tooltip when the
mouse hover it.
Comment 2 David Nind 2024-09-03 10:41:42 UTC
Created attachment 170975 [details] [review]
Bug 37807: Disable "Export today's checked in barcodes" when needed

If patron has privacy==2 ("Never: Delete my history immediately"), the "Export today's checked in barcodes" button is supposed to be disabled, with a tooltip with an explanation, but it is not.

Test plan:
Turn on OpacPrivacy and select "Never" in your privacy settings (OPAC)
Go to the circulation page for this patron (staff) and notice that the
export button (under "More") is disabled and has a tooltip when the
mouse hover it.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2024-09-03 10:44:44 UTC
Testing notes (using KTD):

Before the patch
----------------

1. Set OPACPrivacy to 'Allow'
2. Log in to the OPAC (I just used koha).
3. Go to Your account > Privacy
4. Choose 'Never' for the privacy rule.
5. You get an error:
     Exception 'Koha::Exceptions::SysPref::NotSet' thrown 'Required syspref is not set' with syspref => AnonymousPatron
 at /usr/share/perl5/Exception/Class/Base.pm line 88
in Exception::Class::Base::throw at /usr/share/perl5/Exception/Class/Base.pm line 88
6. Set AnonymousPatron to any patron - I set as 19.
   (opacreadinghistory was already set to allow)
7. Refresh the OPAC page.
8. Go to the staff interface > Patrons > search for koha
9. Note that for More > Export today's checkin in barcodes, that:
   - the option is not greyed out
   - when you select it, it opens a new tab on the oatron's circulation history page (/cgi-bin/koha/members/readingrec.pl?borrowernumber=51&op=export_barcodes)
   - the page displays the message "This patron has set the privacy rules to never keeping a circulation history."
   - if you keep going to More > Export today's checkin in barcodes, it opens a new tab every time
   - there was no tooltip for me on the menu item

After the patch
---------------

1. Applied the patch, restarted everything, and cleared the browser cache
2. Everything now works as expected:
   - More > Export today's checked in barcodes is greyed out
   - There is now a tooltip "Not allowed by patron's privacy settings"
   - If you go to the patron's circulation history page, it says 
     "This patron has set the privacy rules to never keeping a circulation history."
   - All the privacy options seem to work OK (I didn't add any transactions to actually test with data)
Comment 4 Nick Clemens (kidclamp) 2024-09-16 18:51:59 UTC
Created attachment 171596 [details] [review]
Bug 37807: Disable "Export today's checked in barcodes" when needed

If patron has privacy==2 ("Never: Delete my history immediately"), the "Export today's checked in barcodes" button is supposed to be disabled, with a tooltip with an explanation, but it is not.

Test plan:
Turn on OpacPrivacy and select "Never" in your privacy settings (OPAC)
Go to the circulation page for this patron (staff) and notice that the
export button (under "More") is disabled and has a tooltip when the
mouse hover it.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 5 Martin Renvoize (ashimema) 2024-10-02 09:56:22 UTC
Thanks for all the hard work!

Pushed to main for the next 24.11.00 release as RM Assistant