Bug 16372 - Replace the use of "onclick" for deletion confirmation in some templates
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / patron_lists / lists.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Tools &rsaquo; Patron lists</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 [% INCLUDE 'greybox.inc' %]
5 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
6 [% INCLUDE 'datatables.inc' %]
7
8 <script type="text/javascript">
9 //<![CDATA[
10     $(document).ready(function() {
11         $('#patron-lists-table').dataTable($.extend(true, {}, dataTablesDefaults, {
12             "autoWidth": false,
13             "aoColumnDefs": [
14                 { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }
15             ],
16             "sPaginationType": "four_button"
17         } ));
18         $(".delete_patron").on("click", function(){
19             $(".dropdown").removeClass("open");
20             var list = $(this).data("list-name");
21             return confirmDelete( _("Are you sure you want to delete the list %s?").format(list) );
22         });
23     });
24 //]]>
25 </script>
26
27 </head>
28
29 <body id="patlist_lists" class="pat patlist">
30 [% INCLUDE 'header.inc' %]
31 [% INCLUDE 'cat-search.inc' %]
32 <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>
33
34 <div id="doc3" class="yui-t2">
35    <div id="bd">
36     <div id="yui-main">
37         <div class="yui-b">
38
39         <div id="toolbar" class="btn-toolbar">
40             <div class="btn-group">
41                 <a class="btn btn-small" href="add-modify.pl"><i class="fa fa-plus"></i> New patron list</a>
42             </div>
43         </div>
44
45         <h1>Your patron lists</h1>
46
47         [% IF ( lists ) %]
48
49         <table id="patron-lists-table">
50             <thead>
51                 <tr>
52                     <th>Name</th>
53                     <th>Patrons in list</th>
54                     <th class="NoSort">&nbsp;</th>
55                 </tr>
56             </thead>
57
58             <tbody>
59                 [% FOREACH l IN lists %]
60                     <tr>
61                         <td>[% l.name %]</td>
62                         <td>[% l.patron_list_patrons_rs.count || 0 %]</td>
63                         <td>
64                             <div class="dropdown">
65                                 <a class="btn btn-mini dropdown-toggle" id="listactions[% l.patron_list_id %]" role="button" data-toggle="dropdown" href="#">
66                                    Actions <b class="caret"></b>
67                                 </a>
68                                 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="listactions[% l.patron_list_id %]">
69                                     <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>
70                                     <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>
71                                     <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>
72                                     [% IF ( l.patron_list_patrons_rs.count ) %]
73                                         <li class="divider"></li>
74                                         <li><a href="#" onclick='GB_showCenter(_("Print patron cards from list"), "/cgi-bin/koha/patroncards/print.pl?patronlist_id=[% l.patron_list_id %]", 400, 800);return false;'><i class="fa fa-print"></i> Print patron cards</a></li>
75                                         [% IF CAN_user_tools_edit_patrons %]
76                                             <li>
77                                                 <a href="/cgi-bin/koha/tools/modborrowers.pl?patron_list_id=[% l.patron_list_id %]&op=show">
78                                                     <i class="fa fa-pencil"></i> Batch edit patrons</i>
79                                                 </a>
80                                             </li>
81                                         [% END %]
82                                         [% IF CAN_user_tools_delete_anonymize_patrons %]
83                                             <li>
84                                                 <a href="/cgi-bin/koha/tools/cleanborrowers.pl?step=2&patron_list_id=[% l.patron_list_id %]&checkbox=borrower">
85                                                     <i class="fa fa-trash"></i> Batch delete patrons</i>
86                                                 </a>
87                                             </li>
88                                         [% END %]
89                                     [% END %]
90                                 </ul>
91                             </div>
92                         </td>
93                     </tr>
94                 [% END %]
95             </tbody>
96         </table>
97         [% ELSE %]
98            <div class="dialog message">There are no patron lists.</div>
99         [% END %]
100
101             </div>
102         </div>
103         <div class="yui-b noprint">
104             [% INCLUDE 'tools-menu.inc' %]
105         </div>
106     </div>
107 [% INCLUDE 'intranet-bottom.inc' %]