4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Patron lists › Tools › Koha</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% INCLUDE 'greybox.inc' %]
10 <body id="patlist_lists" class="pat patlist">
11 [% WRAPPER 'header.inc' %]
12 [% INCLUDE 'cat-search.inc' %]
15 [% WRAPPER 'sub-header.inc' %]
16 [% WRAPPER breadcrumbs %]
17 [% WRAPPER breadcrumb_item %]
18 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
20 [% WRAPPER breadcrumb_item bc_active= 1 %]
21 <span>Patron lists</span>
23 [% END #/ WRAPPER breadcrumbs %]
24 [% END #/ WRAPPER sub-header.inc %]
26 <div class="main container-fluid">
28 <div class="col-sm-10 col-sm-push-2">
31 <div id="toolbar" class="btn-toolbar">
32 <div class="btn-group">
33 <a class="btn btn-default" href="add-modify.pl"><i class="fa fa-plus"></i> New patron list</a>
37 <h1>Your patron lists</h1>
41 <div class="page-section">
42 <table id="patron-lists-table">
46 <th>Patrons in list</th>
48 <th class="NoSort"> </th>
53 [% FOREACH l IN lists %]
54 [% SET shared_by_other = l.owner.id != logged_in_user.id %]
56 <td><a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% l.patron_list_id | uri %]">[% l.name | html %]</a></td>
57 <td>[% l.patron_list_patrons_rs.count || 0 | html %]</td>
60 [% IF shared_by_other %]
61 by <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% l.owner.id | uri %]">[% INCLUDE 'patron-title.inc' patron=l.owner %]</a>
68 <div class="btn-group dropup">
69 <a class="btn btn-default btn-xs dropdown-toggle" id="listactions[% l.patron_list_id | html %]" role="button" data-toggle="dropdown" href="#">
70 Actions <b class="caret"></b>
72 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="listactions[% l.patron_list_id | html %]">
73 <li><a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% l.patron_list_id | uri %]"><i class="fa fa-user"></i> Add patrons</a></li>
74 [% UNLESS shared_by_other %]
75 <li><a href="/cgi-bin/koha/patron_lists/add-modify.pl?patron_list_id=[% l.patron_list_id | uri %]"><i class="fa fa-pencil-alt"></i> Edit list</a></li>
76 <li><a class="delete_patron" href="/cgi-bin/koha/patron_lists/delete.pl?patron_list_id=[% l.patron_list_id | html %]" data-list-name="[% l.name | html %]"><i class="fa fa-trash-can"></i> Delete list</a></li>
78 [% IF ( l.patron_list_patrons_rs.count ) %]
79 <li class="divider"></li>
81 <a class="print_cards" href="/cgi-bin/koha/patroncards/print.pl?patronlist_id=[% l.patron_list_id | html %]" data-patron_list_id="[% l.patron_list_id | html %]"><i class="fa fa-print"></i> Print patron cards</a>
83 [% IF CAN_user_tools_edit_patrons %]
85 <a href="/cgi-bin/koha/tools/modborrowers.pl?patron_list_id=[% l.patron_list_id | uri %]&op=show">
86 <i class="fa fa-pencil-alt"></i> Batch edit patrons
90 [% IF CAN_user_tools_delete_anonymize_patrons %]
92 <a href="/cgi-bin/koha/tools/cleanborrowers.pl?step=2&patron_list_id=[% l.patron_list_id | uri %]&checkbox=borrower">
93 <i class="fa fa-trash-can"></i> Batch delete patrons
105 </div> <!-- /.page-section -->
107 <!-- Modal to print patron cards -->
108 <div class="modal" id="patronExportModal" tabindex="-1" role="dialog" aria-labelledby="patronExportModal_label" aria-hidden="true">
109 <div class="modal-dialog">
110 <div class="modal-content">
111 <div class="modal-header">
112 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
113 <h3 id="patronExportModal_label">Print patron cards</h3>
115 <div class="modal-body">
116 <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
123 <div class="dialog message">There are no patron lists.</div>
127 </div> <!-- /.col-sm-10.col-sm-push-2 -->
129 <div class="col-sm-2 col-sm-pull-10">
131 [% INCLUDE 'tools-menu.inc' %]
133 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
134 </div> <!-- /.row -->
136 [% MACRO jsinclude BLOCK %]
137 [% Asset.js("js/tools-menu.js") | $raw %]
138 [% INCLUDE 'datatables.inc' %]
141 $(document).ready(function() {
142 var patronExportModal = $("#patronExportModal");
143 var patronExportModalBody = $("#patronExportModal .modal-body");
145 $('#patron-lists-table').dataTable($.extend(true, {}, dataTablesDefaults, {
148 { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }
150 "sPaginationType": "full"
152 $(".delete_patron").on("click", function(){
153 $(".dropdown").removeClass("open");
154 var list = $(this).data("list-name");
155 return confirmDelete( _("Are you sure you want to delete the list %s?").format(list) );
158 $(".print_cards").on("click", function(e){
160 var page = $(this).attr("href");
161 patronExportModalBody.load(page + " #exportingf");
162 patronExportModal.modal("show");
165 patronExportModal.on("hidden.bs.modal", function(){
166 patronExportModalBody.html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
169 patronExportModal.on("submit", "#exportingf", function(e){
171 modal_body = patronExportModalBody;
172 modal_body.html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
173 target_url = $(this).attr("action");
174 params = $( this ).serialize();
175 $("#patronExportModal .modal-body").load( target_url + "?" + params + " #export_patron_list");
178 patronExportModal.on("click",".closebtn,.gb-close",function(e){
180 patronExportModal.modal("hide");
187 [% INCLUDE 'intranet-bottom.inc' %]