Bug 12426: Allow resend for sent messages
authorLari Taskula <larit@student.uef.fi>
Wed, 16 Sep 2015 15:31:57 +0000 (18:31 +0300)
committerBrendan A Gallagher <brendan@bywatersolutions.com>
Thu, 3 Mar 2016 20:16:07 +0000 (20:16 +0000)
commitfbb7097b1daba6502b8b25efccafe4319cc5d7e8
tree6ed3203fddc7cc85aa8ca57faa21d99a97ac0980
parent0813c72b1fe8880f319a8259e1f0b3efff80fa32
 Bug 12426: Allow resend for sent messages

This patch allows to resend both sent and failed messages.

With messages in 'sent' status, we have to be careful not to accidentally send
sent messages again. With the previous patch using GET request, this was likely
to happen because of browser storing the GET parameters.

This patch changes request method from GET to POST. Instead of a simple link,
we now have a form element.

In notices.pl we redirect back to notices.pl, because with POST there is a risk
of resending the message accidentally by form resubmission at refresh.

To test, find/create a Patron that has sent or failed notices in message_queue:
1. Enable EnchancedMessagingPreferences system preference
2. Go to Patrons -> Notices
3. In the Notice column, click the title of the sent or failed message
4. Observe that there is nothing for resending the sent or failed message
5. Apply the patches.
6. Reload Notices page and repeat step 3
7. Observe that there is now a link "Resend" in the Status-column
8. Click Resend
9. Observe that the message gets into 'pending' status

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
C4/Letters.pm
koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt
members/notices.pl