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

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

Return to bug 12426