my $message = GetMessage( $message_id );
return unless $message;
- if ( $message->{status} eq 'failed' ) {
+ if ( $message->{status} ne 'pending' ) {
return ((C4::Letters::_set_message_status( {
message_id => $message_id,
status => 'pending',
<td>
[% IF ( QUEUED_MESSAGE.status == 'sent' ) %]sent
[% ELSIF ( QUEUED_MESSAGE.status == 'pending' ) %]pending
- [% ELSIF ( QUEUED_MESSAGE.status == 'failed' ) %]failed <div class="notice"><a href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber %]&op=resend_notice&message_id=[% QUEUED_MESSAGE.message_id %]" title="Attempt to resend the notice">Resend</a></div>
+ [% ELSIF ( QUEUED_MESSAGE.status == 'failed' ) %]failed
[% ELSIF ( QUEUED_MESSAGE.status == 'deleted' ) %]deleted
[% ELSE %][% QUEUED_MESSAGE.status %][% END %]
+ [% IF ( QUEUED_MESSAGE.status != 'pending' ) %]
+ <div class="notice">
+ <form action="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber %]" method="POST">
+ <input type="hidden" name="op" value="resend_notice" />
+ <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
+ <input type="hidden" name="message_id" value="[% QUEUED_MESSAGE.message_id %]" />
+ <a href="#" onclick="$(this).closest('form').submit();return false;" title="Attempt to resend the notice">Resend</a>
+ </form>
+ </div>
+ [% END %]
</td>
<td><span title="[% QUEUED_MESSAGE.time_queued %]">[% QUEUED_MESSAGE.time_queued | $KohaDates with_hours => 1 %]</span></td>
</tr>
my $message = C4::Letters::GetMessage( $message_id );
if ( $message->{borrowernumber} = $borrowernumber ) {
C4::Letters::ResendMessage( $message_id );
+ # redirect to self to avoid form submission on refresh
+ print $input->redirect("/cgi-bin/koha/members/notices.pl?borrowernumber=$borrowernumber");
}
}