Lines 45-112
Link Here
|
45 |
<h1>Sent notices for [% INCLUDE 'patron-title.inc' %]</h1> |
45 |
<h1>Sent notices for [% INCLUDE 'patron-title.inc' %]</h1> |
46 |
|
46 |
|
47 |
[% IF ( QUEUED_MESSAGES ) %] |
47 |
[% IF ( QUEUED_MESSAGES ) %] |
48 |
<table id="noticestable"> |
48 |
<div class="page-section"> |
49 |
<thead> |
49 |
<table id="noticestable"> |
50 |
<tr> |
50 |
<thead> |
51 |
<th>Notice</th> |
|
|
52 |
<th>Type</th> |
53 |
<th>Status</th> |
54 |
<th>Updated on</th> |
55 |
<th>Time created</th> |
56 |
<th>Delivery note</th> |
57 |
</tr> |
58 |
</thead> |
59 |
<tbody> |
60 |
[% FOREACH QUEUED_MESSAGE IN QUEUED_MESSAGES %] |
61 |
<tr> |
51 |
<tr> |
62 |
<td> |
52 |
<th>Notice</th> |
63 |
<a class="notice-title" data-noticeid="[% QUEUED_MESSAGE.message_id | html %]" href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber | uri %]&noticeid=[% QUEUED_MESSAGE.message_id | uri %]">[% QUEUED_MESSAGE.subject | html %]</a> |
53 |
<th>Type</th> |
64 |
<iframe class="notice" id="notice[% QUEUED_MESSAGE.message_id | html %]" srcdoc="[% QUEUED_MESSAGE.content | html | html_line_break %]"></iframe> |
54 |
<th>Status</th> |
65 |
</td> |
55 |
<th>Updated on</th> |
66 |
<td> |
56 |
<th>Time created</th> |
67 |
[% IF ( QUEUED_MESSAGE.message_transport_type == 'email' ) %]<span>email</span> |
57 |
<th>Delivery note</th> |
68 |
[% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'print' ) %]<span>print</span> |
|
|
69 |
[% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'feed' ) %]<span>feed</span> |
70 |
[% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'sms' ) %]<span>sms</span> |
71 |
[% ELSE %][% QUEUED_MESSAGE.message_transport_type | html %][% END %] |
72 |
</td> |
73 |
<td> |
74 |
[% IF ( QUEUED_MESSAGE.status == 'sent' ) %]<span>sent</span> |
75 |
[% ELSIF ( QUEUED_MESSAGE.status == 'pending' ) %]<span>pending</span> |
76 |
[% ELSIF ( QUEUED_MESSAGE.status == 'failed' ) %]<span>failed</span> |
77 |
[% ELSIF ( QUEUED_MESSAGE.status == 'deleted' ) %]<span>deleted</span> |
78 |
[% ELSE %][% QUEUED_MESSAGE.status | html %][% END %] |
79 |
[% IF ( QUEUED_MESSAGE.status != 'pending' ) %] |
80 |
<div class="notice"> |
81 |
<form id="resend_notice[% QUEUED_MESSAGE.message_id | html %]" action="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber | html %]" method="POST"> |
82 |
<input type="hidden" name="op" value="resend_notice" /> |
83 |
<input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" /> |
84 |
<input type="hidden" name="message_id" value="[% QUEUED_MESSAGE.message_id | html %]" /> |
85 |
</form> |
86 |
</div> |
87 |
[% END %] |
88 |
</td> |
89 |
<td data-order="[% QUEUED_MESSAGE.updated_on | html %]">[% QUEUED_MESSAGE.updated_on | $KohaDates with_hours => 1 %]</td> |
90 |
<td data-order="[% QUEUED_MESSAGE.time_queued | html %]">[% QUEUED_MESSAGE.time_queued | $KohaDates with_hours => 1 %]</td> |
91 |
<td> |
92 |
[% IF ( QUEUED_MESSAGE.failure_code ) %] |
93 |
[% IF ( QUEUED_MESSAGE.failure_code == "INVALID_BORNUMBER" ) %]<span>Invalid borrowernumber [% borrowernumber | html %]</span> |
94 |
[% ELSIF ( QUEUED_MESSAGE.failure_code == 'NO_EMAIL' ) %]<span>Unable to find an email address for this borrower</span> |
95 |
[% ELSIF (matches = QUEUED_MESSAGE.failure_code.match('INVALID_EMAIL:(\w+)') ) %]<span>Invalid [% matches.0 | html %] email address found [% borrowernumber | html %]</span> |
96 |
[% ELSIF ( QUEUED_MESSAGE.failure_code == 'NO_FROM' ) %]<span>Missing from email address</span> |
97 |
[% ELSIF ( QUEUED_MESSAGE.failure_code == 'MISSING_SMS' ) %]<span>Missing SMS number</span> |
98 |
[% ELSIF ( QUEUED_MESSAGE.failure_code == 'DUPLICATE_MESSAGE' ) %]<span>Message is duplicate</span> |
99 |
[% ELSIF ( QUEUED_MESSAGE.failure_code == 'NO_NOTES' ) %]<span>No notes from SMS driver</span> |
100 |
[% ELSIF ( QUEUED_MESSAGE.failure_code == 'SENDMAIL' ) %]<span>Unhandled email failure, check the logs for further details</span> |
101 |
[% ELSIF ( QUEUED_MESSAGE.failure_code == "UNKNOWN_ERROR" ) %]<span>Unknown error</span> |
102 |
[% ELSE %]<span>Error occurred while sending email.</span> |
103 |
[% END %] |
104 |
[% END %] |
105 |
</td> |
106 |
</tr> |
58 |
</tr> |
107 |
[% END %] |
59 |
</thead> |
108 |
</tbody> |
60 |
<tbody> |
109 |
</table> |
61 |
[% FOREACH QUEUED_MESSAGE IN QUEUED_MESSAGES %] |
|
|
62 |
<tr> |
63 |
<td> |
64 |
<a class="notice-title" data-noticeid="[% QUEUED_MESSAGE.message_id | html %]" href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber | uri %]&noticeid=[% QUEUED_MESSAGE.message_id | uri %]">[% QUEUED_MESSAGE.subject | html %]</a> |
65 |
<iframe class="notice" id="notice[% QUEUED_MESSAGE.message_id | html %]" srcdoc="[% QUEUED_MESSAGE.content | html | html_line_break %]"></iframe> |
66 |
</td> |
67 |
<td> |
68 |
[% IF ( QUEUED_MESSAGE.message_transport_type == 'email' ) %]<span>email</span> |
69 |
[% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'print' ) %]<span>print</span> |
70 |
[% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'feed' ) %]<span>feed</span> |
71 |
[% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'sms' ) %]<span>sms</span> |
72 |
[% ELSE %][% QUEUED_MESSAGE.message_transport_type | html %][% END %] |
73 |
</td> |
74 |
<td> |
75 |
[% IF ( QUEUED_MESSAGE.status == 'sent' ) %]<span>sent</span> |
76 |
[% ELSIF ( QUEUED_MESSAGE.status == 'pending' ) %]<span>pending</span> |
77 |
[% ELSIF ( QUEUED_MESSAGE.status == 'failed' ) %]<span>failed</span> |
78 |
[% ELSIF ( QUEUED_MESSAGE.status == 'deleted' ) %]<span>deleted</span> |
79 |
[% ELSE %][% QUEUED_MESSAGE.status | html %][% END %] |
80 |
[% IF ( QUEUED_MESSAGE.status != 'pending' ) %] |
81 |
<div class="notice"> |
82 |
<form id="resend_notice[% QUEUED_MESSAGE.message_id | html %]" action="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber | html %]" method="POST"> |
83 |
<input type="hidden" name="op" value="resend_notice" /> |
84 |
<input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" /> |
85 |
<input type="hidden" name="message_id" value="[% QUEUED_MESSAGE.message_id | html %]" /> |
86 |
</form> |
87 |
</div> |
88 |
[% END %] |
89 |
</td> |
90 |
<td data-order="[% QUEUED_MESSAGE.updated_on | html %]">[% QUEUED_MESSAGE.updated_on | $KohaDates with_hours => 1 %]</td> |
91 |
<td data-order="[% QUEUED_MESSAGE.time_queued | html %]">[% QUEUED_MESSAGE.time_queued | $KohaDates with_hours => 1 %]</td> |
92 |
<td> |
93 |
[% IF ( QUEUED_MESSAGE.failure_code ) %] |
94 |
[% IF ( QUEUED_MESSAGE.failure_code == "INVALID_BORNUMBER" ) %]<span>Invalid borrowernumber [% borrowernumber | html %]</span> |
95 |
[% ELSIF ( QUEUED_MESSAGE.failure_code == 'NO_EMAIL' ) %]<span>Unable to find an email address for this borrower</span> |
96 |
[% ELSIF (matches = QUEUED_MESSAGE.failure_code.match('INVALID_EMAIL:(\w+)') ) %]<span>Invalid [% matches.0 | html %] email address found [% borrowernumber | html %]</span> |
97 |
[% ELSIF ( QUEUED_MESSAGE.failure_code == 'NO_FROM' ) %]<span>Missing from email address</span> |
98 |
[% ELSIF ( QUEUED_MESSAGE.failure_code == 'MISSING_SMS' ) %]<span>Missing SMS number</span> |
99 |
[% ELSIF ( QUEUED_MESSAGE.failure_code == 'DUPLICATE_MESSAGE' ) %]<span>Message is duplicate</span> |
100 |
[% ELSIF ( QUEUED_MESSAGE.failure_code == 'NO_NOTES' ) %]<span>No notes from SMS driver</span> |
101 |
[% ELSIF ( QUEUED_MESSAGE.failure_code == 'SENDMAIL' ) %]<span>Unhandled email failure, check the logs for further details</span> |
102 |
[% ELSIF ( QUEUED_MESSAGE.failure_code == "UNKNOWN_ERROR" ) %]<span>Unknown error</span> |
103 |
[% ELSE %]<span>Error occurred while sending email.</span> |
104 |
[% END %] |
105 |
[% END %] |
106 |
</td> |
107 |
</tr> |
108 |
[% END %] |
109 |
</tbody> |
110 |
</table> |
111 |
</div> <!-- /.page-section --> |
110 |
[% ELSE %] |
112 |
[% ELSE %] |
111 |
<div class="dialog message">There is no record of any messages that have been sent to this patron.</div> |
113 |
<div class="dialog message">There is no record of any messages that have been sent to this patron.</div> |
112 |
[% END %] |
114 |
[% END %] |