Bug 21947: Address other misordered FILTER lines
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / notices.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE AuthorisedValues %]
5 [% USE Branches %]
6 [% USE KohaDates %]
7 [% SET footerjs = 1 %]
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' %]
11 [% Asset.css("css/datatables.css") | $raw %]
12 <style type="text/css">
13     .notice { display: none; }
14     .notice-title { font-weight: bold; display: block; }
15 </style>
16 </head>
17
18 <body id="pat_notices" class="pat">
19 [% INCLUDE 'header.inc' %]
20 [% INCLUDE 'patron-search.inc' %]
21
22 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; Sent notices for [% INCLUDE 'patron-title.inc' %]</div>
23
24 <div id="doc3" class="yui-t2">
25     <div id="bd">
26     <div id="yui-main">
27     <div class="yui-b">
28 [% INCLUDE 'members-toolbar.inc' %]
29 <h1>Sent notices for [% INCLUDE 'patron-title.inc' %]</h1>
30
31 [% IF ( QUEUED_MESSAGES ) %]
32     <table id="noticestable">
33         <thead>
34             <tr>
35                 <th>Notice</th>
36                 <th>Type</th>
37                 <th>Status</th>
38                 <th>Time</th>
39             </tr>
40         </thead>
41         <tbody>
42             [% FOREACH QUEUED_MESSAGE IN QUEUED_MESSAGES %]
43             <tr>
44                 <td>
45             <a class="notice-title" data-noticeid="[% QUEUED_MESSAGE.message_id | html %]" href="#">[% QUEUED_MESSAGE.subject | html %]</a>
46             <div id="notice[% QUEUED_MESSAGE.message_id | html %]" class="notice">
47                 <iframe srcdoc="[% QUEUED_MESSAGE.content | html | html_line_break %]"></iframe>
48             </div>
49         </td>
50                 <td>
51             [% IF ( QUEUED_MESSAGE.message_transport_type == 'email' ) %]email
52             [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'print' ) %]print
53             [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'feed' ) %]feed
54             [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'sms' ) %]sms
55             [% ELSE %][% QUEUED_MESSAGE.message_transport_type | html %][% END %]
56         </td>
57                 <td>
58             [% IF ( QUEUED_MESSAGE.status == 'sent' ) %]sent
59             [% ELSIF ( QUEUED_MESSAGE.status == 'pending' ) %]pending
60             [% ELSIF ( QUEUED_MESSAGE.status == 'failed' ) %]failed
61             [% ELSIF ( QUEUED_MESSAGE.status == 'deleted' ) %]deleted
62             [% ELSE %][% QUEUED_MESSAGE.status | html %][% END %]
63             [% IF ( QUEUED_MESSAGE.status != 'pending' ) %]
64             <div id="resend_notice[% QUEUED_MESSAGE.message_id | html %]"  class="notice">
65                 <form action="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber | html %]" method="POST">
66                     <input type="hidden" name="op" value="resend_notice" />
67                     <input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" />
68                     <input type="hidden" name="message_id" value="[% QUEUED_MESSAGE.message_id | html %]" />
69                     <fieldset class="action">
70                         <button class="btn btn-default btn-xs" type="submit">Resend</button>
71                     </fieldset>
72                 </form>
73             </div>
74             [% END %]
75         </td>
76         <td><span title="[% QUEUED_MESSAGE.time_queued | html %]">[% QUEUED_MESSAGE.time_queued | $KohaDates with_hours => 1 | html %]</span></td>
77             </tr>
78             [% END %]
79         </tbody>
80     </table>
81 [% ELSE %]
82     <div class="dialog message">There is no record of any messages that have been sent to this patron.</div>
83 [% END %]
84
85 </div>
86 </div>
87
88 <div class="yui-b">
89 [% INCLUDE 'circ-menu.inc' %]
90 </div>
91 </div>
92
93 [% MACRO jsinclude BLOCK %]
94     [% INCLUDE 'datatables.inc' %]
95     <script type="text/javascript">
96
97         $(document).ready(function() {
98             $("#noticestable").dataTable($.extend(true, {}, dataTablesDefaults, {
99                 "aaSorting": [[ 3, "desc" ]],
100                 "aoColumns": [ null,null,null,{ "sType": "title-string" } ],
101                 "sPaginationType": "four_button"
102             }));
103
104             $("#noticestable").on("click", ".notice-title", function(e){
105                 e.preventDefault();
106                 var rowid = $(this).data("noticeid");
107                 $("#notice"+rowid).toggle();
108                 $("#resend_notice"+rowid).toggle();
109                 var iframe = $("#notice"+rowid).children('iframe');
110                 // Adding some padding to the height and width to remove scrollbars
111                 var height = iframe.get(0).contentWindow.document.body.scrollHeight + 25;
112                 var width = iframe.get(0).contentWindow.document.body.scrollWidth + 25;
113                 iframe.css({
114                     'width':  width + 'px',
115                     'height': height + 'px'
116                 });
117             });
118         });
119     </script>
120     [% INCLUDE 'str/members-menu.inc' %]
121     [% Asset.js("js/members-menu.js") | $raw %]
122 [% END %]
123
124 [% INCLUDE 'intranet-bottom.inc' %]