Bug 11274 Sent Notices Tab Not Working Correctly
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / notices.tt
1 [% USE Koha %]
2 [% USE AuthorisedValues %]
3 [% USE Branches %]
4 [% USE KohaDates %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Sent notices for [% INCLUDE 'patron-title.inc' %]</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
9 [% INCLUDE 'datatables.inc' %]
10 <script type="text/javascript">
11 //<![CDATA[
12     $(document).ready(function() {
13     $("#noticestable").dataTable($.extend(true, {}, dataTablesDefaults, {
14         "aaSorting": [[ 3, "desc" ]],
15         "aoColumns": [ null,null,null,{ "sType": "title-string" } ],
16         "sPaginationType": "four_button"
17     }));
18
19         $("#noticestable").on("click", ".notice-title", function(e){
20             e.preventDefault();
21             var rowid = $(this).data("noticeid");
22             $("#notice"+rowid).toggle();
23         });
24
25     });
26 //]]>
27 </script>
28 <style type="text/css">
29     .notice { display: none; }
30     .notice-title { font-weight: bold; display: block; }
31 </style>
32 </head>
33 <body id="pat_notices" class="pat">
34 [% INCLUDE 'header.inc' %]
35 [% INCLUDE 'patron-search.inc' %]
36
37 <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>
38
39 <div id="doc3" class="yui-t2">
40     <div id="bd">
41     <div id="yui-main">
42     <div class="yui-b">
43 [% INCLUDE 'members-toolbar.inc' %]
44 <h1>Sent notices for [% INCLUDE 'patron-title.inc' %]</h1>
45
46 [% IF ( QUEUED_MESSAGES ) %]
47     <table id="noticestable">
48         <thead>
49             <tr>
50                 <th>Notice</th>
51                 <th>Type</th>
52                 <th>Status</th>
53                 <th>Time</th>
54             </tr>
55         </thead>
56         <tbody>
57             [% FOREACH QUEUED_MESSAGE IN QUEUED_MESSAGES %]
58             <tr>
59                 <td>
60             <a class="notice-title" data-noticeid="[% QUEUED_MESSAGE.message_id %]" href="#">[% QUEUED_MESSAGE.subject %]</a>
61             <div id="notice[% QUEUED_MESSAGE.message_id %]" class="notice">
62                 [% QUEUED_MESSAGE.content FILTER html_line_break %]
63             </div>
64         </td>
65                 <td>
66             [% IF ( QUEUED_MESSAGE.message_transport_type == 'email' ) %]email
67             [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'print' ) %]print
68             [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'feed' ) %]feed
69             [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'sms' ) %]sms
70             [% ELSE %][% QUEUED_MESSAGE.message_transport_type %][% END %]
71         </td>
72                 <td>
73             [% IF ( QUEUED_MESSAGE.status == 'sent' ) %]sent
74             [% ELSIF ( QUEUED_MESSAGE.status == 'pending' ) %]pending
75             [% ELSIF ( QUEUED_MESSAGE.status == 'failed' ) %]failed
76             [% ELSIF ( QUEUED_MESSAGE.status == 'deleted' ) %]deleted
77             [% ELSE %][% QUEUED_MESSAGE.status %][% END %]
78             [% IF ( QUEUED_MESSAGE.status != 'pending' ) %]
79             <div class="notice">
80                 <form action="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber %]" method="POST">
81                     <input type="hidden" name="op" value="resend_notice" />
82                     <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
83                     <input type="hidden" name="message_id" value="[% QUEUED_MESSAGE.message_id %]" />
84                     <fieldset class="action">
85                         <button class="btn btn-mini" type="submit">Resend</button>
86                     </fieldset>
87                 </form>
88             </div>
89             [% END %]
90         </td>
91         <td><span title="[% QUEUED_MESSAGE.time_queued %]">[% QUEUED_MESSAGE.time_queued | $KohaDates with_hours => 1 %]</span></td>
92             </tr>
93             [% END %]
94         </tbody>
95     </table>
96 [% ELSE %]
97     <div class="dialog message">There is no record of any messages that have been sent to this patron.</div>
98 [% END %]
99
100 </div>
101 </div>
102
103 <div class="yui-b">
104 [% INCLUDE 'circ-menu.inc' %]
105 </div>
106 </div>
107 [% INCLUDE 'intranet-bottom.inc' %]