4 [% USE AuthorisedValues %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>Sent notices for [% INCLUDE 'patron-title.inc' no_html = 1 %]</title>
10 [% INCLUDE 'doc-head-close.inc' %]
12 .notice { display: none; }
13 .notice-title { font-weight: bold; display: block; }
17 <body id="pat_notices" class="pat">
18 [% INCLUDE 'header.inc' %]
19 [% INCLUDE 'patron-search.inc' %]
21 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
24 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
27 <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
30 <a href="#" aria-current="page">
31 Sent notices for [% INCLUDE 'patron-title.inc' %]
37 <div class="main container-fluid">
39 <div class="col-sm-10 col-sm-push-2">
42 [% INCLUDE 'members-toolbar.inc' %]
43 <h1>Sent notices for [% INCLUDE 'patron-title.inc' %]</h1>
45 [% IF ( QUEUED_MESSAGES ) %]
46 <table id="noticestable">
54 <th>Delivery note</th>
58 [% FOREACH QUEUED_MESSAGE IN QUEUED_MESSAGES %]
61 <a class="notice-title" data-noticeid="[% QUEUED_MESSAGE.message_id | html %]" href="#">[% QUEUED_MESSAGE.subject | html %]</a>
62 <div id="notice[% QUEUED_MESSAGE.message_id | html %]" class="notice">
63 <iframe srcdoc="[% QUEUED_MESSAGE.content | html | html_line_break %]"></iframe>
67 [% IF ( QUEUED_MESSAGE.message_transport_type == 'email' ) %]email
68 [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'print' ) %]print
69 [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'feed' ) %]feed
70 [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'sms' ) %]sms
71 [% ELSE %][% QUEUED_MESSAGE.message_transport_type | html %][% END %]
74 [% IF ( QUEUED_MESSAGE.status == 'sent' ) %]sent
75 [% ELSIF ( QUEUED_MESSAGE.status == 'pending' ) %]pending
76 [% ELSIF ( QUEUED_MESSAGE.status == 'failed' ) %]failed
77 [% ELSIF ( QUEUED_MESSAGE.status == 'deleted' ) %]deleted
78 [% ELSE %][% QUEUED_MESSAGE.status | html %][% END %]
79 [% IF ( QUEUED_MESSAGE.status != 'pending' ) %]
80 <div id="resend_notice[% QUEUED_MESSAGE.message_id | html %]" class="notice">
81 <form 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 <fieldset class="action">
86 <button class="btn btn-default btn-xs" type="submit">Resend</button>
92 <td data-order="[% QUEUED_MESSAGE.updated_on | html %]">[% QUEUED_MESSAGE.updated_on | $KohaDates with_hours => 1 %]</td>
93 <td data-order="[% QUEUED_MESSAGE.time_queued | html %]">[% QUEUED_MESSAGE.time_queued | $KohaDates with_hours => 1 %]</td>
95 [% IF ( QUEUED_MESSAGE.error_code ) %]
96 [% IF ( QUEUED_MESSAGE.error_code == "INVALID_BORNUMBER" ) %]Invalid borrowernumber [% borrowernumber | html %]
97 [% ELSIF ( QUEUED_MESSAGE.error_code == 'NO_EMAIL' ) %]Unable to find an email address for this borrower
98 [% ELSIF ( QUEUED_MESSAGE.error_code == 'MISSING_SMS' ) %]Missing SMS number
99 [% ELSIF ( QUEUED_MESSAGE.error_code == 'DUPLICATE_MESSAGE' ) %]Message is duplicate
100 [% ELSIF ( QUEUED_MESSAGE.error_code == 'NO_NOTES' ) %]No notes from SMS driver
101 [% ELSE %]Error occured while sending email.
110 <div class="dialog message">There is no record of any messages that have been sent to this patron.</div>
114 </div> <!-- /.col-sm-10.col-sm-push-2 -->
116 <div class="col-sm-2 col-sm-pull-10">
118 [% INCLUDE 'circ-menu.inc' %]
120 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
121 </div> <!-- /.row -->
123 [% MACRO jsinclude BLOCK %]
124 [% INCLUDE 'datatables.inc' %]
126 $(document).ready(function() {
127 $("#noticestable").dataTable($.extend(true, {}, dataTablesDefaults, {
128 "aaSorting": [[ 3, "desc" ]],
129 "sPaginationType": "full"
132 $("#noticestable").on("click", ".notice-title", function(e){
134 var rowid = $(this).data("noticeid");
135 $("#notice"+rowid).toggle();
136 $("#resend_notice"+rowid).toggle();
137 var iframe = $("#notice"+rowid).children('iframe');
138 // Adding some padding to the height and width to remove scrollbars
139 var height = iframe.get(0).contentWindow.document.body.scrollHeight + 25;
140 var width = iframe.get(0).contentWindow.document.body.scrollWidth + 25;
142 'width': width + 'px',
143 'height': height + 'px'
148 [% INCLUDE 'str/members-menu.inc' %]
149 [% Asset.js("js/members-menu.js") | $raw %]
152 [% INCLUDE 'intranet-bottom.inc' %]