https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44092 --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 211562 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211562&action=edit Bug 44092: Offer 'Resend' in Notices management for notices with a patron or an address In Notices management, the preview of a notice without a patron, such as the invitation to a shared list, had a 'Resend' button. It posted to the patron's Notices tab, which needs a patron, so it landed on an empty Circulation page and the notice was not resent. A notice can be resent when it is not pending and it has somewhere to go: a patron, whose address is used when it is sent, or an address of its own. * Add Koha::Notice::Message->can_be_resent, used to offer the button * C4::Letters::ResendMessage only clears the address of an email notice that has a patron, to get it from the patron again. The address of a notice without a patron is its only address, and is kept * Add a resend action to tools/notices.pl, which does not need a patron. The notices are limited to the patrons the user can see, as for the other actions. Resending the notice of a patron needs edit_borrowers, as from the patron's Notices tab; a notice without a patron only needs view_generated_notices, which gives access to the page * Say whether the notice was queued to be resent To test: 1. Set 'NoticesManagement' to 'Enable' and 'OpacAllowSharingPrivateLists' to 'Allow' 2. Log in to the OPAC as koha/koha, create a private list and share it with friend@example.com 3. In a KTD shell, run: perl misc/cronjobs/process_message_queue.pl (KTD has no mail server, so the invitation is now 'failed') 4. Go to More > Tools > Notices management and click the subject 'Share list ...' 5. Without the patch, 'Resend' lands on an empty Circulation page and the notice is not resent 6. Apply the patch, run restart_all, and try again: you stay in Notices management, with a message saying the notice is queued to be resent. The notice is pending, still for friend@example.com 7. Do the same for the notice of a patron (for example send a welcome notice): the notice is pending, and gets the address of the patron when sent 8. Confirm a pending notice, and a notice with no patron and no address, are not offered 'Resend' 9. As a staff member with 'view_generated_notices' and 'view_borrower_infos_from_any_libraries' but not 'edit_borrowers', confirm 'Resend' is offered for the invitation but not for the notice of a patron 10. Run: prove t/db_dependent/Koha/Notice/Message.t t/db_dependent/Letters.t 11. Run: yarn cypress run --spec t/cypress/integration/Tools/NoticesManagement_spec.ts Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.