Bug 36595

Summary: Add patron email to the holds queue table
Product: Koha Reporter: Laura Escamilla <Laura.escamilla>
Component: Hold requestsAssignee: Laura Escamilla <Laura.escamilla>
Status: Pushed to main --- QA Contact: Martin Renvoize <martin.renvoize>
Severity: enhancement    
Priority: P5 - low CC: david, gmcharlt, lucas
Version: MainKeywords: Academy, no-sandbox
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00
Circulation function:
Attachments: Bug 36595: Added email address field to the holds queue table
Bug 36595: Updated to add mailto: -- Add patron email to the holds queue table
Bug 36595: Updated to add mailto: -- Add patron email to the holds queue table
Bug 36595: Updated to add mailto: -- Add patron email to the holds queue table
Bug 36595: Updated to make "Hold item:" translatable
Bug 36595: Updated to make "Hold item:" translatable
Bug 36595: Added email address field to the holds queue table
Bug 36595: (follow-up) Conditionals and consistency

Description Laura Escamilla 2024-04-12 12:09:51 UTC
Some libraries would like to see the patron's email address in the Patron holds queue column.
Comment 1 Laura Escamilla 2024-04-12 12:12:24 UTC
Created attachment 164841 [details] [review]
Bug 36595: Added email address field to the holds queue table

To test:
1. Make sure that the system preference ‘HidePatronName’ is set to ‘Show’
2. Select a patron that has a primary email address set in their contact information.
    1. Place a hold for that patron
3. Build the holds queue: perl /kohadevbox/koha/misc/cronjobs/holds/build_holds_queue.pl
4. Check the holds queue and notice that the patron column includes the patron’s email
5. Disable the ‘HidePatronName’ system preference
    1. Check the holds queue again and notice that no contact information can be seen for the patron
6. Sign off and have an amazing day :D
Comment 2 Owen Leonard 2024-04-12 14:06:58 UTC
Do we want to wrap the email in a mailto: link like we do on the holds awaiting pickup page? I'm not sure how useful it is in practice, but we usually do that with email addresses.
Comment 3 Laura Escamilla 2024-04-12 15:08:19 UTC
Created attachment 164851 [details] [review]
Bug 36595: Updated to add mailto: -- Add patron email to the holds queue table

To test:
1. Make sure that the system preference ‘HidePatronName’ is set to ‘Show’
2. Select a patron that has a primary email address set in their contact information.
    1. Place a hold for that patron
3. Build the holds queue: perl /kohadevbox/koha/misc/cronjobs/holds/build_holds_queue.pl
4. Check the holds queue and notice that the patron column includes the patron’s email
5. Click on the hyperlinked email. It will open a new email with the subject of "Hold item: (your biblio title)"
6. Disable the ‘HidePatronName’ system preference
    1. Check the holds queue again and notice that no contact information can be seen for the patron
7. Sign off and have an amazing day :D
Comment 4 Laura Escamilla 2024-04-12 15:09:31 UTC
(In reply to Owen Leonard from comment #2)
> Do we want to wrap the email in a mailto: link like we do on the holds
> awaiting pickup page? I'm not sure how useful it is in practice, but we
> usually do that with email addresses.

Thanks for the feedback, Owen! I've updated the patch so that it includes a mailto:
Comment 5 Owen Leonard 2024-04-12 15:24:43 UTC
Created attachment 164854 [details] [review]
Bug 36595: Updated to add mailto: -- Add patron email to the holds queue table

To test:
1. Make sure that the system preference ‘HidePatronName’ is set to
   ‘Show’
2. Select a patron that has a primary email address set in their
   contact information.
    1. Place a hold for that patron
3. Build the holds queue: perl /kohadevbox/koha/misc/cronjobs/holds/build_holds_queue.pl
4. Check the holds queue and notice that the patron column includes the
   patron’s email
5. Click on the hyperlinked email. It will open a new email with the
   subject of "Hold item: (your biblio title)"
6. Disable the ‘HidePatronName’ system preference
    1. Check the holds queue again and notice that no contact
       information can be seen for the patron
7. Sign off and have an amazing day :D

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 6 Martin Renvoize 2024-05-13 10:27:22 UTC
Created attachment 166626 [details] [review]
Bug 36595: Updated to add mailto: -- Add patron email to the holds queue table

To test:
1. Make sure that the system preference ‘HidePatronName’ is set to
   ‘Show’
2. Select a patron that has a primary email address set in their
   contact information.
    1. Place a hold for that patron
3. Build the holds queue: perl /kohadevbox/koha/misc/cronjobs/holds/build_holds_queue.pl
4. Check the holds queue and notice that the patron column includes the
   patron’s email
5. Click on the hyperlinked email. It will open a new email with the
   subject of "Hold item: (your biblio title)"
6. Disable the ‘HidePatronName’ system preference
    1. Check the holds queue again and notice that no contact
       information can be seen for the patron
7. Sign off and have an amazing day :D

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2024-05-13 10:27:43 UTC
Nice little enhancement, no QA issues.. Passing
Comment 8 Katrin Fischer 2024-05-13 11:43:50 UTC
The "Hold item" here is not translatable:

+                             <p class="patron-email"><a href="mailto:[% itemsloo.patron.email | uri %]?subject=[% "Hold item: " | uri %][% itemsloo.title | uri %]">[% itemsloo.patron.notice_email_address | html %]</a></p>

Maybe if you used a variable instead? Would need some testing.
Comment 9 Laura Escamilla 2024-07-24 19:30:25 UTC
Created attachment 169518 [details] [review]
Bug 36595: Updated to make "Hold item:" translatable

To test:
1. Make sure that the system preference ‘HidePatronName’ is set to
   ‘Show’
2. Select a patron that has a primary email address set in their
   contact information.
    1. Place a hold for that patron
3. Build the holds queue: perl /kohadevbox/koha/misc/cronjobs/holds/build_holds_queue.pl
4. Check the holds queue and notice that the patron column includes the
   patron’s email
5. Click on the hyperlinked email. It will open a new email with the
   subject of "Hold item: (your biblio title)"
6. Disable the ‘HidePatronName’ system preference
    1. Check the holds queue again and notice that no contact
       information can be seen for the patron
7. Sign off and have an amazing day :D
Comment 10 Matt Blenkinsop 2024-07-26 13:18:13 UTC
Created attachment 169701 [details] [review]
Bug 36595: Updated to make "Hold item:" translatable

To test:
1. Make sure that the system preference ‘HidePatronName’ is set to
   ‘Show’
2. Select a patron that has a primary email address set in their
   contact information.
    1. Place a hold for that patron
3. Build the holds queue: perl /kohadevbox/koha/misc/cronjobs/holds/build_holds_queue.pl
4. Check the holds queue and notice that the patron column includes the
   patron’s email
5. Click on the hyperlinked email. It will open a new email with the
   subject of "Hold item: (your biblio title)"
6. Disable the ‘HidePatronName’ system preference
    1. Check the holds queue again and notice that no contact
       information can be seen for the patron
7. Sign off and have an amazing day :D

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Comment 11 Martin Renvoize 2024-07-26 14:44:11 UTC
Created attachment 169738 [details] [review]
Bug 36595: Added email address field to the holds queue table

To test:
1. Make sure that the system preference ‘HidePatronName’ is set to
   ‘Show’
2. Select a patron that has a primary email address set in their
   contact information.
    1. Place a hold for that patron
3. Build the holds queue: perl /kohadevbox/koha/misc/cronjobs/holds/build_holds_queue.pl
4. Check the holds queue and notice that the patron column includes the
   patron’s email
5. Click on the hyperlinked email. It will open a new email with the
   subject of "Hold item: (your biblio title)"
6. Disable the ‘HidePatronName’ system preference
    1. Check the holds queue again and notice that no contact
       information can be seen for the patron
7. Sign off and have an amazing day :D

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 12 Martin Renvoize 2024-07-26 14:48:25 UTC
Great work, thanks Laura.  Passing QA
Comment 13 Katrin Fischer 2024-08-02 15:55:39 UTC
I see some small issues here. 

You don't check if the patron actually has an email set. The link will be broken if the email field is empty I believe.

This will also not be translatable: ?subject=Hold item: [% itemsloo.title | uri %]"> I think when I looked at this trick in the past, there was also an issue with UTF8/diacritics. As you include the title, it might be worth testing with some Chinese or umlauts as these could happen to occur there.

I don't thinks this should be a blocker here, but it might also be worth filing a separate bug for some template trick to show the email address according to EmailFieldPrimary and EmailFieldPrecedence. 

+1 for adding the class :)
Comment 14 Katrin Fischer 2024-08-02 15:57:00 UTC
Sorry, spotted something else: 

You use itemsloo.patron.email in the link, but itemsloo.patron.notice_email_address in the display text.
Comment 15 Lucas Gass 2024-09-11 16:06:59 UTC
This is set to FQA but in main:

https://git.koha-community.org/gitweb/?p=koha.git;a=commit;h=4b8bc2efd1fd18f74500195966a2f54b719a0b9b

Why?
Comment 16 Katrin Fischer 2024-09-11 19:09:02 UTC
(In reply to Lucas Gass from comment #15)
> This is set to FQA but in main:
> 
> https://git.koha-community.org/gitweb/?p=koha.git;a=commit;
> h=4b8bc2efd1fd18f74500195966a2f54b719a0b9b
> 
> Why?

Because RM needs a better workflow to not forget removing patches from her branch that have failed in testing... could we get a follow-up to avoid revert?
Comment 17 Martin Renvoize 2024-09-13 13:41:23 UTC
Created attachment 171460 [details] [review]
Bug 36595: (follow-up) Conditionals and consistency

Added a conditional to only display email if there's actualy a
notice_email_address present.

Updated the address used to match the address displayed.

Not sure how to resolve the translation issue.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 18 Katrin Fischer 2024-09-13 14:11:53 UTC
Pushed for 24.11!

Well done everyone, thank you!