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