Bug 20538: Remove the need of writing [% KOHA_VERSION %] everywhere
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / patron_lists / lists.tt
blobf2cd32df5c503078918bf49a74d667c60f2ee039
1 [% USE Asset %]
2 [% SET footerjs = 1 %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha &rsaquo; Tools &rsaquo; Patron lists</title>
5 [% INCLUDE 'doc-head-close.inc' %]
6 [% INCLUDE 'greybox.inc' %]
7 [% Asset.css("css/datatables.css") %]
8 </head>
10 <body id="patlist_lists" class="pat patlist">
11 [% INCLUDE 'header.inc' %]
12 [% INCLUDE 'cat-search.inc' %]
13 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; Patron lists</div>
15 <div id="doc3" class="yui-t2">
16    <div id="bd">
17     <div id="yui-main">
18         <div class="yui-b">
20         <div id="toolbar" class="btn-toolbar">
21             <div class="btn-group">
22                 <a class="btn btn-default btn-sm" href="add-modify.pl"><i class="fa fa-plus"></i> New patron list</a>
23             </div>
24         </div>
26         <h1>Your patron lists</h1>
28         [% IF ( lists ) %]
30         <table id="patron-lists-table">
31             <thead>
32                 <tr>
33                     <th>Name</th>
34                     <th>Patrons in list</th>
35                     <th class="NoSort">&nbsp;</th>
36                 </tr>
37             </thead>
39             <tbody>
40                 [% FOREACH l IN lists %]
41                     <tr>
42                         <td><a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% l.patron_list_id %]">[% l.name |html%]</a></td>
43                         <td>[% l.patron_list_patrons_rs.count || 0 %]</td>
44                         <td>
45                             <div class="dropdown">
46                                 <a class="btn btn-default btn-xs dropdown-toggle" id="listactions[% l.patron_list_id %]" role="button" data-toggle="dropdown" href="#">
47                                    Actions <b class="caret"></b>
48                                 </a>
49                                 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="listactions[% l.patron_list_id %]">
50                                     <li><a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% l.patron_list_id %]"><i class="fa fa-user"></i> Add patrons</a></li>
51                                     <li><a href="/cgi-bin/koha/patron_lists/add-modify.pl?patron_list_id=[% l.patron_list_id %]"><i class="fa fa-pencil"></i> Edit list</a></li>
52                                     <li><a class="delete_patron" href="/cgi-bin/koha/patron_lists/delete.pl?patron_list_id=[% l.patron_list_id %]" data-list-name="[% l.name %]"><i class="fa fa-trash"></i> Delete list</a></li>
53                                     [% IF ( l.patron_list_patrons_rs.count ) %]
54                                         <li class="divider"></li>
55                                         <li>
56                                             <a class="print_cards" href="/cgi-bin/koha/patroncards/print.pl?patronlist_id=[% l.patron_list_id %]" data-patron_list_id="[% l.patron_list_id %]"><i class="fa fa-print"></i> Print patron cards</a>
57                                         </li>
58                                         [% IF CAN_user_tools_edit_patrons %]
59                                             <li>
60                                                 <a href="/cgi-bin/koha/tools/modborrowers.pl?patron_list_id=[% l.patron_list_id %]&op=show">
61                                                     <i class="fa fa-pencil"></i> Batch edit patrons
62                                                 </a>
63                                             </li>
64                                         [% END %]
65                                         [% IF CAN_user_tools_delete_anonymize_patrons %]
66                                             <li>
67                                                 <a href="/cgi-bin/koha/tools/cleanborrowers.pl?step=2&patron_list_id=[% l.patron_list_id %]&checkbox=borrower">
68                                                     <i class="fa fa-trash"></i> Batch delete patrons
69                                                 </a>
70                                             </li>
71                                         [% END %]
72                                     [% END %]
73                                 </ul>
74                             </div>
75                         </td>
76                     </tr>
77                 [% END %]
78             </tbody>
79         </table>
81             <!-- Modal to print patron cards -->
82             <div class="modal" id="patronExportModal" tabindex="-1" role="dialog" aria-labelledby="patronExportModal_label" aria-hidden="true">
83                 <div class="modal-dialog">
84                 <div class="modal-content">
85                 <div class="modal-header">
86                     <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">&times;</button>
87                     <h3 id="patronExportModal_label">Print patron cards</h3>
88                 </div>
89                 <div class="modal-body">
90                     <div id="loading"> <img src="[% interface %]/[% theme %]/img/spinner-small.gif" alt="" /> Loading </div>
91                 </div>
92                 </div>
93                 </div>
94             </div>
96         [% ELSE %]
97            <div class="dialog message">There are no patron lists.</div>
98         [% END %]
100             </div>
101         </div>
102         <div class="yui-b noprint">
103             [% INCLUDE 'tools-menu.inc' %]
104         </div>
105     </div>
107 [% MACRO jsinclude BLOCK %]
108     [% Asset.js("js/tools-menu.js") %]
109     [% INCLUDE 'datatables.inc' %]
111     <script type="text/javascript">
112         $(document).ready(function() {
113             var patronExportModal = $("#patronExportModal");
114             var patronExportModalBody = $("#patronExportModal .modal-body")
116             $('#patron-lists-table').dataTable($.extend(true, {}, dataTablesDefaults, {
117                 "autoWidth": false,
118                 "aoColumnDefs": [
119                     { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }
120                 ],
121                 "sPaginationType": "four_button"
122             } ));
123             $(".delete_patron").on("click", function(){
124                 $(".dropdown").removeClass("open");
125                 var list = $(this).data("list-name");
126                 return confirmDelete( _("Are you sure you want to delete the list %s?").format(list) );
127             });
129             $(".print_cards").on("click", function(e){
130                 e.preventDefault();
131                 var page = $(this).attr("href");
132                 patronExportModalBody.load(page + " #exportingf");
133                 patronExportModal.modal("show");
134             });
136             patronExportModal.on("hidden", function(){
137                 patronExportModalBody.html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
138             });
140             patronExportModal.on("submit", "#exportingf", function(e){
141                 e.preventDefault();
142                 modal_body = patronExportModalBody;
143                 modal_body.html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
144                 target_url = $(this).attr("action");
145                 params =  $( this ).serialize();
146                 modal_body.load( target_url + "?" + params + " #custom-doc");
147             });
149             patronExportModal.on("click",".closebtn,.gb-close",function(e){
150                 e.preventDefault();
151                 patronExportModal.modal("hide");
152             });
154         });
155     </script>
156 [% END %]
158 [% INCLUDE 'intranet-bottom.inc' %]