Bug 33260 - Show message queue on staff interface and make notices printable
Summary: Show message queue on staff interface and make notices printable
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Aleisha Amohia
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on: 30287 33478 35285 34030
Blocks: 36809
  Show dependency treegraph
 
Reported: 2023-03-17 02:36 UTC by Aleisha Amohia
Modified: 2024-05-08 09:56 UTC (History)
12 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Medium patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement makes it easy for the library to view sent notices and filter by various search parameters. You can also print sent notices, individually or in a batch. This enhancement uses a new system preference NoticesManagement and a new view_generated_notices user permission.
Version(s) released in:


Attachments
Bug 33260: Add view_generated_notices user permission (3.81 KB, patch)
2023-03-21 03:27 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Add NoticesManagement system preference (3.32 KB, patch)
2023-03-21 03:27 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Add a patron getter method to Koha::Notice::Message (2.00 KB, patch)
2023-03-21 03:27 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: [WIP] Add Notice management tool (12.19 KB, patch)
2023-03-21 03:27 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: [WIP] Add Notice management tool (22.53 KB, patch)
2023-03-30 04:05 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Add Notice management tool (27.87 KB, patch)
2023-03-31 02:56 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Add Notice management tool (31.40 KB, patch)
2023-04-10 23:53 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Move patron search into main body of page (3.00 KB, patch)
2023-04-12 23:11 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Move patron search into main body of page (3.06 KB, patch)
2023-04-13 12:36 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 33260: Add view_generated_notices user permission (3.87 KB, patch)
2023-04-13 12:37 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 33260: Add NoticesManagement system preference (3.38 KB, patch)
2023-04-13 12:37 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 33260: Add a patron getter method to Koha::Notice::Message (2.06 KB, patch)
2023-04-13 12:37 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 33260: Add Notice management tool (31.45 KB, patch)
2023-04-13 12:37 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 33260: Move patron search into main body of page (3.06 KB, patch)
2023-04-13 12:37 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 33260: Add Notice management tool (32.04 KB, patch)
2023-04-28 03:21 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Move patron search into main body of page (3.07 KB, patch)
2023-04-28 03:21 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Add Notice management tool (32.05 KB, patch)
2023-08-29 23:54 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Move patron search into main body of page (3.07 KB, patch)
2023-08-29 23:54 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Add a patron getter method to Koha::Notice::Message (1.99 KB, patch)
2023-10-19 04:12 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Add Notice management tool (32.11 KB, patch)
2023-10-19 04:12 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Move patron search into main body of page (3.07 KB, patch)
2023-10-19 04:12 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Make styles apply per notice (1.46 KB, patch)
2023-10-19 04:12 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Add a patron getter method to Koha::Notice::Message (1.99 KB, patch)
2023-11-12 23:15 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Add Notice management tool (31.65 KB, patch)
2023-11-12 23:15 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Move patron search into main body of page (3.07 KB, patch)
2023-11-12 23:15 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Make styles apply per notice (1.32 KB, patch)
2023-11-12 23:15 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Add view_generated_notices user permission (3.88 KB, patch)
2024-02-29 01:50 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Add NoticesManagement system preference (3.39 KB, patch)
2024-02-29 01:50 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Add a patron getter method to Koha::Notice::Message (1.91 KB, patch)
2024-02-29 01:50 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Add Notice management tool (31.58 KB, patch)
2024-02-29 01:50 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Move patron search into main body of page (3.07 KB, patch)
2024-02-29 01:50 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Add Notice management tool (31.65 KB, patch)
2024-02-29 22:22 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Move patron search into main body of page (3.07 KB, patch)
2024-02-29 22:22 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Add view_generated_notices user permission (3.92 KB, patch)
2024-03-01 16:41 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 33260: Add NoticesManagement system preference (3.43 KB, patch)
2024-03-01 16:41 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 33260: Add a patron getter method to Koha::Notice::Message (1.96 KB, patch)
2024-03-01 16:41 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 33260: Add Notice management tool (31.74 KB, patch)
2024-03-01 16:41 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 33260: Move patron search into main body of page (3.11 KB, patch)
2024-03-01 16:41 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 33260: Add view_generated_notices user permission (3.95 KB, patch)
2024-04-12 02:47 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Add NoticesManagement system preference (3.47 KB, patch)
2024-04-12 02:47 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Add a patron getter method to Koha::Notice::Message (2.12 KB, patch)
2024-04-12 02:47 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Add Notice management tool (31.80 KB, patch)
2024-04-12 02:47 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Move patron search into main body of page (3.11 KB, patch)
2024-04-12 02:47 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Add Notice management tool (31.75 KB, patch)
2024-04-21 22:39 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Move patron search into main body of page (3.11 KB, patch)
2024-04-21 22:39 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: (follow-up) Fix search forms on notices mgmt page (5.34 KB, patch)
2024-04-29 01:56 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: (follow-up) Fix search forms on notices mgmt page (6.00 KB, patch)
2024-05-01 03:53 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Add view_generated_notices user permission (3.99 KB, patch)
2024-05-01 08:26 UTC, David Nind
Details | Diff | Splinter Review
Bug 33260: Add NoticesManagement system preference (3.51 KB, patch)
2024-05-01 08:26 UTC, David Nind
Details | Diff | Splinter Review
Bug 33260: Add a patron getter method to Koha::Notice::Message (2.16 KB, patch)
2024-05-01 08:26 UTC, David Nind
Details | Diff | Splinter Review
Bug 33260: Add Notice management tool (31.78 KB, patch)
2024-05-01 08:26 UTC, David Nind
Details | Diff | Splinter Review
Bug 33260: Move patron search into main body of page (3.16 KB, patch)
2024-05-01 08:26 UTC, David Nind
Details | Diff | Splinter Review
Bug 33260: (follow-up) Fix search forms on notices mgmt page (6.04 KB, patch)
2024-05-01 08:26 UTC, David Nind
Details | Diff | Splinter Review
Bug 33260: (QA follow-up) Correct relation accessor and add unit test (2.32 KB, patch)
2024-05-01 16:43 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33260: Use search_limited to protect message privacy, and unit test (4.50 KB, patch)
2024-05-06 03:23 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33260: Add view_generated_notices user permission (4.06 KB, patch)
2024-05-07 18:48 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33260: Add NoticesManagement system preference (3.58 KB, patch)
2024-05-07 18:48 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33260: Add a patron getter method to Koha::Notice::Message (2.25 KB, patch)
2024-05-07 18:48 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33260: Add Notice management tool (31.86 KB, patch)
2024-05-07 18:48 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33260: Move patron search into main body of page (3.22 KB, patch)
2024-05-07 18:48 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33260: (follow-up) Fix search forms on notices mgmt page (6.11 KB, patch)
2024-05-07 18:48 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33260: (QA follow-up) Correct relation accessor and add unit test (2.23 KB, patch)
2024-05-07 18:48 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33260: Use search_limited to protect message privacy, and unit test (4.56 KB, patch)
2024-05-07 18:48 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33260: Tidy unit test (2.26 KB, patch)
2024-05-07 18:48 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33260: (QA follow-up) Add template relation (1.36 KB, patch)
2024-05-07 18:48 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33260: (QA follow-up) Safely continue for non-templated notices (1.55 KB, patch)
2024-05-07 18:48 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33260: Add view_generated_notices user permission (4.06 KB, patch)
2024-05-08 09:45 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33260: Add NoticesManagement system preference (3.58 KB, patch)
2024-05-08 09:45 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33260: Add a patron getter method to Koha::Notice::Message (2.25 KB, patch)
2024-05-08 09:45 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33260: Add Notice management tool (31.86 KB, patch)
2024-05-08 09:45 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33260: Move patron search into main body of page (3.22 KB, patch)
2024-05-08 09:45 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33260: (follow-up) Fix search forms on notices mgmt page (6.11 KB, patch)
2024-05-08 09:45 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33260: (QA follow-up) Correct relation accessor and add unit test (2.23 KB, patch)
2024-05-08 09:45 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33260: Use search_limited to protect message privacy, and unit test (4.56 KB, patch)
2024-05-08 09:45 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33260: Tidy unit test (2.42 KB, patch)
2024-05-08 09:45 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33260: (QA follow-up) Add template relation (2.90 KB, patch)
2024-05-08 09:45 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33260: (QA follow-up) Safely continue for non-templated notices (1.69 KB, patch)
2024-05-08 09:45 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33260: (QA follow-up) Add missing page-section (6.74 KB, patch)
2024-05-08 09:45 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Aleisha Amohia 2023-03-17 02:36:15 UTC
Some Koha libraries need to get messages out to borrowers who do not have email addresses, so they need to be able to view generated notices, and optionally print them so they can be delivered offline.
Comment 1 Aleisha Amohia 2023-03-21 03:27:07 UTC Comment hidden (obsolete)
Comment 2 Aleisha Amohia 2023-03-21 03:27:10 UTC Comment hidden (obsolete)
Comment 3 Aleisha Amohia 2023-03-21 03:27:12 UTC Comment hidden (obsolete)
Comment 4 Aleisha Amohia 2023-03-21 03:27:15 UTC Comment hidden (obsolete)
Comment 5 Aleisha Amohia 2023-03-30 04:05:08 UTC Comment hidden (obsolete)
Comment 6 Aleisha Amohia 2023-03-31 02:56:06 UTC Comment hidden (obsolete)
Comment 7 Aleisha Amohia 2023-04-10 23:53:21 UTC Comment hidden (obsolete)
Comment 8 Laura Escamilla 2023-04-11 12:20:40 UTC
Hi!

Overall the new syspref and notices management page is working as expected. However, there are a few things I noticed that seem to be a little broken. 

1. In the Notices Management page if you search for a patron and their name populates then clicking on the populated name will appropriately take you to their notice history. However, if you use the "Browse by last name" option or if you just search for a letter such as "K", then the table that is supposed to show the patron names is not displayed properly. It is askew to the left and mixes into the filter options. 

2. The print notices work, but there is a lot of whitespace within the messages. This might be a separate bug, but having the messages more condensed and still separated by the horizontal line would be ideal.
Comment 9 Aleisha Amohia 2023-04-12 22:53:45 UTC
Thank you for testing Laura!

(In reply to Laura Escamilla from comment #8)
> Hi!
> 
> Overall the new syspref and notices management page is working as expected.
> However, there are a few things I noticed that seem to be a little broken. 
> 
> 1. In the Notices Management page if you search for a patron and their name
> populates then clicking on the populated name will appropriately take you to
> their notice history. However, if you use the "Browse by last name" option
> or if you just search for a letter such as "K", then the table that is
> supposed to show the patron names is not displayed properly. It is askew to
> the left and mixes into the filter options. 
> 

I'll work on fixing this.

> 2. The print notices work, but there is a lot of whitespace within the
> messages. This might be a separate bug, but having the messages more
> condensed and still separated by the horizontal line would be ideal.

This is just how the default HOLD print notice comes in Koha, it has heaps of line breaks in it. You can go to Notices & slips and delete the newlines from the template notice to remove that whitespace.
Comment 10 Aleisha Amohia 2023-04-12 23:11:53 UTC Comment hidden (obsolete)
Comment 11 ByWater Sandboxes 2023-04-13 12:36:09 UTC Comment hidden (obsolete)
Comment 12 ByWater Sandboxes 2023-04-13 12:37:18 UTC
Created attachment 149594 [details] [review]
Bug 33260: Add view_generated_notices user permission

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Comment 13 ByWater Sandboxes 2023-04-13 12:37:20 UTC
Created attachment 149595 [details] [review]
Bug 33260: Add NoticesManagement system preference

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Comment 14 ByWater Sandboxes 2023-04-13 12:37:21 UTC Comment hidden (obsolete)
Comment 15 ByWater Sandboxes 2023-04-13 12:37:23 UTC Comment hidden (obsolete)
Comment 16 ByWater Sandboxes 2023-04-13 12:37:25 UTC Comment hidden (obsolete)
Comment 17 Laura Escamilla 2023-04-13 12:38:10 UTC
Love the way the new setup looks for the notice management page!
Comment 18 Aleisha Amohia 2023-04-28 03:21:32 UTC Comment hidden (obsolete)
Comment 19 Aleisha Amohia 2023-04-28 03:21:35 UTC Comment hidden (obsolete)
Comment 20 Aleisha Amohia 2023-04-28 03:22:50 UTC
I've rebased this to build on top of Bug 33478 and use the format settings. Only the patch "Bug 33260: Add Notice management tool" needs to be re-tested and a new sign-off line added.
Comment 21 Emmi Takkinen 2023-08-17 07:54:12 UTC
I'm getting this error when trying to apply the patches:

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 33260: Add view_generated_notices user permission
Applying: Bug 33260: Add NoticesManagement system preference
Applying: Bug 33260: Add a patron getter method to Koha::Notice::Message
Applying: Bug 33260: Add Notice management tool
Using index info to reconstruct a base tree...
M	koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt
M	koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt
A	koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js
Falling back to patching base and 3-way merge...
CONFLICT (modify/delete): koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js deleted in HEAD and modified in Bug 33260: Add Notice management tool. Version Bug 33260: Add Notice management tool of koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js left in tree.
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt
error: Failed to merge in the changes.
Patch failed at 0001 Bug 33260: Add Notice management tool
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem run "git bz apply --continue".
If you would prefer to skip this patch, instead run "git bz apply --skip".
To restore the original branch and stop patching run "git bz apply --abort".
Patch left in /tmp/Bug-33260-Add-Notice-management-tool-wp4ViP.patch
Comment 22 Aleisha Amohia 2023-08-29 23:54:43 UTC Comment hidden (obsolete)
Comment 23 Aleisha Amohia 2023-08-29 23:54:46 UTC Comment hidden (obsolete)
Comment 24 David Nind 2023-09-25 00:17:00 UTC
Patch no longer applies 8-(...

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 33260: Add view_generated_notices user permission
Applying: Bug 33260: Add NoticesManagement system preference
Applying: Bug 33260: Add a patron getter method to Koha::Notice::Message
Using index info to reconstruct a base tree...
M	t/db_dependent/Letters.t
Falling back to patching base and 3-way merge...
Auto-merging t/db_dependent/Letters.t
CONFLICT (content): Merge conflict in t/db_dependent/Letters.t
error: Failed to merge in the changes.
Patch failed at 0001 Bug 33260: Add a patron getter method to Koha::Notice::Message
Comment 25 Aleisha Amohia 2023-10-19 04:12:03 UTC
Created attachment 157383 [details] [review]
Bug 33260: Add a patron getter method to Koha::Notice::Message

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Comment 26 Aleisha Amohia 2023-10-19 04:12:06 UTC
Created attachment 157384 [details] [review]
Bug 33260: Add Notice management tool

This enhancement makes it easy for the library to view sent notices and filter by various search parameters.

You can also print sent notices, individually or in a batch.

This enhancement uses a new system preference NoticesManagement and a new view_generated_notices user permission.

This enhancement has been built on top of Bug 33478 so print format settings are taken into account when printing notices.

To test:
1. Apply patches, install database updates, restart services
2. Make sure your logged in user has the view_generated_notices permission checked
3. Enable the NoticesManagement system preference
4. Generate a few notices. There are a few ways to do this including:
- place holds, check in items and confirm the holds
- place recalls, check in items and confirm the recalls
5. Go to Tools -> Notices management
6. There are two search functions on the left navigation. Confirm the patron search box works by searching for one of the patrons you generated a notice for, you should be redirected to their Notice history.
7. Go back to Notices management. Use the set of search filters to search for notices. Leaving the search filters empty will return all notices generated. Confirm the filters work as expected by using different combinations of filters.
8. Conduct a search so your notices show in a table. Confirm the information fetched about the notices is correct.
9. Click on a notice title. Confirm the contents of the notice show in a pop-up box.
10. Click one of the Print buttons next to a notice. Confirm the notice is opened to be printed.
11. Redo your notices search. Confirm the status of the notice you just printed has now been updated to 'sent'.
12. Use the 'Select all' and 'Clear all' buttons to select or clear the checkboxes.
13. Select a few checkboxes and click the button at the bottom of the table to 'Print selected notices'. Confirm the notices have been collated into one document, separated by horizontal lines, and prints successfully. The statuses for the notices should all be updated to 'sent'.
14. Confirm the Notices management page is not visible without the view_generated_notices permission
15. Confirm the Notices management page is not visible without the NoticesManagement system preference being enabled.
16. Go to a patron's Notices history. If the view_generated_notices user permission is checked for your logged in patron, you should see a Print button for each notice. Confirm this works. Confirm this button doesn't show if your logged in patron does not have the view_generated_notices user permission. It does not require the NoticesManagement system preference.

17. Go to Tools -> Notices & slips
18. Edit the format settings of a few different notices i.e. HOLD and WELCOME
19. Generate these notices by filling a hold for a patron and sending a welcome email
20. Search for all notices under Tools -> Notices management
21. Select all notices and print selected notices
22. Confirm the notices different format settings are taken into account in the printed PDF

Sponsored-by: Colorado Library Consortium
Comment 27 Aleisha Amohia 2023-10-19 04:12:09 UTC
Created attachment 157385 [details] [review]
Bug 33260: Move patron search into main body of page

This patch moves the patron search in the Notices management page to the main body of the page so that the patron search result table displays more nicely.

This is a better place for it anyway, as using this search takes the user to a different page. In the sidebar, where it was previously, it implied it would have the same results display as the search filters.

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Comment 28 Aleisha Amohia 2023-10-19 04:12:12 UTC
Created attachment 157386 [details] [review]
Bug 33260: Make styles apply per notice
Comment 29 Aleisha Amohia 2023-10-19 04:16:33 UTC
The latest patch uses regex to replace all the CSS selectors when printing notices from the Notices Management page. It's not perfect, but it does the best job (that I could find) at applying notice-specific styles when printing a batch of notices.
Comment 30 Kelly McElligott 2023-10-20 15:30:00 UTC
Upon testing this, I am getting, for every notice, I try to print, No Slip Template Found.  Each notice that I have tested has a template created which include checkin, hold, checkout, welcome. 

Not sure why I am getting this message.
Comment 31 Kelly McElligott 2023-10-20 15:39:01 UTC
Upon testing this, I am getting, for every notice, I try to print, No Slip Template Found.  Each notice that I have tested has a template created which include checkin, hold, checkout, welcome. 

Not sure why I am getting this message.
Comment 32 Aleisha Amohia 2023-10-29 20:57:12 UTC
Hi Kelly,

I think you may have been seeing that message if you forgot to apply the patches from Bug 33478 first.

Bug 33478 now needs to be rebased so will update when this patchset can be tested again.
Comment 33 Aleisha Amohia 2023-11-12 23:15:21 UTC
Created attachment 158852 [details] [review]
Bug 33260: Add a patron getter method to Koha::Notice::Message

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Comment 34 Aleisha Amohia 2023-11-12 23:15:24 UTC
Created attachment 158853 [details] [review]
Bug 33260: Add Notice management tool

This enhancement makes it easy for the library to view sent notices and filter by various search parameters.

You can also print sent notices, individually or in a batch.

This enhancement uses a new system preference NoticesManagement and a new view_generated_notices user permission.

This enhancement has been built on top of Bug 33478 so print format settings are taken into account when printing notices.

To test:
1. Apply patches, install database updates, restart services
2. Make sure your logged in user has the view_generated_notices permission checked
3. Enable the NoticesManagement system preference
4. Generate a few notices. There are a few ways to do this including:
- place holds, check in items and confirm the holds
- place recalls, check in items and confirm the recalls
5. Go to Tools -> Notices management
6. There are two search functions on the left navigation. Confirm the patron search box works by searching for one of the patrons you generated a notice for, you should be redirected to their Notice history.
7. Go back to Notices management. Use the set of search filters to search for notices. Leaving the search filters empty will return all notices generated. Confirm the filters work as expected by using different combinations of filters.
8. Conduct a search so your notices show in a table. Confirm the information fetched about the notices is correct.
9. Click on a notice title. Confirm the contents of the notice show in a pop-up box.
10. Click one of the Print buttons next to a notice. Confirm the notice is opened to be printed.
11. Redo your notices search. Confirm the status of the notice you just printed has now been updated to 'sent'.
12. Use the 'Select all' and 'Clear all' buttons to select or clear the checkboxes.
13. Select a few checkboxes and click the button at the bottom of the table to 'Print selected notices'. Confirm the notices have been collated into one document, separated by horizontal lines, and prints successfully. The statuses for the notices should all be updated to 'sent'.
14. Confirm the Notices management page is not visible without the view_generated_notices permission
15. Confirm the Notices management page is not visible without the NoticesManagement system preference being enabled.
16. Go to a patron's Notices history. If the view_generated_notices user permission is checked for your logged in patron, you should see a Print button for each notice. Confirm this works. Confirm this button doesn't show if your logged in patron does not have the view_generated_notices user permission. It does not require the NoticesManagement system preference.

17. Go to Tools -> Notices & slips
18. Edit the format settings of a few different notices i.e. HOLD and WELCOME
19. Generate these notices by filling a hold for a patron and sending a welcome email
20. Search for all notices under Tools -> Notices management
21. Select all notices and print selected notices
22. Confirm the notices different format settings are taken into account in the printed PDF

Sponsored-by: Colorado Library Consortium
Comment 35 Aleisha Amohia 2023-11-12 23:15:27 UTC
Created attachment 158854 [details] [review]
Bug 33260: Move patron search into main body of page

This patch moves the patron search in the Notices management page to the main body of the page so that the patron search result table displays more nicely.

This is a better place for it anyway, as using this search takes the user to a different page. In the sidebar, where it was previously, it implied it would have the same results display as the search filters.

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Comment 36 Aleisha Amohia 2023-11-12 23:15:30 UTC
Created attachment 158855 [details] [review]
Bug 33260: Make styles apply per notice
Comment 37 Aleisha Amohia 2023-11-12 23:16:15 UTC
I have reworked this feature to apply on top of the new Preservation Module, which changed the markup for how most notices are sent.

Please test that any formatting applies to all notices again, thank you!
Comment 38 Martin Renvoize 2023-11-13 11:28:39 UTC
Just starting to look here; just a couple of comments from initial testing so far

* Could you take bug 30287 into account for the notice previews, please?
* I used bug 35279 to test using the WELCOME message (it adds print fallback)
  Once I'd created a print type welcome notice for the ktd henry user, it displayed OK in print preview from the new notice management page, but the same print button on the patron notices tab yields 'No slip template found'.

I must admit, I find the print process a little confusing at the moment, but need to test more before really commenting further.  I do however like the idea of the feature overall.. will be watching it closeing during the next cycle.
Comment 39 Martin Renvoize 2023-11-13 17:03:12 UTC
Comment on attachment 158855 [details] [review]
Bug 33260: Make styles apply per notice

Review of attachment 158855 [details] [review]:
-----------------------------------------------------------------

I think this patch belongs in bug 33478 personally.. it's a fix for that bug not this one after rebases.

::: koha-tmpl/intranet-tmpl/prog/en/modules/circ/printslip.tt
@@ +39,5 @@
>      [% SET slips = [{content => slip, is_html => !plain, style => style }] %]
>  [% END %]
>  [% FOR slip IN slips %]
> +[% IF slip.style %]<style>[% slip.style.replace('[^{]+{', '#slip_' _ slip.id _ ' {') | $raw %]</style>[% END %]
> +<span id="slip_[% slip.id | html %]">

Also.. this should really be a block level element in my opinion rather than an inline level element.. Probably a 'div'.
Comment 40 Aleisha Amohia 2024-02-29 01:50:04 UTC
Created attachment 162570 [details] [review]
Bug 33260: Add view_generated_notices user permission

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Comment 41 Aleisha Amohia 2024-02-29 01:50:08 UTC
Created attachment 162571 [details] [review]
Bug 33260: Add NoticesManagement system preference

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Comment 42 Aleisha Amohia 2024-02-29 01:50:11 UTC
Created attachment 162572 [details] [review]
Bug 33260: Add a patron getter method to Koha::Notice::Message

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Comment 43 Aleisha Amohia 2024-02-29 01:50:15 UTC
Created attachment 162573 [details] [review]
Bug 33260: Add Notice management tool

This enhancement makes it easy for the library to view sent notices and filter by various search parameters.

You can also print sent notices, individually or in a batch.

This enhancement uses a new system preference NoticesManagement and a new view_generated_notices user permission.

This enhancement has been built on top of Bug 33478 so print format settings are taken into account when printing notices.

To test:
1. Apply patches, install database updates, restart services
2. Make sure your logged in user has the view_generated_notices permission checked
3. Enable the NoticesManagement system preference
4. Generate a few notices. There are a few ways to do this including:
- place holds, check in items and confirm the holds
- place recalls, check in items and confirm the recalls
5. Go to Tools -> Notices management
6. There are two search functions on the left navigation. Confirm the patron search box works by searching for one of the patrons you generated a notice for, you should be redirected to their Notice history.
7. Go back to Notices management. Use the set of search filters to search for notices. Leaving the search filters empty will return all notices generated. Confirm the filters work as expected by using different combinations of filters.
8. Conduct a search so your notices show in a table. Confirm the information fetched about the notices is correct.
9. Click on a notice title. Confirm the contents of the notice show in a pop-up box.
10. Click one of the Print buttons next to a notice. Confirm the notice is opened to be printed.
11. Redo your notices search. Confirm the status of the notice you just printed has now been updated to 'sent'.
12. Use the 'Select all' and 'Clear all' buttons to select or clear the checkboxes.
13. Select a few checkboxes and click the button at the bottom of the table to 'Print selected notices'. Confirm the notices have been collated into one document, separated by horizontal lines, and prints successfully. The statuses for the notices should all be updated to 'sent'.
14. Confirm the Notices management page is not visible without the view_generated_notices permission
15. Confirm the Notices management page is not visible without the NoticesManagement system preference being enabled.
16. Go to a patron's Notices history. If the view_generated_notices user permission is checked for your logged in patron, you should see a Print button for each notice. Confirm this works. Confirm this button doesn't show if your logged in patron does not have the view_generated_notices user permission. It does not require the NoticesManagement system preference.

17. Go to Tools -> Notices & slips
18. Edit the format settings of a few different notices i.e. HOLD and WELCOME
19. Generate these notices by filling a hold for a patron and sending a welcome email
20. Search for all notices under Tools -> Notices management
21. Select all notices and print selected notices
22. Confirm the notices different format settings are taken into account in the printed PDF

Sponsored-by: Colorado Library Consortium
Comment 44 Aleisha Amohia 2024-02-29 01:50:18 UTC
Created attachment 162574 [details] [review]
Bug 33260: Move patron search into main body of page

This patch moves the patron search in the Notices management page to the main body of the page so that the patron search result table displays more nicely.

This is a better place for it anyway, as using this search takes the user to a different page. In the sidebar, where it was previously, it implied it would have the same results display as the search filters.

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Comment 45 Kelly McElligott 2024-02-29 13:35:47 UTC
When searching for a notice in the search filters within the Notice Management Tool, several notices appear multiple times.  For example, there are 3 HOLD notices.  In the sandbox I am testing in, there is only one HOLD notice within the Notices and Slips, so it shouldn't appear three times.  In addition, there are two check-in digest and two checkout digest options in this drop-down menu.  There are many that only appear once, but some appear more than once. I think that the notice should only appear once when the library only has one notice.  This list becomes very long with duplicates and it is very confusing. 

Just testing, I did create a library-specific HOLD notice, which appeared in the dropdown menu as with all the others with no indication of it being a library-specific notice.
Comment 46 Aleisha Amohia 2024-02-29 22:22:42 UTC
Created attachment 162624 [details] [review]
Bug 33260: Add Notice management tool

This enhancement makes it easy for the library to view sent notices and filter by various search parameters.

You can also print sent notices, individually or in a batch.

This enhancement uses a new system preference NoticesManagement and a new view_generated_notices user permission.

This enhancement has been built on top of Bug 33478 so print format settings are taken into account when printing notices.

To test:
1. Apply patches, install database updates, restart services
2. Make sure your logged in user has the view_generated_notices permission checked
3. Enable the NoticesManagement system preference
4. Generate a few notices. There are a few ways to do this including:
- place holds, check in items and confirm the holds
- place recalls, check in items and confirm the recalls
5. Go to Tools -> Notices management
6. There are two search functions on the left navigation. Confirm the patron search box works by searching for one of the patrons you generated a notice for, you should be redirected to their Notice history.
7. Go back to Notices management. Use the set of search filters to search for notices. Leaving the search filters empty will return all notices generated. Confirm the filters work as expected by using different combinations of filters.
8. Conduct a search so your notices show in a table. Confirm the information fetched about the notices is correct.
9. Click on a notice title. Confirm the contents of the notice show in a pop-up box.
10. Click one of the Print buttons next to a notice. Confirm the notice is opened to be printed.
11. Redo your notices search. Confirm the status of the notice you just printed has now been updated to 'sent'.
12. Use the 'Select all' and 'Clear all' buttons to select or clear the checkboxes.
13. Select a few checkboxes and click the button at the bottom of the table to 'Print selected notices'. Confirm the notices have been collated into one document, separated by horizontal lines, and prints successfully. The statuses for the notices should all be updated to 'sent'.
14. Confirm the Notices management page is not visible without the view_generated_notices permission
15. Confirm the Notices management page is not visible without the NoticesManagement system preference being enabled.
16. Go to a patron's Notices history. If the view_generated_notices user permission is checked for your logged in patron, you should see a Print button for each notice. Confirm this works. Confirm this button doesn't show if your logged in patron does not have the view_generated_notices user permission. It does not require the NoticesManagement system preference.

17. Go to Tools -> Notices & slips
18. Edit the format settings of a few different notices i.e. HOLD and WELCOME
19. Generate these notices by filling a hold for a patron and sending a welcome email
20. Search for all notices under Tools -> Notices management
21. Select all notices and print selected notices
22. Confirm the notices different format settings are taken into account in the printed PDF

Sponsored-by: Colorado Library Consortium
Comment 47 Aleisha Amohia 2024-02-29 22:22:46 UTC
Created attachment 162625 [details] [review]
Bug 33260: Move patron search into main body of page

This patch moves the patron search in the Notices management page to the main body of the page so that the patron search result table displays more nicely.

This is a better place for it anyway, as using this search takes the user to a different page. In the sidebar, where it was previously, it implied it would have the same results display as the search filters.

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Comment 48 Aleisha Amohia 2024-02-29 22:23:48 UTC
(In reply to Kelly McElligott from comment #45)
> When searching for a notice in the search filters within the Notice
> Management Tool, several notices appear multiple times.  For example, there
> are 3 HOLD notices.  In the sandbox I am testing in, there is only one HOLD
> notice within the Notices and Slips, so it shouldn't appear three times.  In
> addition, there are two check-in digest and two checkout digest options in
> this drop-down menu.  There are many that only appear once, but some appear
> more than once. I think that the notice should only appear once when the
> library only has one notice.  This list becomes very long with duplicates
> and it is very confusing. 
> 
> Just testing, I did create a library-specific HOLD notice, which appeared in
> the dropdown menu as with all the others with no indication of it being a
> library-specific notice.

Good catch, this was because of the many message transport types that might be available for a notice. I've fixed that up in latest patches - please test again when you can.
Comment 49 ByWater Sandboxes 2024-03-01 16:41:23 UTC
Created attachment 162677 [details] [review]
Bug 33260: Add view_generated_notices user permission

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: kelly <kelly@bywatersolutions.com>
Comment 50 ByWater Sandboxes 2024-03-01 16:41:26 UTC
Created attachment 162678 [details] [review]
Bug 33260: Add NoticesManagement system preference

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: kelly <kelly@bywatersolutions.com>
Comment 51 ByWater Sandboxes 2024-03-01 16:41:28 UTC
Created attachment 162679 [details] [review]
Bug 33260: Add a patron getter method to Koha::Notice::Message

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: kelly <kelly@bywatersolutions.com>
Comment 52 ByWater Sandboxes 2024-03-01 16:41:30 UTC
Created attachment 162680 [details] [review]
Bug 33260: Add Notice management tool

This enhancement makes it easy for the library to view sent notices and filter by various search parameters.

You can also print sent notices, individually or in a batch.

This enhancement uses a new system preference NoticesManagement and a new view_generated_notices user permission.

This enhancement has been built on top of Bug 33478 so print format settings are taken into account when printing notices.

To test:
1. Apply patches, install database updates, restart services
2. Make sure your logged in user has the view_generated_notices permission checked
3. Enable the NoticesManagement system preference
4. Generate a few notices. There are a few ways to do this including:
- place holds, check in items and confirm the holds
- place recalls, check in items and confirm the recalls
5. Go to Tools -> Notices management
6. There are two search functions on the left navigation. Confirm the patron search box works by searching for one of the patrons you generated a notice for, you should be redirected to their Notice history.
7. Go back to Notices management. Use the set of search filters to search for notices. Leaving the search filters empty will return all notices generated. Confirm the filters work as expected by using different combinations of filters.
8. Conduct a search so your notices show in a table. Confirm the information fetched about the notices is correct.
9. Click on a notice title. Confirm the contents of the notice show in a pop-up box.
10. Click one of the Print buttons next to a notice. Confirm the notice is opened to be printed.
11. Redo your notices search. Confirm the status of the notice you just printed has now been updated to 'sent'.
12. Use the 'Select all' and 'Clear all' buttons to select or clear the checkboxes.
13. Select a few checkboxes and click the button at the bottom of the table to 'Print selected notices'. Confirm the notices have been collated into one document, separated by horizontal lines, and prints successfully. The statuses for the notices should all be updated to 'sent'.
14. Confirm the Notices management page is not visible without the view_generated_notices permission
15. Confirm the Notices management page is not visible without the NoticesManagement system preference being enabled.
16. Go to a patron's Notices history. If the view_generated_notices user permission is checked for your logged in patron, you should see a Print button for each notice. Confirm this works. Confirm this button doesn't show if your logged in patron does not have the view_generated_notices user permission. It does not require the NoticesManagement system preference.

17. Go to Tools -> Notices & slips
18. Edit the format settings of a few different notices i.e. HOLD and WELCOME
19. Generate these notices by filling a hold for a patron and sending a welcome email
20. Search for all notices under Tools -> Notices management
21. Select all notices and print selected notices
22. Confirm the notices different format settings are taken into account in the printed PDF

Sponsored-by: Colorado Library Consortium
Signed-off-by: kelly <kelly@bywatersolutions.com>
Comment 53 ByWater Sandboxes 2024-03-01 16:41:33 UTC
Created attachment 162681 [details] [review]
Bug 33260: Move patron search into main body of page

This patch moves the patron search in the Notices management page to the main body of the page so that the patron search result table displays more nicely.

This is a better place for it anyway, as using this search takes the user to a different page. In the sidebar, where it was previously, it implied it would have the same results display as the search filters.

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: kelly <kelly@bywatersolutions.com>
Comment 54 Lucas Gass 2024-04-11 15:28:30 UTC
Tests are failing here and the DBUpdates need to have their file permissions corrected. 

Otherwise looks good!
Comment 55 Aleisha Amohia 2024-04-12 02:47:13 UTC
Created attachment 164783 [details] [review]
Bug 33260: Add view_generated_notices user permission

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: kelly <kelly@bywatersolutions.com>
Comment 56 Aleisha Amohia 2024-04-12 02:47:16 UTC
Created attachment 164784 [details] [review]
Bug 33260: Add NoticesManagement system preference

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: kelly <kelly@bywatersolutions.com>
Comment 57 Aleisha Amohia 2024-04-12 02:47:19 UTC
Created attachment 164785 [details] [review]
Bug 33260: Add a patron getter method to Koha::Notice::Message

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: kelly <kelly@bywatersolutions.com>
Comment 58 Aleisha Amohia 2024-04-12 02:47:23 UTC
Created attachment 164786 [details] [review]
Bug 33260: Add Notice management tool

This enhancement makes it easy for the library to view sent notices and filter by various search parameters.

You can also print sent notices, individually or in a batch.

This enhancement uses a new system preference NoticesManagement and a new view_generated_notices user permission.

This enhancement has been built on top of Bug 33478 so print format settings are taken into account when printing notices.

To test:
1. Apply patches, install database updates, restart services
2. Make sure your logged in user has the view_generated_notices permission checked
3. Enable the NoticesManagement system preference
4. Generate a few notices. There are a few ways to do this including:
- place holds, check in items and confirm the holds
- place recalls, check in items and confirm the recalls
5. Go to Tools -> Notices management
6. There are two search functions on the left navigation. Confirm the patron search box works by searching for one of the patrons you generated a notice for, you should be redirected to their Notice history.
7. Go back to Notices management. Use the set of search filters to search for notices. Leaving the search filters empty will return all notices generated. Confirm the filters work as expected by using different combinations of filters.
8. Conduct a search so your notices show in a table. Confirm the information fetched about the notices is correct.
9. Click on a notice title. Confirm the contents of the notice show in a pop-up box.
10. Click one of the Print buttons next to a notice. Confirm the notice is opened to be printed.
11. Redo your notices search. Confirm the status of the notice you just printed has now been updated to 'sent'.
12. Use the 'Select all' and 'Clear all' buttons to select or clear the checkboxes.
13. Select a few checkboxes and click the button at the bottom of the table to 'Print selected notices'. Confirm the notices have been collated into one document, separated by horizontal lines, and prints successfully. The statuses for the notices should all be updated to 'sent'.
14. Confirm the Notices management page is not visible without the view_generated_notices permission
15. Confirm the Notices management page is not visible without the NoticesManagement system preference being enabled.
16. Go to a patron's Notices history. If the view_generated_notices user permission is checked for your logged in patron, you should see a Print button for each notice. Confirm this works. Confirm this button doesn't show if your logged in patron does not have the view_generated_notices user permission. It does not require the NoticesManagement system preference.

17. Go to Tools -> Notices & slips
18. Edit the format settings of a few different notices i.e. HOLD and WELCOME
19. Generate these notices by filling a hold for a patron and sending a welcome email
20. Search for all notices under Tools -> Notices management
21. Select all notices and print selected notices
22. Confirm the notices different format settings are taken into account in the printed PDF

Sponsored-by: Colorado Library Consortium
Signed-off-by: kelly <kelly@bywatersolutions.com>
Comment 59 Aleisha Amohia 2024-04-12 02:47:26 UTC
Created attachment 164787 [details] [review]
Bug 33260: Move patron search into main body of page

This patch moves the patron search in the Notices management page to the main body of the page so that the patron search result table displays more nicely.

This is a better place for it anyway, as using this search takes the user to a different page. In the sidebar, where it was previously, it implied it would have the same results display as the search filters.

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: kelly <kelly@bywatersolutions.com>
Comment 60 Lucas Gass 2024-04-18 22:37:15 UTC
Needs rebased on top of Bug 36490 now.
Comment 61 Aleisha Amohia 2024-04-21 22:39:38 UTC
Created attachment 165238 [details] [review]
Bug 33260: Add Notice management tool

This enhancement makes it easy for the library to view sent notices and filter by various search parameters.

You can also print sent notices, individually or in a batch.

This enhancement uses a new system preference NoticesManagement and a new view_generated_notices user permission.

This enhancement has been built on top of Bug 33478 so print format settings are taken into account when printing notices.

To test:
1. Apply patches, install database updates, restart services
2. Make sure your logged in user has the view_generated_notices permission checked
3. Enable the NoticesManagement system preference
4. Generate a few notices. There are a few ways to do this including:
- place holds, check in items and confirm the holds
- place recalls, check in items and confirm the recalls
5. Go to Tools -> Notices management
6. There are two search functions on the left navigation. Confirm the patron search box works by searching for one of the patrons you generated a notice for, you should be redirected to their Notice history.
7. Go back to Notices management. Use the set of search filters to search for notices. Leaving the search filters empty will return all notices generated. Confirm the filters work as expected by using different combinations of filters.
8. Conduct a search so your notices show in a table. Confirm the information fetched about the notices is correct.
9. Click on a notice title. Confirm the contents of the notice show in a pop-up box.
10. Click one of the Print buttons next to a notice. Confirm the notice is opened to be printed.
11. Redo your notices search. Confirm the status of the notice you just printed has now been updated to 'sent'.
12. Use the 'Select all' and 'Clear all' buttons to select or clear the checkboxes.
13. Select a few checkboxes and click the button at the bottom of the table to 'Print selected notices'. Confirm the notices have been collated into one document, separated by horizontal lines, and prints successfully. The statuses for the notices should all be updated to 'sent'.
14. Confirm the Notices management page is not visible without the view_generated_notices permission
15. Confirm the Notices management page is not visible without the NoticesManagement system preference being enabled.
16. Go to a patron's Notices history. If the view_generated_notices user permission is checked for your logged in patron, you should see a Print button for each notice. Confirm this works. Confirm this button doesn't show if your logged in patron does not have the view_generated_notices user permission. It does not require the NoticesManagement system preference.

17. Go to Tools -> Notices & slips
18. Edit the format settings of a few different notices i.e. HOLD and WELCOME
19. Generate these notices by filling a hold for a patron and sending a welcome email
20. Search for all notices under Tools -> Notices management
21. Select all notices and print selected notices
22. Confirm the notices different format settings are taken into account in the printed PDF

Sponsored-by: Colorado Library Consortium
Signed-off-by: kelly <kelly@bywatersolutions.com>
Comment 62 Aleisha Amohia 2024-04-21 22:39:42 UTC
Created attachment 165239 [details] [review]
Bug 33260: Move patron search into main body of page

This patch moves the patron search in the Notices management page to the main body of the page so that the patron search result table displays more nicely.

This is a better place for it anyway, as using this search takes the user to a different page. In the sidebar, where it was previously, it implied it would have the same results display as the search filters.

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: kelly <kelly@bywatersolutions.com>
Comment 63 David Nind 2024-04-22 08:18:27 UTC
I could not test steps 5-13 (Tools > Notices management) because I get these errors (maybe partially related to Bug 34478 and Bug 36192 - CSRF protection) (other steps all work as expected):

1. Patron search: entering a partial name doesn't come up with the full name and card number to select (for example: start typing mary). Two errors in the console:

jQuery.Deferred exception: Cannot set properties of undefined (setting '_renderItem') TypeError: Cannot set properties of undefined (setting '_renderItem')
    at patron_autocomplete (http://127.0.0.1:8081/intranet-tmpl/prog/js/staff-global_23.1200025.js:574:46)
    at HTMLDocument.<anonymous> (http://127.0.0.1:8081/cgi-bin/koha/tools/notices.pl:2803:21)
    at e (http://127.0.0.1:8081/intranet-tmpl/lib/jquery/jquery-3.6.0.min_23.1200025.js:2:30038)
    at t (http://127.0.0.1:8081/intranet-tmpl/lib/jquery/jquery-3.6.0.min_23.1200025.js:2:30340) undefined

Uncaught TypeError: Cannot set properties of undefined (setting '_renderItem')
    at patron_autocomplete (staff-global_23.1200025.js:574:46)
    at HTMLDocument.<anonymous> (notices.pl:2803:21)
    at e (jquery-3.6.0.min_23.1200025.js:2:30038)
    at t (jquery-3.6.0.min_23.1200025.js:2:30340)

2. Browse by last name: selecting any letter displays all patrons ("showing 1 to 20 of 53 entries").

3. Selecting a patron (after choosing a letter) - nothing displays apart from the patrons search/browse by last name box) (for example: http://127.0.0.1:8081/cgi-bin/koha/tools/notices.pl?&borrowernumber=49)

4. Error when using the search filters. Click 'Search' (no need to change any filter options), error displayed:

An error has occurred!
Error 403
Programming error - op 'search' must start with 'cud-' for POST http://127.0.0.1:8081/intranet/tools/notices.pl (referer: http://127.0.0.1:8081/cgi-bin/koha/tools/notices.pl?&borrowernumber=49)
Comment 64 Aleisha Amohia 2024-04-29 01:56:30 UTC
Created attachment 165717 [details] [review]
Bug 33260: (follow-up) Fix search forms on notices mgmt page
Comment 65 Aleisha Amohia 2024-04-29 02:04:58 UTC
(In reply to David Nind from comment #63)
> I could not test steps 5-13 (Tools > Notices management) because I get these
> errors (maybe partially related to Bug 34478 and Bug 36192 - CSRF
> protection) (other steps all work as expected):
> 

Thanks for testing David, I believe I have addressed these errors in the latest follow up.
Comment 66 David Nind 2024-04-29 05:29:57 UTC
(In reply to Aleisha Amohia from comment #65)
> (In reply to David Nind from comment #63)
> > I could not test steps 5-13 (Tools > Notices management) because I get these
> > errors (maybe partially related to Bug 34478 and Bug 36192 - CSRF
> > protection) (other steps all work as expected):
> > 
> 
> Thanks for testing David, I believe I have addressed these errors in the
> latest follow up.

Thanks Aleisha for updating!

The patron search block on the notices management tool page is now working.

However, for the search filters on the left, I'm still getting an error when clicking on 'Search':

  An error has occurred!
  Error 403
  Programming error - op 'search' must start with 'cud-' for POST http://127.0.0.1:8081/intranet/tools/notices.pl (referer: http://127.0.0.1:8081/cgi-bin/koha/tools/notices.pl)
Comment 67 Aleisha Amohia 2024-05-01 03:53:28 UTC
Created attachment 165939 [details] [review]
Bug 33260: (follow-up) Fix search forms on notices mgmt page
Comment 68 David Nind 2024-05-01 08:26:26 UTC
Created attachment 165946 [details] [review]
Bug 33260: Add view_generated_notices user permission

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: kelly <kelly@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 69 David Nind 2024-05-01 08:26:30 UTC
Created attachment 165947 [details] [review]
Bug 33260: Add NoticesManagement system preference

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: kelly <kelly@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 70 David Nind 2024-05-01 08:26:33 UTC
Created attachment 165948 [details] [review]
Bug 33260: Add a patron getter method to Koha::Notice::Message

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: kelly <kelly@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 71 David Nind 2024-05-01 08:26:37 UTC
Created attachment 165949 [details] [review]
Bug 33260: Add Notice management tool

This enhancement makes it easy for the library to view sent notices and filter by various search parameters.

You can also print sent notices, individually or in a batch.

This enhancement uses a new system preference NoticesManagement and a new view_generated_notices user permission.

This enhancement has been built on top of Bug 33478 so print format settings are taken into account when printing notices.

To test:
1. Apply patches, install database updates, restart services
2. Make sure your logged in user has the view_generated_notices permission checked
3. Enable the NoticesManagement system preference
4. Generate a few notices. There are a few ways to do this including:
- place holds, check in items and confirm the holds
- place recalls, check in items and confirm the recalls
5. Go to Tools -> Notices management
6. There are two search functions on the left navigation. Confirm the patron search box works by searching for one of the patrons you generated a notice for, you should be redirected to their Notice history.
7. Go back to Notices management. Use the set of search filters to search for notices. Leaving the search filters empty will return all notices generated. Confirm the filters work as expected by using different combinations of filters.
8. Conduct a search so your notices show in a table. Confirm the information fetched about the notices is correct.
9. Click on a notice title. Confirm the contents of the notice show in a pop-up box.
10. Click one of the Print buttons next to a notice. Confirm the notice is opened to be printed.
11. Redo your notices search. Confirm the status of the notice you just printed has now been updated to 'sent'.
12. Use the 'Select all' and 'Clear all' buttons to select or clear the checkboxes.
13. Select a few checkboxes and click the button at the bottom of the table to 'Print selected notices'. Confirm the notices have been collated into one document, separated by horizontal lines, and prints successfully. The statuses for the notices should all be updated to 'sent'.
14. Confirm the Notices management page is not visible without the view_generated_notices permission
15. Confirm the Notices management page is not visible without the NoticesManagement system preference being enabled.
16. Go to a patron's Notices history. If the view_generated_notices user permission is checked for your logged in patron, you should see a Print button for each notice. Confirm this works. Confirm this button doesn't show if your logged in patron does not have the view_generated_notices user permission. It does not require the NoticesManagement system preference.

17. Go to Tools -> Notices & slips
18. Edit the format settings of a few different notices i.e. HOLD and WELCOME
19. Generate these notices by filling a hold for a patron and sending a welcome email
20. Search for all notices under Tools -> Notices management
21. Select all notices and print selected notices
22. Confirm the notices different format settings are taken into account in the printed PDF

Sponsored-by: Colorado Library Consortium
Signed-off-by: kelly <kelly@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 72 David Nind 2024-05-01 08:26:41 UTC
Created attachment 165950 [details] [review]
Bug 33260: Move patron search into main body of page

This patch moves the patron search in the Notices management page to the main body of the page so that the patron search result table displays more nicely.

This is a better place for it anyway, as using this search takes the user to a different page. In the sidebar, where it was previously, it implied it would have the same results display as the search filters.

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: kelly <kelly@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 73 David Nind 2024-05-01 08:26:44 UTC
Created attachment 165951 [details] [review]
Bug 33260: (follow-up) Fix search forms on notices mgmt page

Signed-off-by: David Nind <david@davidnind.com>
Comment 74 David Nind 2024-05-01 09:09:52 UTC
Thanks for fixing Aleisha!

This looks great, and things worked as set out in the test plan.

Some things I noticed and some suggestions (but not showstoppers for me):
1. Background for search results - I think this needs the white background div.
2. Step 13 - each notice was on a separate page, I didn't notice any horizontal lines.
3. Search filters: maybe this should also have a clear button or link beside the search button.
4. Search results display after printing selected notices. If you select multiple notices and click "Print selected notices", after you have saved the PDF and returned to the notices management screen, items are still selected, the print selected notices button is still selected, and the status stays as pending. Once you do another search or refresh the page, things display as expected. Is there a way to refresh the page once the selected notices are printed?

Testing notes (using KTD):
1. I added an email address to the patron(s) I generated the notices for.
2. I updated the patron messaging preferences for the patron(s) I generated the notices for (I enabled item check-in and item checkout).
Comment 75 Martin Renvoize 2024-05-01 16:43:12 UTC
Created attachment 166020 [details] [review]
Bug 33260: (QA follow-up) Correct relation accessor and add unit test

We were missing unit tests for the patron relation accessor added to
Koha::Notice::Message and once I looked at adding the test I spotted the
accessor was also using a rather outdated form.
Comment 76 Martin Renvoize 2024-05-01 16:53:06 UTC
Still looking here.. must admit I'm a little disappointed to find it all coded in a style we've long since moved away from even though it's a very recent project in the grand scheme.

I'm worried about performance.. that table fills up with notice quickly and we're not paging or using API's.

Also, we now have non-template driven notices and those cause a spectacular error on attempting to print.

It looks like you're generating the notice from scratch at print time rather than using the notice that exists.. that also feels odd.. it could lead to viewing the preview and then printing something entirely different to what you just previewed.

Anyway.. I'll come back to this asap once I've dug a little further.
Comment 77 Aleisha Amohia 2024-05-01 20:59:20 UTC
(In reply to Martin Renvoize from comment #76)
> Still looking here.. must admit I'm a little disappointed to find it all
> coded in a style we've long since moved away from even though it's a very
> recent project in the grand scheme.
> 
It was an oversight, I started this development over a year ago but I know that standard has been in place for a while so my apologies.

The API and datatables stuff has moved on quite a lot since we first started using it and it isn't documented well in the wiki, so unfortunately sometimes I do need to make mistakes and be corrected. I really appreciate any specific comments or feedback I can implement here, or links to the wiki which explains the standards for these things.
Comment 78 Martin Renvoize 2024-05-02 08:43:11 UTC
I'm a little worried about data privacy here I'm afraid.. I think I would expect to see use of Koha::Patrons->search_limited to limit results to patrons the logged-in user has the right to see.

I'd be interested to get some feedback on that from a wider audience
Comment 79 Nick Clemens (kidclamp) 2024-05-02 15:05:08 UTC
Our team looked here as well.

I think the privacy concern is the hard block here - if search_limited was implemented here (similar to Koha::ArticleRequests::search_limited) to limit the messages to patrons who the user can view this could move ahead.

Martin's comment about non-templated notices should be addressed as well.

We agree too that we need to improve the documentation and guidelines for datatables/searching/API interactions and will add that to the next dev meeting agenda
Comment 80 Aleisha Amohia 2024-05-06 03:23:49 UTC
Created attachment 166178 [details] [review]
Bug 33260: Use search_limited to protect message privacy, and unit test

This patch adds a Koha::Notice::Messages->search_limited sub to allow better control over which patron's notices the user can see.

Test added to t/db_dependent/Koha/Notice/Message.t
Comment 81 Aleisha Amohia 2024-05-06 03:24:38 UTC
Thanks for the comments, I've attached a new patch implementing Koha::Notice::Messages->search_limited.

I'm not sure what you mean by non-templated notices - are you able to give me an example of this please?
Comment 82 Martin Renvoize 2024-05-07 18:48:17 UTC
Created attachment 166335 [details] [review]
Bug 33260: Add view_generated_notices user permission

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: kelly <kelly@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 83 Martin Renvoize 2024-05-07 18:48:22 UTC
Created attachment 166336 [details] [review]
Bug 33260: Add NoticesManagement system preference

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: kelly <kelly@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 84 Martin Renvoize 2024-05-07 18:48:26 UTC
Created attachment 166337 [details] [review]
Bug 33260: Add a patron getter method to Koha::Notice::Message

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: kelly <kelly@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 85 Martin Renvoize 2024-05-07 18:48:31 UTC
Created attachment 166338 [details] [review]
Bug 33260: Add Notice management tool

This enhancement makes it easy for the library to view sent notices and filter by various search parameters.

You can also print sent notices, individually or in a batch.

This enhancement uses a new system preference NoticesManagement and a new view_generated_notices user permission.

This enhancement has been built on top of Bug 33478 so print format settings are taken into account when printing notices.

To test:
1. Apply patches, install database updates, restart services
2. Make sure your logged in user has the view_generated_notices permission checked
3. Enable the NoticesManagement system preference
4. Generate a few notices. There are a few ways to do this including:
- place holds, check in items and confirm the holds
- place recalls, check in items and confirm the recalls
5. Go to Tools -> Notices management
6. There are two search functions on the left navigation. Confirm the patron search box works by searching for one of the patrons you generated a notice for, you should be redirected to their Notice history.
7. Go back to Notices management. Use the set of search filters to search for notices. Leaving the search filters empty will return all notices generated. Confirm the filters work as expected by using different combinations of filters.
8. Conduct a search so your notices show in a table. Confirm the information fetched about the notices is correct.
9. Click on a notice title. Confirm the contents of the notice show in a pop-up box.
10. Click one of the Print buttons next to a notice. Confirm the notice is opened to be printed.
11. Redo your notices search. Confirm the status of the notice you just printed has now been updated to 'sent'.
12. Use the 'Select all' and 'Clear all' buttons to select or clear the checkboxes.
13. Select a few checkboxes and click the button at the bottom of the table to 'Print selected notices'. Confirm the notices have been collated into one document, separated by horizontal lines, and prints successfully. The statuses for the notices should all be updated to 'sent'.
14. Confirm the Notices management page is not visible without the view_generated_notices permission
15. Confirm the Notices management page is not visible without the NoticesManagement system preference being enabled.
16. Go to a patron's Notices history. If the view_generated_notices user permission is checked for your logged in patron, you should see a Print button for each notice. Confirm this works. Confirm this button doesn't show if your logged in patron does not have the view_generated_notices user permission. It does not require the NoticesManagement system preference.

17. Go to Tools -> Notices & slips
18. Edit the format settings of a few different notices i.e. HOLD and WELCOME
19. Generate these notices by filling a hold for a patron and sending a welcome email
20. Search for all notices under Tools -> Notices management
21. Select all notices and print selected notices
22. Confirm the notices different format settings are taken into account in the printed PDF

Sponsored-by: Colorado Library Consortium
Signed-off-by: kelly <kelly@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 86 Martin Renvoize 2024-05-07 18:48:35 UTC
Created attachment 166339 [details] [review]
Bug 33260: Move patron search into main body of page

This patch moves the patron search in the Notices management page to the main body of the page so that the patron search result table displays more nicely.

This is a better place for it anyway, as using this search takes the user to a different page. In the sidebar, where it was previously, it implied it would have the same results display as the search filters.

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: kelly <kelly@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 87 Martin Renvoize 2024-05-07 18:48:38 UTC
Created attachment 166340 [details] [review]
Bug 33260: (follow-up) Fix search forms on notices mgmt page

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 88 Martin Renvoize 2024-05-07 18:48:42 UTC
Created attachment 166341 [details] [review]
Bug 33260: (QA follow-up) Correct relation accessor and add unit test

We were missing unit tests for the patron relation accessor added to
Koha::Notice::Message and once I looked at adding the test I spotted the
accessor was also using a rather outdated form.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 89 Martin Renvoize 2024-05-07 18:48:46 UTC
Created attachment 166342 [details] [review]
Bug 33260: Use search_limited to protect message privacy, and unit test

This patch adds a Koha::Notice::Messages->search_limited sub to allow better control over which patron's notices the user can see.

Test added to t/db_dependent/Koha/Notice/Message.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 90 Martin Renvoize 2024-05-07 18:48:49 UTC
Created attachment 166343 [details] [review]
Bug 33260: Tidy unit test

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 91 Martin Renvoize 2024-05-07 18:48:53 UTC
Created attachment 166344 [details] [review]
Bug 33260: (QA follow-up) Add template relation

This patch add the 'template' relation to the Koha::Notice::Message
object to fetch the Koha::Notice::Template object that may have been
used to generate the notice.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 92 Martin Renvoize 2024-05-07 18:48:57 UTC
Created attachment 166345 [details] [review]
Bug 33260: (QA follow-up) Safely continue for non-templated notices

The 'letter_id'/'letter_code' field in the message queue table is a
NULLable foreign key as is indeed NULL in certain circustances. We need
to gracefully degrade when there isn't a template for the notice in
question.

Tihs patch uses the newly introduced 'template' accessor and when that
returns undefined we pass 'style' as an empty string.

We also use the 'is_html' method introduced in bug 35285 to set the html
flag.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 93 Martin Renvoize 2024-05-07 18:54:33 UTC
I've added some follow-ups..
1) Tidy the new unit test for search_limited
2) Add a relation (Still need to add a unit test for this) for 'template' from the Koha::Notice::Message class
3) To safely degrade rather than throw a nasty 500 error to screen when a notice doesn't have a corresponding template (Try the new 'Add message - email' functionality from the patron details page to see the 500)

Still a little more to do here and I will continue tomorrow (It's 8pm here already).

We need that unit test adding for the new relation I introduce.. but I also want to investigate how the styling works together with a mix of HTML and non-HTML notices.. also interested in seeing how SlipCSS works with this as I'm surprised to now see it using the circ/print-slip template.. I thought that was very much intended for slip printers where as I thought this particular feature was more about printing notices to a Letter/A4 size printer.. especially 'email' notices.. does it also work with other message transport type notices?
Comment 94 Martin Renvoize 2024-05-07 19:45:21 UTC
Maybe look into batch/print-notices.tt template instead of circ/print-slip.tt here.. though I still don't understand how the new CSS per template can possibly work here the way this is written.
Comment 95 Martin Renvoize 2024-05-08 09:00:18 UTC
(In reply to Martin Renvoize from comment #94)
> Maybe look into batch/print-notices.tt template instead of
> circ/print-slip.tt here.. though I still don't understand how the new CSS
> per template can possibly work here the way this is written.

OK.. Whilst I think batch/print-notices.tt is better suited here, I do see that the localised CSS stuff is accounted for in circ/print-slip.tt and SlipCSS is seldom used in my experience.

For now, I think this is OK as is but I would like to tidy up in the future as part of bug 36809
Comment 96 Martin Renvoize 2024-05-08 09:02:35 UTC
Now I'm asking if the choice of columns/fields displayed and their order was a deliberate choice on the Notice management page..

I'd expect them to align with those displayed in the single patron display table.. especially the feedback for send failures etc.
Comment 97 Martin Renvoize 2024-05-08 09:45:14 UTC
Created attachment 166362 [details] [review]
Bug 33260: Add view_generated_notices user permission

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: kelly <kelly@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 98 Martin Renvoize 2024-05-08 09:45:18 UTC
Created attachment 166363 [details] [review]
Bug 33260: Add NoticesManagement system preference

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: kelly <kelly@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 99 Martin Renvoize 2024-05-08 09:45:22 UTC
Created attachment 166364 [details] [review]
Bug 33260: Add a patron getter method to Koha::Notice::Message

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: kelly <kelly@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 100 Martin Renvoize 2024-05-08 09:45:27 UTC
Created attachment 166365 [details] [review]
Bug 33260: Add Notice management tool

This enhancement makes it easy for the library to view sent notices and filter by various search parameters.

You can also print sent notices, individually or in a batch.

This enhancement uses a new system preference NoticesManagement and a new view_generated_notices user permission.

This enhancement has been built on top of Bug 33478 so print format settings are taken into account when printing notices.

To test:
1. Apply patches, install database updates, restart services
2. Make sure your logged in user has the view_generated_notices permission checked
3. Enable the NoticesManagement system preference
4. Generate a few notices. There are a few ways to do this including:
- place holds, check in items and confirm the holds
- place recalls, check in items and confirm the recalls
5. Go to Tools -> Notices management
6. There are two search functions on the left navigation. Confirm the patron search box works by searching for one of the patrons you generated a notice for, you should be redirected to their Notice history.
7. Go back to Notices management. Use the set of search filters to search for notices. Leaving the search filters empty will return all notices generated. Confirm the filters work as expected by using different combinations of filters.
8. Conduct a search so your notices show in a table. Confirm the information fetched about the notices is correct.
9. Click on a notice title. Confirm the contents of the notice show in a pop-up box.
10. Click one of the Print buttons next to a notice. Confirm the notice is opened to be printed.
11. Redo your notices search. Confirm the status of the notice you just printed has now been updated to 'sent'.
12. Use the 'Select all' and 'Clear all' buttons to select or clear the checkboxes.
13. Select a few checkboxes and click the button at the bottom of the table to 'Print selected notices'. Confirm the notices have been collated into one document, separated by horizontal lines, and prints successfully. The statuses for the notices should all be updated to 'sent'.
14. Confirm the Notices management page is not visible without the view_generated_notices permission
15. Confirm the Notices management page is not visible without the NoticesManagement system preference being enabled.
16. Go to a patron's Notices history. If the view_generated_notices user permission is checked for your logged in patron, you should see a Print button for each notice. Confirm this works. Confirm this button doesn't show if your logged in patron does not have the view_generated_notices user permission. It does not require the NoticesManagement system preference.

17. Go to Tools -> Notices & slips
18. Edit the format settings of a few different notices i.e. HOLD and WELCOME
19. Generate these notices by filling a hold for a patron and sending a welcome email
20. Search for all notices under Tools -> Notices management
21. Select all notices and print selected notices
22. Confirm the notices different format settings are taken into account in the printed PDF

Sponsored-by: Colorado Library Consortium
Signed-off-by: kelly <kelly@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 101 Martin Renvoize 2024-05-08 09:45:31 UTC
Created attachment 166366 [details] [review]
Bug 33260: Move patron search into main body of page

This patch moves the patron search in the Notices management page to the main body of the page so that the patron search result table displays more nicely.

This is a better place for it anyway, as using this search takes the user to a different page. In the sidebar, where it was previously, it implied it would have the same results display as the search filters.

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: kelly <kelly@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 102 Martin Renvoize 2024-05-08 09:45:35 UTC
Created attachment 166367 [details] [review]
Bug 33260: (follow-up) Fix search forms on notices mgmt page

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 103 Martin Renvoize 2024-05-08 09:45:38 UTC
Created attachment 166368 [details] [review]
Bug 33260: (QA follow-up) Correct relation accessor and add unit test

We were missing unit tests for the patron relation accessor added to
Koha::Notice::Message and once I looked at adding the test I spotted the
accessor was also using a rather outdated form.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 104 Martin Renvoize 2024-05-08 09:45:42 UTC
Created attachment 166369 [details] [review]
Bug 33260: Use search_limited to protect message privacy, and unit test

This patch adds a Koha::Notice::Messages->search_limited sub to allow better control over which patron's notices the user can see.

Test added to t/db_dependent/Koha/Notice/Message.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 105 Martin Renvoize 2024-05-08 09:45:46 UTC
Created attachment 166370 [details] [review]
Bug 33260: Tidy unit test

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 106 Martin Renvoize 2024-05-08 09:45:50 UTC
Created attachment 166371 [details] [review]
Bug 33260: (QA follow-up) Add template relation

This patch add the 'template' relation to the Koha::Notice::Message
object to fetch the Koha::Notice::Template object that may have been
used to generate the notice.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 107 Martin Renvoize 2024-05-08 09:45:53 UTC
Created attachment 166372 [details] [review]
Bug 33260: (QA follow-up) Safely continue for non-templated notices

The 'letter_id'/'letter_code' field in the message queue table is a
NULLable foreign key as is indeed NULL in certain circustances. We need
to gracefully degrade when there isn't a template for the notice in
question.

Tihs patch uses the newly introduced 'template' accessor and when that
returns undefined we pass 'style' as an empty string.

We also use the 'is_html' method introduced in bug 35285 to set the html
flag.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 108 Martin Renvoize 2024-05-08 09:45:57 UTC
Created attachment 166373 [details] [review]
Bug 33260: (QA follow-up) Add missing page-section

Add the missing page-section div to the new page and include required
messages.inc include as is now standard.
Comment 109 Martin Renvoize 2024-05-08 09:56:43 UTC
I've burnt through too much time here already but still don't feel this is quite ready and it's too close to hard feature freeze for this cycle in my opinion.

# Notices management page
* I don't understand why we start with a patron search up front and centre.. we already have a powerful patron search and replicating that code here seems to detract from the main purpose of the tool which is to display a list of notices filtered by things other than patron.
* Once a notice search is performed, I think the table column order should match that from the synonymous page in the patron record.

# Patron notices page

# Both
* Should print really appear for all transport types and message statuses?
* Should print really print an email notice using the email template, especially when there might be a print template designed specifically for print?
* Should we really be using the 'Slip' printing code rather than 'Notice' printing here?
* Should the permissions not reflect that they expose access to printing functionality rather than view functionality?
* I'm not sure that calling the print dialog should set the notice to 'sent'.. you can easily cancel before the print actually happens and so the updated status is a misrepresentation.


With all those open questions and ongoing work elsewhere to try and clean up the notices and slips code I feel this still needs more work.