Description
Aleisha Amohia
2023-03-17 02:36:15 UTC
Created attachment 148437 [details] [review] Bug 33260: Add view_generated_notices user permission Created attachment 148438 [details] [review] Bug 33260: Add NoticesManagement system preference Created attachment 148439 [details] [review] Bug 33260: Add a patron getter method to Koha::Notice::Message Created attachment 148440 [details] [review] Bug 33260: [WIP] Add Notice management tool Created attachment 148943 [details] [review] Bug 33260: [WIP] Add Notice management tool TODO: Get date filtering working, get Print going, add Print to members/notices.pl Created attachment 149009 [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 individual sent notices. TODO: Print multiple notices at once. Created attachment 149413 [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. 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. Sponsored-by: Colorado Library Consortium 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. 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. Created attachment 149581 [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. Created attachment 149593 [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> Created attachment 149594 [details] [review] Bug 33260: Add view_generated_notices user permission Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com> Created attachment 149595 [details] [review] Bug 33260: Add NoticesManagement system preference Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com> Created attachment 149596 [details] [review] Bug 33260: Add a patron getter method to Koha::Notice::Message Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com> Created attachment 149597 [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. 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. Sponsored-by: Colorado Library Consortium Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com> Created attachment 149598 [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> Love the way the new setup looks for the notice management page! Created attachment 150346 [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 Created attachment 150347 [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> 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. 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 Created attachment 154927 [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 Created attachment 154928 [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> 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 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> 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 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> Created attachment 157386 [details] [review] Bug 33260: Make styles apply per notice 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. 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. 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. 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. 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> 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 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> Created attachment 158855 [details] [review] Bug 33260: Make styles apply per notice 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! 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 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'. Created attachment 162570 [details] [review] Bug 33260: Add view_generated_notices user permission Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com> Created attachment 162571 [details] [review] Bug 33260: Add NoticesManagement system preference Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com> 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> 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 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> 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. 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 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> (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. 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> 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> 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> 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> 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> Tests are failing here and the DBUpdates need to have their file permissions corrected. Otherwise looks good! 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> 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> 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> 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> 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> Needs rebased on top of Bug 36490 now. 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> 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> 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) Created attachment 165717 [details] [review] Bug 33260: (follow-up) Fix search forms on notices mgmt page (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. (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) Created attachment 165939 [details] [review] Bug 33260: (follow-up) Fix search forms on notices mgmt page 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> 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> 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> 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> 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> Created attachment 165951 [details] [review] Bug 33260: (follow-up) Fix search forms on notices mgmt page Signed-off-by: David Nind <david@davidnind.com> 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). 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. 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. (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. 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 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 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 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? 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> 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> 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> 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> 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> 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> 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> 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> Created attachment 166343 [details] [review] Bug 33260: Tidy unit test Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> 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> 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> 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? 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. (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 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. 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> 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> 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> 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> 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> 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> 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> 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> Created attachment 166370 [details] [review] Bug 33260: Tidy unit test Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> 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> 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> 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. 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. 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 Created attachment 167909 [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> Created attachment 167910 [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> Created attachment 167911 [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> Created attachment 167912 [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> Created attachment 167913 [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> Created attachment 167914 [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> Created attachment 167915 [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> Created attachment 167916 [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> Created attachment 167917 [details] [review] Bug 33260: Tidy unit test Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 167918 [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> Created attachment 167919 [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> Created attachment 167920 [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. Created attachment 172247 [details] [review] Bug 33260: (follow-up) Rebase for bootstrap 5 Created attachment 172248 [details] [review] Bug 33260: (follow-up) Remove patron search as primary action This is a 'Notices' display tool, it doesn't make sense to me to replicate the 'Patrons' search interface as the primary action of the tool. Created attachment 172303 [details] [review] Bug 33260: (follow-up) Sync functionality and ordering of display This patch syncs up the functionality and order of the notice displays. We allow for resending of notices via the modal in the new tools page and we add print in bulk to the members notices page. We also fix the modal on the tools page to work with bootstrap 5 correctly. WIP: The resend appears to be broken at the moment in both locations.. for some reason the 'form' element is dropped at the browser so the button does not appear. Still working here.. I'm thinking the individual print may be more consistent to just have available from the modal display as we do in a few other places and that, to me, makes it clearer we're printing whats displayed as apposed to using the print notice (I'd love to see a 'convert to print' at a later date to handle adding address details etc to such notices) I need to work out why resend isn't working as expected.. I think that's a regression that predates this patchset somewhere however. We're much closer again now. Created attachment 172307 [details] [review] Bug 33260: (follow-up) Sync functionality and ordering of display This patch syncs up the functionality and order of the notice displays. We allow for resending of notices via the modal in the new tools page and we add print in bulk to the members notices page. We also fix the modal on the tools page to work with bootstrap 5 correctly. Created attachment 172308 [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> Created attachment 172309 [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> Created attachment 172310 [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> Created attachment 172311 [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> Created attachment 172312 [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> Created attachment 172313 [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> Created attachment 172314 [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> Created attachment 172315 [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> Created attachment 172316 [details] [review] Bug 33260: Tidy unit test Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 172317 [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> Created attachment 172318 [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> Created attachment 172319 [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. Created attachment 172320 [details] [review] Bug 33260: (follow-up) Rebase for bootstrap 5 Created attachment 172321 [details] [review] Bug 33260: (follow-up) Remove patron search as primary action This is a 'Notices' display tool, it doesn't make sense to me to replicate the 'Patrons' search interface as the primary action of the tool. Created attachment 172322 [details] [review] Bug 33260: (follow-up) Sync functionality and ordering of display This patch syncs up the functionality and order of the notice displays. We allow for resending of notices via the modal in the new tools page and we add print in bulk to the members notices page. We also fix the modal on the tools page to work with bootstrap 5 correctly. OK.. I think I've handled all the issues I was worried about bar one.. I still think setting the status to 'sent' doesn't feel right.. I'd rather not set that and allow printing as it's own distinct action. It might be nice to have a 'printed' record somewhere, but I think it's misleading to set an SMS or email to 'sent' when it's in fact failed to send and has instead been printed or printed as an extra action after already having been sent... maybe adding to the delivery note could help there as an alternative. Finally.. I'm wondering if dropping the 'Actions' column and having the print button inside the preview modal would be cleaner given we already have the option to 'Resend' embedded inside that.. if not maybe we could have both Print and Resent as options in the Actions column. Anywho.. I'll continue here tomorrow. The idea of marking things sent was to have a way to distinguish what had been printed and what had not. So duplicate notices are not printed and delivered. If there is a better way of noting that printing has taken place, that doesn't mislead as "sent" that would cover the functionality that is needed. - Bob Thanks Martin, Nick and Bob! If I can be of any help let me know. (In reply to Martin Renvoize (ashimema) from comment #143) > I still think setting the status to 'sent' doesn't feel right.. I'd rather > not set that and allow printing as it's own distinct action. It might be > nice to have a 'printed' record somewhere, but I think it's misleading to > set an SMS or email to 'sent' when it's in fact failed to send and has > instead been printed or printed as an extra action after already having been > sent... maybe adding to the delivery note could help there as an alternative. I think 'sent' can be the low bar here, making it optional would be nice, but like Bob said, having a way to know what was printed is good. Marking print as 'sent' mirrors the gather print notices, and allows this tool as a drop in replacement, staff accessible, for that cron. I think a followup bug for adding 'printed' to the status enum would be excellent Thanks for the replies everyone. I'm sold in the marking as sent, that makes sense, especially when a notice is coming from 'pending' and is a 'print' type notice in the first place. The query comes from those notices that appear in these two pages that are already in another state and especially those that are not 'print' type. Makeing them sent when they were pending will prevent emails from going out for example.. though I suppose it does make sense if they're in a failure state and you want to use print as a fallback. Anyway, I'm happy to accept 'sent' for all. I do have another couple of questions however. In the bulk select and print process, each notice is printed without any additional spacing between, all on one page one after the other. Should we not add page breaks between notices so you have a notice per page (gather_print_notices appears to have lost this page breaking functionality somewhere along the line :( ) Do we also need to consider including headers here with address details etc. For print type notices we usually include physical address details right in the notice, but when printing an email type notice you currently won't get any addressee detail.. for a bulk print this would get confusing quickly I think. (This could be done in a follow-up bug perhaps.. or we could limit to print type notices for the print functionality at first?) The thing I'm finding hard to fully understand here is the mix of notice transport types all in this one print option. If the transport type was 'print' it makes a fair bit of sense because you usually have address details as part of the notice itself.. if it was an email then you won't get any addressee details at all in most notices with this print option. I can see it being nice to individually print a copy of an email notice upon request or when email has failed. Again, adding this header support could perhaps be a follow-up bug a this stage. Finally, I've been trying to dry out our printing code, but this itbeoduces yet another printslip controller that's almost a copy paste of the 6+ existing scripts.. why not use members/printnotice.pl which I was trying to keep as a simple single place for printing slips so we stop adding new functionality and then forgetting to replicated I. The 6+ clones of code? I'll look at doing that here to save me the job of later removing that scriot again. Thanks Martin for your questions! (In reply to Martin Renvoize (ashimema) from comment #147) > I do have another couple of questions however. > > In the bulk select and print process, each notice is printed without any > additional spacing between, all on one page one after the other. > > Should we not add page breaks between notices so you have a notice per page > (gather_print_notices appears to have lost this page breaking functionality > somewhere along the line :( ) That would be great. I remember finding it hard to make that work but I can't remember why - please feel free to give it a go! > > Do we also need to consider including headers here with address details etc. > For print type notices we usually include physical address details right in > the notice, but when printing an email type notice you currently won't get > any addressee detail.. for a bulk print this would get confusing quickly I > think. (This could be done in a follow-up bug perhaps.. or we could limit to > print type notices for the print functionality at first?) Perhaps for email type notices we could include something like the patron-title.inc at the top? > > The thing I'm finding hard to fully understand here is the mix of notice > transport types all in this one print option. If the transport type was > 'print' it makes a fair bit of sense because you usually have address > details as part of the notice itself.. if it was an email then you won't get > any addressee details at all in most notices with this print option. I can > see it being nice to individually print a copy of an email notice upon > request or when email has failed. Again, adding this header support could > perhaps be a follow-up bug a this stage. Email type notices were included here because in the case of CLiC, Koha is being used for libraries where patrons don't have email addresses but still want to generate notices that Koha defaults to email for. > > Finally, I've been trying to dry out our printing code, but this itbeoduces > yet another printslip controller that's almost a copy paste of the 6+ > existing scripts.. why not use members/printnotice.pl which I was trying to > keep as a simple single place for printing slips so we stop adding new > functionality and then forgetting to replicated I. The 6+ clones of code? > I'll look at doing that here to save me the job of later removing that > scriot again. I can't remember why I did this - maybe to allow for printing multiple at once, or to include updating the status of the notice, without breaking existing behaviour. Really happy for you to squash the scripts. Created attachment 172342 [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> Created attachment 172343 [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> Created attachment 172344 [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> Created attachment 172345 [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> Created attachment 172346 [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> Created attachment 172347 [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> Created attachment 172348 [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> Created attachment 172349 [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> Created attachment 172350 [details] [review] Bug 33260: Tidy unit test Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 172351 [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> Created attachment 172352 [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> Created attachment 172353 [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. Created attachment 172354 [details] [review] Bug 33260: (follow-up) Rebase for bootstrap 5 Created attachment 172355 [details] [review] Bug 33260: (follow-up) Remove patron search as primary action This is a 'Notices' display tool, it doesn't make sense to me to replicate the 'Patrons' search interface as the primary action of the tool. Created attachment 172356 [details] [review] Bug 33260: (follow-up) Sync functionality and ordering of display This patch syncs up the functionality and order of the notice displays. We allow for resending of notices via the modal in the new tools page and we add print in bulk to the members notices page. We also fix the modal on the tools page to work with bootstrap 5 correctly. Created attachment 172357 [details] [review] Bug 33260: (follow-up) Add correct page title to print Created attachment 172358 [details] [review] Bug 33260: (follow-up) Limit printing to non-pending on members page This patch prevent printing of notices in the 'pending' state. This ensures that email notices will not be skipped by process message queue at it's next run as we set the 'sent' status on print with this patchset. It still allows for printing of sent and failed messages which I believe is the purpose of the original patchset. Created attachment 172359 [details] [review] Bug 33260: (follow-up) Alternative print button in modal This adds a simple print option to the modal preview display on the members page. It simply prints the content of the display modal and doesn't set the status change. This might be useful to allow pending notices to still be printed. *** Bug 7638 has been marked as a duplicate of this bug. *** Created attachment 172379 [details] [review] Bug 33260: (follow-up) Correct call to 'style' Very quick code review and testing: 1. Koha::Notice::Message->patron + return unless $patron_rs; This is not tested 2. Koha::Notice::Message->template + return unless $template_rs; Same 3. QA script failures FAIL koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt FAIL tt_valid lines 75 FAIL koha-tmpl/intranet-tmpl/prog/en/modules/tools/notices.tt FAIL spelling noice ==> noise, nice, notice 4. <th class="nosort"> </th> + "aoColumnDefs": [ + { 'bSortable': false, 'aTargets': [ 'nosort' ] } + ], You should use .NoSort on the th and don't need the aoColumnDefs. 5. members/notices.pl?borrowernumber=5 Without entry we should not show the table but "There are no notices for this patron" instead. 6. "Pending" notices have their checkbox disabled, we should display a onmouseover tooltip. 7. if you print a notice that was "failed", it's then "sent" but the "delivery note" failure is still displayed on the template. Does it make sense? 8. Is it expected to print using "email" mtt, shouldn't we use the "print" template instead? 9. 2 different outputs: * Using "Print" from the actions column http://localhost:8081/cgi-bin/koha/tools/print_notice.pl?message_ids=73 Using CHECKIN, all on one line "The following items have been checked out: E Street shuffle Thank you for visiting Centerville." * Using "Print" from the modal http://localhost:8081/cgi-bin/koha/members/notices.pl?borrowernumber=5 "Checkouts The following items have been checked out: E Street shuffle Thank you for visiting Centerville." Also the name of the pdf in the second example is "notices.pl.pdf" 10. "Resend" - Shouldn't we actually enqueue another message in order to keep track of what have been failed/sent? Created attachment 175501 [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> Created attachment 175502 [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> Created attachment 175503 [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> Created attachment 175504 [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> Created attachment 175505 [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> Created attachment 175506 [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> Created attachment 175507 [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> Created attachment 175508 [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> Created attachment 175509 [details] [review] Bug 33260: Tidy unit test Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 175510 [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> Created attachment 175511 [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> Created attachment 175512 [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. Created attachment 175513 [details] [review] Bug 33260: (follow-up) Rebase for bootstrap 5 Created attachment 175514 [details] [review] Bug 33260: (follow-up) Remove patron search as primary action This is a 'Notices' display tool, it doesn't make sense to me to replicate the 'Patrons' search interface as the primary action of the tool. Created attachment 175515 [details] [review] Bug 33260: (follow-up) Sync functionality and ordering of display This patch syncs up the functionality and order of the notice displays. We allow for resending of notices via the modal in the new tools page and we add print in bulk to the members notices page. We also fix the modal on the tools page to work with bootstrap 5 correctly. Created attachment 175516 [details] [review] Bug 33260: (follow-up) Add correct page title to print Created attachment 175517 [details] [review] Bug 33260: (follow-up) Limit printing to non-pending on members page This patch prevent printing of notices in the 'pending' state. This ensures that email notices will not be skipped by process message queue at it's next run as we set the 'sent' status on print with this patchset. It still allows for printing of sent and failed messages which I believe is the purpose of the original patchset. Created attachment 175518 [details] [review] Bug 33260: (follow-up) Alternative print button in modal This adds a simple print option to the modal preview display on the members page. It simply prints the content of the display modal and doesn't set the status change. This might be useful to allow pending notices to still be printed. Created attachment 175519 [details] [review] Bug 33260: (follow-up) Correct call to 'style' Created attachment 175520 [details] [review] Bug 33260: (follow-up) More comprehensively test patron accessor Created attachment 175521 [details] [review] Bug 33260: (follow-up) More comprehensively test template accessor Created attachment 175522 [details] [review] Bug 33260: Fix typo noice -> notice Created attachment 175523 [details] [review] Bug 33260: Fix TT syntax failure Created attachment 175524 [details] [review] Bug 33260: Replace nosort with NoSort Created attachment 175525 [details] [review] Bug 33260: Add hint to disabled select checkbox Created attachment 175530 [details] [review] Bug 33260: (follow-up) Also add 'print' option to modal on tools (In reply to Jonathan Druart from comment #169) > Very quick code review and testing: > 1. Koha::Notice::Message->patron > + return unless $patron_rs; > This is not tested Fixed in yet another follow-up > 2. Koha::Notice::Message->template > + return unless $template_rs; Also fixed in yet another follow-up > 3. QA script failures > FAIL koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt > FAIL tt_valid lines 75 > FAIL koha-tmpl/intranet-tmpl/prog/en/modules/tools/notices.tt > FAIL spelling > > noice ==> noise, nice, notice Also fixed in a follow-up > 4. > <th class="nosort"> </th> > > + "aoColumnDefs": [ > + { 'bSortable': false, 'aTargets': [ 'nosort' ] } > + ], > > You should use .NoSort on the th and don't need the aoColumnDefs. Also fixed in a follow-up > 5. members/notices.pl?borrowernumber=5 > Without entry we should not show the table but "There are no notices for > this patron" instead. This is already the case > 6. "Pending" notices have their checkbox disabled, we should display a > onmouseover tooltip. Fixed in a follow-up > 7. if you print a notice that was "failed", it's then "sent" but the > "delivery note" failure is still displayed on the template. Does it make > sense? I raise this earlier in the thread of discussion and agree but I also don't really know what the answer is... I think we aught to handle print and other transports independently.. if it's print and it's printed yes, see it to sent.. if it's anything else perhaps add 'printed' to either the status or the delivery notes > 8. Is it expected to print using "email" mtt, shouldn't we use the "print" > template instead? Also raised above in discussion.. the objective I think was to allow printing existing notices already queued.. it's hard to 'convert to print' as we don't have the original objects data to hand after a message has been queued. > 9. 2 different outputs: > * Using "Print" from the actions column > http://localhost:8081/cgi-bin/koha/tools/print_notice.pl?message_ids=73 > Using CHECKIN, all on one line > "The following items have been checked out: E Street shuffle Thank you for > visiting Centerville." > * Using "Print" from the modal > http://localhost:8081/cgi-bin/koha/members/notices.pl?borrowernumber=5 > "Checkouts > The following items have been checked out: > E Street shuffle > Thank you for visiting Centerville." I asked about this above.. they use different printing methods.. the modal preview applies CSS and then you print the modal content.. the print from the actions hits a print controller on the server to load a whole new page. > Also the name of the pdf in the second example is "notices.pl.pdf" I'd missed this > 10. "Resend" - Shouldn't we actually enqueue another message in order to > keep track of what have been failed/sent? Resend predates all this work.. I don't know the answer but I think that should be dealt with in a distinct bug.. personally I think this should have been two bugs at least already.. one for display and a second for print handling.. the recent additions to notices and template handling with CSS and things have really complicated and confused matters for end users in my opinion and I'm just trying to work through and clarify those in the bug tree beyond this bug. Created attachment 175537 [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> Created attachment 175538 [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> Created attachment 175539 [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> Created attachment 175540 [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> Created attachment 175541 [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> Created attachment 175542 [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> Created attachment 175543 [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> Created attachment 175544 [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> Created attachment 175545 [details] [review] Bug 33260: Tidy unit test Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 175546 [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> Created attachment 175547 [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> Created attachment 175548 [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. Created attachment 175549 [details] [review] Bug 33260: (follow-up) Rebase for bootstrap 5 Created attachment 175550 [details] [review] Bug 33260: (follow-up) Remove patron search as primary action This is a 'Notices' display tool, it doesn't make sense to me to replicate the 'Patrons' search interface as the primary action of the tool. Created attachment 175551 [details] [review] Bug 33260: (follow-up) Sync functionality and ordering of display This patch syncs up the functionality and order of the notice displays. We allow for resending of notices via the modal in the new tools page and we add print in bulk to the members notices page. We also fix the modal on the tools page to work with bootstrap 5 correctly. Created attachment 175552 [details] [review] Bug 33260: (follow-up) Add correct page title to print Created attachment 175553 [details] [review] Bug 33260: (follow-up) Limit printing to non-pending on members page This patch prevent printing of notices in the 'pending' state. This ensures that email notices will not be skipped by process message queue at it's next run as we set the 'sent' status on print with this patchset. It still allows for printing of sent and failed messages which I believe is the purpose of the original patchset. Created attachment 175554 [details] [review] Bug 33260: (follow-up) Alternative print button in modal This adds a simple print option to the modal preview display on the members page. It simply prints the content of the display modal and doesn't set the status change. This might be useful to allow pending notices to still be printed. Created attachment 175555 [details] [review] Bug 33260: (follow-up) Correct call to 'style' Created attachment 175556 [details] [review] Bug 33260: (follow-up) More comprehensively test patron accessor Created attachment 175557 [details] [review] Bug 33260: (follow-up) More comprehensively test template accessor Created attachment 175558 [details] [review] Bug 33260: Fix typo noice -> notice Created attachment 175559 [details] [review] Bug 33260: Fix TT syntax failure Created attachment 175560 [details] [review] Bug 33260: Replace nosort with NoSort Created attachment 175561 [details] [review] Bug 33260: Add hint to disabled select checkbox Created attachment 175562 [details] [review] Bug 33260: (follow-up) Also add 'print' option to modal on tools Created attachment 175563 [details] [review] Bug 33260: Migrate notice printing to members/print_notice This migrates the bulk notice printing from tools/print_notice.pl using circ/printslip.tt to members/print_notice.pl using members/print_notice.tt This clarified that we are working on pre-existing notices in the message queue and as such should be applying relevant print/email notice styling and not slip styling. Re-order bugs so we aren't holding up an important CSS preferences clarification bug and in the hopes that gets this one moving again too.. it should make some of the testing of style output clearer in this bug having the other bug apply first instead of second. Created attachment 175730 [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> Created attachment 175731 [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> Created attachment 175732 [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> Created attachment 175733 [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> Created attachment 175734 [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> Created attachment 175735 [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> Created attachment 175736 [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> Created attachment 175737 [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> Created attachment 175738 [details] [review] Bug 33260: Tidy unit test Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 175739 [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> Created attachment 175740 [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> Created attachment 175741 [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. Created attachment 175742 [details] [review] Bug 33260: (follow-up) Rebase for bootstrap 5 Created attachment 175743 [details] [review] Bug 33260: (follow-up) Remove patron search as primary action This is a 'Notices' display tool, it doesn't make sense to me to replicate the 'Patrons' search interface as the primary action of the tool. Created attachment 175744 [details] [review] Bug 33260: (follow-up) Sync functionality and ordering of display This patch syncs up the functionality and order of the notice displays. We allow for resending of notices via the modal in the new tools page and we add print in bulk to the members notices page. We also fix the modal on the tools page to work with bootstrap 5 correctly. Created attachment 175745 [details] [review] Bug 33260: (follow-up) Add correct page title to print Created attachment 175746 [details] [review] Bug 33260: (follow-up) Limit printing to non-pending on members page This patch prevent printing of notices in the 'pending' state. This ensures that email notices will not be skipped by process message queue at it's next run as we set the 'sent' status on print with this patchset. It still allows for printing of sent and failed messages which I believe is the purpose of the original patchset. Created attachment 175747 [details] [review] Bug 33260: (follow-up) Alternative print button in modal This adds a simple print option to the modal preview display on the members page. It simply prints the content of the display modal and doesn't set the status change. This might be useful to allow pending notices to still be printed. Created attachment 175748 [details] [review] Bug 33260: (follow-up) Correct call to 'style' Created attachment 175749 [details] [review] Bug 33260: (follow-up) More comprehensively test patron accessor Created attachment 175750 [details] [review] Bug 33260: (follow-up) More comprehensively test template accessor Created attachment 175751 [details] [review] Bug 33260: Fix typo noice -> notice Created attachment 175752 [details] [review] Bug 33260: Fix TT syntax failure Created attachment 175753 [details] [review] Bug 33260: Replace nosort with NoSort Created attachment 175754 [details] [review] Bug 33260: Add hint to disabled select checkbox Created attachment 175755 [details] [review] Bug 33260: (follow-up) Also add 'print' option to modal on tools Created attachment 175756 [details] [review] Bug 33260: Migrate notice printing to members/print_notice This migrates the bulk notice printing from tools/print_notice.pl using circ/printslip.tt to members/print_notice.pl using members/print_notice.tt This clarified that we are working on pre-existing notices in the message queue and as such should be applying relevant print/email notice styling and not slip styling. Created attachment 178733 [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> Created attachment 178734 [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> Created attachment 178735 [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> Created attachment 178736 [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> Created attachment 178737 [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> Created attachment 178738 [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> Created attachment 178739 [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> Created attachment 178740 [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> Created attachment 178741 [details] [review] Bug 33260: Tidy unit test Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 178742 [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> Created attachment 178743 [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> Created attachment 178744 [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. Created attachment 178745 [details] [review] Bug 33260: (follow-up) Rebase for bootstrap 5 Created attachment 178746 [details] [review] Bug 33260: (follow-up) Remove patron search as primary action This is a 'Notices' display tool, it doesn't make sense to me to replicate the 'Patrons' search interface as the primary action of the tool. Created attachment 178747 [details] [review] Bug 33260: (follow-up) Sync functionality and ordering of display This patch syncs up the functionality and order of the notice displays. We allow for resending of notices via the modal in the new tools page and we add print in bulk to the members notices page. We also fix the modal on the tools page to work with bootstrap 5 correctly. Created attachment 178748 [details] [review] Bug 33260: (follow-up) Add correct page title to print Created attachment 178749 [details] [review] Bug 33260: (follow-up) Limit printing to non-pending on members page This patch prevent printing of notices in the 'pending' state. This ensures that email notices will not be skipped by process message queue at it's next run as we set the 'sent' status on print with this patchset. It still allows for printing of sent and failed messages which I believe is the purpose of the original patchset. Created attachment 178750 [details] [review] Bug 33260: (follow-up) Alternative print button in modal This adds a simple print option to the modal preview display on the members page. It simply prints the content of the display modal and doesn't set the status change. This might be useful to allow pending notices to still be printed. Created attachment 178751 [details] [review] Bug 33260: (follow-up) Correct call to 'style' Created attachment 178752 [details] [review] Bug 33260: (follow-up) More comprehensively test patron accessor Created attachment 178753 [details] [review] Bug 33260: (follow-up) More comprehensively test template accessor Created attachment 178754 [details] [review] Bug 33260: Fix typo noice -> notice Created attachment 178755 [details] [review] Bug 33260: Fix TT syntax failure Created attachment 178756 [details] [review] Bug 33260: Replace nosort with NoSort Created attachment 178757 [details] [review] Bug 33260: Add hint to disabled select checkbox Created attachment 178758 [details] [review] Bug 33260: (follow-up) Also add 'print' option to modal on tools Created attachment 178759 [details] [review] Bug 33260: Migrate notice printing to members/print_notice This migrates the bulk notice printing from tools/print_notice.pl using circ/printslip.tt to members/print_notice.pl using members/print_notice.tt This clarified that we are working on pre-existing notices in the message queue and as such should be applying relevant print/email notice styling and not slip styling. Just another rebase to keep it applying |