View | Details | Raw Unified | Return to bug 12426
Collapse All | Expand All

(-)a/C4/Letters.pm (-1 / +1 lines)
Lines 1096-1102 sub ResendMessage { Link Here
1096
1096
1097
    my $message = GetMessage( $message_id );
1097
    my $message = GetMessage( $message_id );
1098
    return unless $message;
1098
    return unless $message;
1099
    if ( $message->{status} eq 'failed' ) {
1099
    if ( $message->{status} ne 'pending' ) {
1100
        return ((C4::Letters::_set_message_status( {
1100
        return ((C4::Letters::_set_message_status( {
1101
                    message_id => $message_id,
1101
                    message_id => $message_id,
1102
                    status => 'pending',
1102
                    status => 'pending',
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt (-1 / +11 lines)
Lines 70-78 Link Here
70
		<td>
70
		<td>
71
            [% IF ( QUEUED_MESSAGE.status == 'sent' ) %]sent
71
            [% IF ( QUEUED_MESSAGE.status == 'sent' ) %]sent
72
            [% ELSIF ( QUEUED_MESSAGE.status == 'pending' ) %]pending
72
            [% ELSIF ( QUEUED_MESSAGE.status == 'pending' ) %]pending
73
            [% ELSIF ( QUEUED_MESSAGE.status == 'failed' ) %]failed <div class="notice"><a href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber %]&amp;op=resend_notice&amp;message_id=[% QUEUED_MESSAGE.message_id %]" title="Attempt to resend the notice">Resend</a></div>
73
            [% ELSIF ( QUEUED_MESSAGE.status == 'failed' ) %]failed
74
            [% ELSIF ( QUEUED_MESSAGE.status == 'deleted' ) %]deleted
74
            [% ELSIF ( QUEUED_MESSAGE.status == 'deleted' ) %]deleted
75
            [% ELSE %][% QUEUED_MESSAGE.status %][% END %]
75
            [% ELSE %][% QUEUED_MESSAGE.status %][% END %]
76
            [% IF ( QUEUED_MESSAGE.status != 'pending' ) %]
77
            <div class="notice">
78
                <form action="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber %]" method="POST">
79
                    <input type="hidden" name="op" value="resend_notice" />
80
                    <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
81
                    <input type="hidden" name="message_id" value="[% QUEUED_MESSAGE.message_id %]" />
82
                    <a href="#" onclick="$(this).closest('form').submit();return false;" title="Attempt to resend the notice">Resend</a>
83
                </form>
84
            </div>
85
            [% END %]
76
        </td>
86
        </td>
77
        <td><span title="[% QUEUED_MESSAGE.time_queued %]">[% QUEUED_MESSAGE.time_queued | $KohaDates with_hours => 1 %]</span></td>
87
        <td><span title="[% QUEUED_MESSAGE.time_queued %]">[% QUEUED_MESSAGE.time_queued | $KohaDates with_hours => 1 %]</span></td>
78
	    </tr>
88
	    </tr>
(-)a/members/notices.pl (-1 / +2 lines)
Lines 58-63 if ( $op eq 'resend_notice' ) { Link Here
58
    my $message = C4::Letters::GetMessage( $message_id );
58
    my $message = C4::Letters::GetMessage( $message_id );
59
    if ( $message->{borrowernumber} = $borrowernumber ) {
59
    if ( $message->{borrowernumber} = $borrowernumber ) {
60
        C4::Letters::ResendMessage( $message_id );
60
        C4::Letters::ResendMessage( $message_id );
61
        # redirect to self to avoid form submission on refresh
62
        print $input->redirect("/cgi-bin/koha/members/notices.pl?borrowernumber=$borrowernumber");
61
    }
63
    }
62
}
64
}
63
65
64
- 

Return to bug 12426