4 [% USE TablesSettings %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 [% INCLUDE 'columns_settings.inc' %]
8 <title>Add patrons › [% list.name | html %] › Patron lists › Tools › Koha</title>
9 [% INCLUDE 'doc-head-close.inc' %]
12 #add_patrons_by_search {
27 <body id="patlist_list" class="pat patlist">
28 [% WRAPPER 'header.inc' %]
29 [% INCLUDE 'cat-search.inc' %]
32 [% WRAPPER 'sub-header.inc' %]
33 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
36 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
39 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
42 <a href="lists.pl">Patron lists</a>
45 <a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% list.id | uri %]">[% list.name | html %]</a>
48 <a href="#" aria-current="page">
56 <div class="main container-fluid">
58 <div class="col-sm-10 col-sm-push-2">
61 <h1>[% list.name | html %]</h1>
63 [% IF ( not_found.size > 0 ) %]
64 [% IF id_column == 'borrowernumbers' %]
65 <div class="dialog alert"><p>Warning, the following borrowernumbers were not found:</p></div>
67 <div class="dialog alert"><p>Warning, the following cardnumbers were not found:</p></div>
69 <table style="margin:auto;">
71 [% IF id_column == 'borrowernumbers' %]
72 <tr><th>Borrowernumbers not found</th></tr>
74 <tr><th>Cardnumbers not found</th></tr>
78 [% FOREACH nf IN not_found %]
79 <tr><td>[% nf | html %]</td></td>
85 [% IF ( existed.size > 0 ) %]
86 [% IF id_column == 'borrowernumbers' %]
87 <div class="dialog alert"><p>Warning, the following borrowernumbers were already in this list:</p></div>
89 <div class="dialog alert"><p>Warning, the following cardnumbers were already in this list:</p></div>
91 <table style="margin:auto;">
93 [% IF id_column == 'borrowernumbers' %]
94 <tr><th>Borrowernumbers already in list</th></tr>
96 <tr><th>Cardnumbers already in list</th></tr>
100 [% FOREACH ed IN existed %]
101 <tr><td>[% ed | html %]</td></td>
107 <form action="list.pl" id="add_patrons" method="post" class="clearfix">
108 <fieldset class="rows">
109 <legend>Add patrons</legend>
111 <li id="patron_search_line">
112 <label for="find_patron">Patron search: </label>
113 <input autocomplete="off" id="find_patron" type="text" style="width:150px" class="noEnterSubmit" />
115 <li id="add_patrons_by_search"><a href="#">
116 <span class="label"> </span>
117 <i class="fa fa-plus"></i> Search for patrons</a></li>
118 <li id="add_patrons_by_id"><a href="#">
119 <span class="label"> </span>
120 <i class="fa fa-plus"></i> Add multiple patrons</a></li>
121 <span id="patron_ids_line">
122 <li><strong>Choose type of IDs to enter:</strong></li>
124 <label class="id_choice" for="add_by_cardnumbers">
125 <input id="add_by_cardnumbers" type="radio" name="id_column" value="cardnumbers" checked="checked">
126 <span class="add_by_cardnumbers">Cardnumbers</span>
128 <label class="id_choice" for="add_by_borrowernumbers">
129 <input id="add_by_borrwernumbers" type="radio" name="id_column" value="borrowernumbers">
130 <span class="add_by_borrowernumbers">Borrowernumbers</span>
134 <label for="patrons_by_id">List (one ID per line):</label>
135 <textarea id="patrons_by_id" name="patrons_by_id" id="" cols="30" rows="10"></textarea>
140 <fieldset id="patron_ids_submit" class="action">
141 <input type="submit" value="Submit" />
144 <div class="clearfix"></div>
146 <fieldset id="patrons_to_add_fieldset">
147 <legend>Patrons to be added</legend>
148 <div id="patrons_to_add"></div>
150 <fieldset class="action">
151 <input type="hidden" name="patron_list_id" value="[% list.patron_list_id | html %]" />
152 <input type="submit" value="Add patrons" />
153 <a href="lists.pl" class="cancel">Cancel</a>
158 <form action="list.pl" id="remove_patrons" method="post">
160 <div class="searchheader" id="searchheader">
161 <span class="checkall"><a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a></span> |
162 <span class="clearall"><a id="CheckNone" href="#"><i class="fa fa-remove"></i> Clear all</a></span> |
163 <div class="btn-group">
164 <button class="btn btn-default btn-xs list-remove" type="submit"><i class="fa fa-trash"></i> Remove selected</button>
167 <div class="btn-group">
168 <button class="btn btn-default btn-xs merge-patrons"><i class="fa fa-compress"></i> Merge selected patrons</button>
172 <div class="page-section">
173 <table id="patron-list-table">
176 <th class="NoSort"> </th>
189 [% FOREACH p IN list.patron_list_patrons %]
192 <input type="checkbox" name="patrons_to_remove" class="selection" value="[% p.patron_list_patron_id | html %]" />
193 <input type="hidden" id="borrowernumber_[% p.patron_list_patron_id | html %]" value="[% p.borrowernumber.id | html %]" />
196 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% p.borrowernumber.borrowernumber | uri %]">
197 [% p.borrowernumber.cardnumber | html %]
200 <td>[% p.borrowernumber.firstname | html %]</td>
201 <td>[% p.borrowernumber.surname | html %]</td>
203 [% p.borrowernumber.address | html %]
204 [% p.borrowernumber.address2 | html %]
205 [% p.borrowernumber.city | html %]
206 [% p.borrowernumber.state | html %]
207 [% p.borrowernumber.country | html %]
209 <td>[% p.borrowernumber.categorycode.description | html %] ([% p.borrowernumber.categorycode.categorycode | html %])</td>
210 <td>[% p.borrowernumber.branchcode.branchname | html %]</td>
211 <td data-order="[% p.borrowernumber.dateexpiry | html %]">[% p.borrowernumber.dateexpiry | $KohaDates %]</td>
212 <td>[% p.borrowernumber.borrowernotes | html %]</td>
217 </div> <!-- /.page-section -->
219 <fieldset class="action">
220 <input type="hidden" name="patron_list_id" value="[% list.patron_list_id | html %]" />
221 <button type="submit" class="btn btn-default btn-sm list-remove"><i class="fa fa-trash" aria-hidden="true"></i> Remove selected patrons</button>
222 <button class="btn btn-default btn-sm merge-patrons" type="submit"><i class="fa fa-compress"></i> Merge selected patrons</button>
227 </div> <!-- /.col-sm-10.col-sm-push-2 -->
229 <div class="col-sm-2 col-sm-pull-10">
231 [% INCLUDE 'tools-menu.inc' %]
233 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
234 </div> <!-- /.row -->
236 [% MACRO jsinclude BLOCK %]
237 [% Asset.js("js/tools-menu.js") | $raw %]
238 [% INCLUDE 'datatables.inc' %]
240 [% Asset.js("js/autocomplete/patrons.js") | $raw %]
242 var MSG_REMOVE_PATRON = _("Remove");
243 $(document).ready(function() {
244 $('#patrons_to_add_fieldset').hide();
246 var table_settings = [% TablesSettings.GetTableSettings('members', 'patron-lists', 'patron-list-table', 'json') | $raw %]
247 KohaTable('patron-list-table', {
248 "sPaginationType": "full"
251 patron_autocomplete({
252 patron_container: $("#patrons_to_add"),
253 input_autocomplete: $("#find_patron"),
254 patron_input_name: 'patrons_to_add'
257 $("body").on("click", "#CheckAll", function(e){
259 $("input[type='checkbox']","#patron-list-table").each(function(){
260 $(this).prop("checked",1);
263 $("body").on("click", "#CheckNone", function(e){
265 $("input[type='checkbox']","#patron-list-table").each(function(){
266 $(this).prop("checked",0);
270 $("#remove_patrons").submit(function(){
271 var checkedItems = $("input:checked");
272 if ($(checkedItems).size() == 0) {
273 alert(_("You must select one or more patrons to remove"));
276 $(checkedItems).parents('tr').addClass("warn");
277 if( confirm(_("Are you sure you want to remove the selected patrons?")) ) {
280 $(checkedItems).parents('tr').removeClass("warn");
285 $("#add_patrons_by_id a").on("click", function(){
286 $("#add_patrons_by_id, #patron_search_line").hide();
287 $("#add_patrons_by_search, #patron_ids_line, #patron_ids_submit").show();
290 $("#add_patrons_by_search a").on("click", function(){
291 $("#add_patrons_by_id, #patron_search_line").show();
292 $("#add_patrons_by_search, #patron_ids_line, #patron_ids_submit").hide();
295 $('.merge-patrons').on('click', function() {
296 var checkedItems = $("input:checked");
297 if ($(checkedItems).length < 2) {
298 alert(_("You must select two or more patrons to merge"));
301 $(checkedItems).parents('tr').addClass("warn");
302 if (confirm(_("Are you sure you want to merge the selected patrons?"))) {
303 var merge_patrons_url = '/cgi-bin/koha/members/merge-patrons.pl?' +
304 $('.selection:checked')
306 return "id=" + $( '#borrowernumber_' + $(this).val() ).val()
309 window.location.href = merge_patrons_url;
312 $(checkedItems).parents('tr').removeClass("warn");
320 [% INCLUDE 'intranet-bottom.inc' %]