5 [% USE AuthorisedValues %]
8 [% PROCESS 'i18n.inc' %]
10 [% INCLUDE 'doc-head-open.inc' %]
11 <title>[% FILTER collapse %]
12 [% t("Sent notices for") | html %] [% INCLUDE 'patron-title.inc' no_html = 1 %]
13 [% t("Patrons") | html %] ›
14 [% t("Koha") | html %]
16 [% INCLUDE 'doc-head-close.inc' %]
18 .notice { display: none; }
22 <body id="pat_notices" class="pat">
23 [% WRAPPER 'header.inc' %]
24 [% INCLUDE 'patron-search-header.inc' %]
27 [% WRAPPER 'sub-header.inc' %]
28 [% WRAPPER breadcrumbs %]
29 [% WRAPPER breadcrumb_item %]
30 <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
32 [% WRAPPER breadcrumb_item %]
33 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber | uri %]">
34 [% INCLUDE 'patron-title.inc' %]
37 [% WRAPPER breadcrumb_item bc_active= 1 %]
38 <span>Sent notices</span>
40 [% END #/ WRAPPER breadcrumbs %]
41 [% END #/ WRAPPER sub-header.inc %]
43 <div class="main container-fluid">
45 <div class="col-sm-10 col-sm-push-2">
48 [% INCLUDE 'members-toolbar.inc' %]
49 <h1>Sent notices for [% INCLUDE 'patron-title.inc' %]</h1>
51 [% IF ( QUEUED_MESSAGES ) %]
52 <div class="page-section">
53 <table id="noticestable">
61 <th>Delivery note</th>
65 [% FOREACH QUEUED_MESSAGE IN QUEUED_MESSAGES %]
68 <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>
69 [% IF QUEUED_MESSAGE.content_type.search('html') %]
70 <iframe class="notice" id="notice[% QUEUED_MESSAGE.message_id | html %]" srcdoc="[% QUEUED_MESSAGE.html_content | html %]"></iframe>
72 <iframe class="notice" id="notice[% QUEUED_MESSAGE.message_id | html %]" srcdoc="[% QUEUED_MESSAGE.content | html | html_line_break %]"></iframe>
76 [% IF ( QUEUED_MESSAGE.message_transport_type == 'email' ) %]<span>email</span>
77 [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'print' ) %]<span>print</span>
78 [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'feed' ) %]<span>feed</span>
79 [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'sms' ) %]<span>sms</span>
80 [% ELSE %][% QUEUED_MESSAGE.message_transport_type | html %][% END %]
83 [% IF ( QUEUED_MESSAGE.status == 'sent' ) %]<span>sent</span>
84 [% ELSIF ( QUEUED_MESSAGE.status == 'pending' ) %]<span>pending</span>
85 [% ELSIF ( QUEUED_MESSAGE.status == 'failed' ) %]<span>failed</span>
86 [% ELSIF ( QUEUED_MESSAGE.status == 'deleted' ) %]<span>deleted</span>
87 [% ELSE %][% QUEUED_MESSAGE.status | html %][% END %]
88 [% IF ( QUEUED_MESSAGE.status != 'pending' ) %]
90 <form id="resend_notice[% QUEUED_MESSAGE.message_id | html %]" action="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber | html %]" method="POST">
91 <input type="hidden" name="op" value="resend_notice" />
92 <input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" />
93 <input type="hidden" name="message_id" value="[% QUEUED_MESSAGE.message_id | html %]" />
98 <td data-order="[% QUEUED_MESSAGE.updated_on | html %]">[% QUEUED_MESSAGE.updated_on | $KohaDates with_hours => 1 %]</td>
99 <td data-order="[% QUEUED_MESSAGE.time_queued | html %]">[% QUEUED_MESSAGE.time_queued | $KohaDates with_hours => 1 %]</td>
101 [% IF ( QUEUED_MESSAGE.failure_code ) %]
102 [% IF ( QUEUED_MESSAGE.failure_code == "INVALID_BORNUMBER" ) %]<span>Invalid borrowernumber [% borrowernumber | html %]</span>
103 [% ELSIF ( QUEUED_MESSAGE.failure_code == 'NO_EMAIL' ) %]<span>Unable to find an email address for this borrower</span>
104 [% ELSIF (matches = QUEUED_MESSAGE.failure_code.match('INVALID_EMAIL:(\w+)') ) %]<span>Invalid [% matches.0 | html %] email address found [% borrowernumber | html %]</span>
105 [% ELSIF ( QUEUED_MESSAGE.failure_code == 'NO_FROM' ) %]<span>Missing from email address</span>
106 [% ELSIF ( QUEUED_MESSAGE.failure_code == 'MISSING_SMS' ) %]<span>Missing SMS number</span>
107 [% ELSIF ( QUEUED_MESSAGE.failure_code == 'DUPLICATE_MESSAGE' ) %]<span>Message is duplicate</span>
108 [% ELSIF ( QUEUED_MESSAGE.failure_code == 'NO_NOTES' ) %]<span>No notes from SMS driver</span>
109 [% ELSIF ( QUEUED_MESSAGE.failure_code == 'SENDMAIL' ) %]<span>Unhandled email failure, check the logs for further details</span>
110 [% ELSIF ( QUEUED_MESSAGE.failure_code == "UNKNOWN_ERROR" ) %]<span>Unknown error</span>
111 [% ELSE %]<span>Error occurred while sending email.</span>
114 [% IF ( QUEUED_MESSAGE.cc_address ) %]
115 <span>Notice copied to: [% QUEUED_MESSAGE.cc_address | html %]</span>
122 </div> <!-- /.page-section -->
124 <div class="dialog message">There is no record of any messages that have been sent to this patron.</div>
128 </div> <!-- /.col-sm-10.col-sm-push-2 -->
130 <div class="col-sm-2 col-sm-pull-10">
132 [% INCLUDE 'circ-menu.inc' %]
134 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
135 </div> <!-- /.row -->
138 <div class="modal" id="noticeModal" tabindex="-1" aria-labelledby="noticeModalLabel" aria-hidden="true">
139 <div class="modal-dialog">
140 <div class="modal-content">
141 <div class="modal-header">
142 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close">
143 <span aria-hidden="true">×</span>
145 <h5 class="modal-title" id="noticeModalLabel">Notice</h5>
147 <div class="modal-body">
150 <div class="modal-footer">
151 <button type="button" id="resend-notice" class="btn btn-default" style="display:none"><i class="fa-solid fa-rotate" aria-hidden="true"></i> Resend</button>
152 <button type="button" class="btn btn-default deny cancel" data-dismiss="modal"><i class="fa fa-times"></i> Close</button>
154 </div> <!-- /.modal-content -->
155 </div> <!-- /.modal-dialog -->
156 </div> <!-- /.modal -->
158 [% MACRO jsinclude BLOCK %]
159 [% INCLUDE 'datatables.inc' %]
161 $(document).ready(function() {
162 $("#noticestable").dataTable($.extend(true, {}, dataTablesDefaults, {
163 "aaSorting": [[ 3, "desc" ]],
164 "sPaginationType": "full"
167 $("#noticestable").on("click", ".notice-title", function(e){
169 var title = $(this).text();
170 var noticeid = $(this).data("noticeid");
171 var body = $("#notice" + noticeid ).attr("srcdoc");
172 if( $("#resend_notice" + noticeid ).length ){
173 $("#resend-notice").show();
175 $("#resend-notice").data("noticeid", noticeid );
176 $("#noticeModalLabel").text( title );
177 $("#noticeModal .modal-body").html( body );
178 $("#noticeModal").modal("show");
181 $("#resend-notice").on("click", function(e){
183 var noticeid = $(this).data("noticeid");
184 $("#resend_notice" + noticeid ).submit();
187 $("#noticeModal").on("hide.bs.modal", function(){
188 $("#resend-notice").removeData("noticeid").hide();
189 $("#noticeModalLabel").text("");
190 $("#noticeModal .modal-body").html("");
194 [% INCLUDE 'str/members-menu.inc' %]
195 [% Asset.js("js/members-menu.js") | $raw %]
198 [% INCLUDE 'intranet-bottom.inc' %]