4 [% USE AuthorisedValues %]
7 [% PROCESS 'i18n.inc' %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>[% FILTER collapse %]
11 [% t("Sent notices for") | html %] [% INCLUDE 'patron-title.inc' no_html = 1 %]
12 [% t("Patrons") | html %] ›
13 [% t("Koha") | html %]
15 [% INCLUDE 'doc-head-close.inc' %]
17 .notice { display: none; }
21 <body id="pat_notices" class="pat">
22 [% WRAPPER 'header.inc' %]
23 [% INCLUDE 'patron-search-header.inc' %]
26 [% WRAPPER 'sub-header.inc' %]
27 [% WRAPPER breadcrumbs %]
28 [% WRAPPER breadcrumb_item %]
29 <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
31 [% WRAPPER breadcrumb_item %]
32 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber | uri %]">
33 [% INCLUDE 'patron-title.inc' %]
36 [% WRAPPER breadcrumb_item bc_active= 1 %]
37 <span>Sent notices</span>
39 [% END #/ WRAPPER breadcrumbs %]
40 [% END #/ WRAPPER sub-header.inc %]
42 <div class="main container-fluid">
44 <div class="col-sm-10 col-sm-push-2">
47 [% INCLUDE 'members-toolbar.inc' %]
48 <h1>Sent notices for [% INCLUDE 'patron-title.inc' %]</h1>
50 [% IF ( QUEUED_MESSAGES ) %]
51 <div class="page-section">
52 <table id="noticestable">
60 <th>Delivery note</th>
64 [% FOREACH QUEUED_MESSAGE IN QUEUED_MESSAGES %]
67 <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>
68 <iframe class="notice" id="notice[% QUEUED_MESSAGE.message_id | html %]" srcdoc="[% QUEUED_MESSAGE.content | html | html_line_break %]"></iframe>
71 [% IF ( QUEUED_MESSAGE.message_transport_type == 'email' ) %]<span>email</span>
72 [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'print' ) %]<span>print</span>
73 [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'feed' ) %]<span>feed</span>
74 [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'sms' ) %]<span>sms</span>
75 [% ELSE %][% QUEUED_MESSAGE.message_transport_type | html %][% END %]
78 [% IF ( QUEUED_MESSAGE.status == 'sent' ) %]<span>sent</span>
79 [% ELSIF ( QUEUED_MESSAGE.status == 'pending' ) %]<span>pending</span>
80 [% ELSIF ( QUEUED_MESSAGE.status == 'failed' ) %]<span>failed</span>
81 [% ELSIF ( QUEUED_MESSAGE.status == 'deleted' ) %]<span>deleted</span>
82 [% ELSE %][% QUEUED_MESSAGE.status | html %][% END %]
83 [% IF ( QUEUED_MESSAGE.status != 'pending' ) %]
85 <form id="resend_notice[% QUEUED_MESSAGE.message_id | html %]" action="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber | html %]" method="POST">
86 <input type="hidden" name="op" value="resend_notice" />
87 <input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" />
88 <input type="hidden" name="message_id" value="[% QUEUED_MESSAGE.message_id | html %]" />
93 <td data-order="[% QUEUED_MESSAGE.updated_on | html %]">[% QUEUED_MESSAGE.updated_on | $KohaDates with_hours => 1 %]</td>
94 <td data-order="[% QUEUED_MESSAGE.time_queued | html %]">[% QUEUED_MESSAGE.time_queued | $KohaDates with_hours => 1 %]</td>
96 [% IF ( QUEUED_MESSAGE.failure_code ) %]
97 [% IF ( QUEUED_MESSAGE.failure_code == "INVALID_BORNUMBER" ) %]<span>Invalid borrowernumber [% borrowernumber | html %]</span>
98 [% ELSIF ( QUEUED_MESSAGE.failure_code == 'NO_EMAIL' ) %]<span>Unable to find an email address for this borrower</span>
99 [% ELSIF (matches = QUEUED_MESSAGE.failure_code.match('INVALID_EMAIL:(\w+)') ) %]<span>Invalid [% matches.0 | html %] email address found [% borrowernumber | html %]</span>
100 [% ELSIF ( QUEUED_MESSAGE.failure_code == 'NO_FROM' ) %]<span>Missing from email address</span>
101 [% ELSIF ( QUEUED_MESSAGE.failure_code == 'MISSING_SMS' ) %]<span>Missing SMS number</span>
102 [% ELSIF ( QUEUED_MESSAGE.failure_code == 'DUPLICATE_MESSAGE' ) %]<span>Message is duplicate</span>
103 [% ELSIF ( QUEUED_MESSAGE.failure_code == 'NO_NOTES' ) %]<span>No notes from SMS driver</span>
104 [% ELSIF ( QUEUED_MESSAGE.failure_code == 'SENDMAIL' ) %]<span>Unhandled email failure, check the logs for further details</span>
105 [% ELSIF ( QUEUED_MESSAGE.failure_code == "UNKNOWN_ERROR" ) %]<span>Unknown error</span>
106 [% ELSE %]<span>Error occurred while sending email.</span>
109 [% IF ( QUEUED_MESSAGE.cc_address ) %]
110 <span>Notice copied to: [% QUEUED_MESSAGE.cc_address | html %]</span>
117 </div> <!-- /.page-section -->
119 <div class="dialog message">There is no record of any messages that have been sent to this patron.</div>
123 </div> <!-- /.col-sm-10.col-sm-push-2 -->
125 <div class="col-sm-2 col-sm-pull-10">
127 [% INCLUDE 'circ-menu.inc' %]
129 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
130 </div> <!-- /.row -->
133 <div class="modal" id="noticeModal" tabindex="-1" aria-labelledby="noticeModalLabel" aria-hidden="true">
134 <div class="modal-dialog">
135 <div class="modal-content">
136 <div class="modal-header">
137 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close">
138 <span aria-hidden="true">×</span>
140 <h5 class="modal-title" id="noticeModalLabel">Notice</h5>
142 <div class="modal-body">
145 <div class="modal-footer">
146 <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>
147 <button type="button" class="btn btn-default deny cancel" data-dismiss="modal"><i class="fa fa-times"></i> Close</button>
149 </div> <!-- /.modal-content -->
150 </div> <!-- /.modal-dialog -->
151 </div> <!-- /.modal -->
153 [% MACRO jsinclude BLOCK %]
154 [% INCLUDE 'datatables.inc' %]
156 $(document).ready(function() {
157 $("#noticestable").dataTable($.extend(true, {}, dataTablesDefaults, {
158 "aaSorting": [[ 3, "desc" ]],
159 "sPaginationType": "full"
162 $("#noticestable").on("click", ".notice-title", function(e){
164 var title = $(this).text();
165 var noticeid = $(this).data("noticeid");
166 var body = $("#notice" + noticeid ).attr("srcdoc");
167 if( $("#resend_notice" + noticeid ).length ){
168 $("#resend-notice").show();
170 $("#resend-notice").data("noticeid", noticeid );
171 $("#noticeModalLabel").text( title );
172 $("#noticeModal .modal-body").html( body );
173 $("#noticeModal").modal("show");
176 $("#resend-notice").on("click", function(e){
178 var noticeid = $(this).data("noticeid");
179 $("#resend_notice" + noticeid ).submit();
182 $("#noticeModal").on("hide.bs.modal", function(){
183 $("#resend-notice").removeData("noticeid").hide();
184 $("#noticeModalLabel").text("");
185 $("#noticeModal .modal-body").html("");
189 [% INCLUDE 'str/members-menu.inc' %]
190 [% Asset.js("js/members-menu.js") | $raw %]
193 [% INCLUDE 'intranet-bottom.inc' %]