5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha › Tools › Patron lists › [% list.name | html %] › Add patrons</title>
7 [% INCLUDE 'doc-head-close.inc' %]
9 [% Asset.css("css/datatables.css") | $raw %]
10 <style type="text/css">
11 #add_patrons_by_search {
14 #patron_barcodes_line {
17 #patron_barcodes_submit {
26 <body id="patlist_list" class="pat patlist">
27 [% INCLUDE 'header.inc' %]
28 [% INCLUDE 'cat-search.inc' %]
29 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › <a href="lists.pl">Patron lists</a> › <a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% list.id | html %]">[% list.name | html %]</a> › Add patrons</div>
31 <div id="doc3" class="yui-t2">
35 <h1>[% list.name | html %]</h1>
37 [% IF ( not_found.size > 0 ) %]
38 <div class="dialog alert"><p>Warning, the following cardnumbers were not found:</p></div>
39 <table style="margin:auto;">
41 <tr><th>Cardnumbers not found</th></tr>
44 [% FOREACH nf IN not_found %]
45 <tr><td>[% nf | html %]</td></td>
51 [% IF ( existed.size > 0 ) %]
52 <div class="dialog alert"><p>Warning, the following cardnumbers were already in this list:</p></div>
53 <table style="margin:auto;">
55 <tr><th>Cardnumbers already in list</th></tr>
58 [% FOREACH ed IN existed %]
59 <tr><td>[% ed | html %]</td></td>
65 <form action="list.pl" id="add_patrons" method="post" class="clearfix">
66 <fieldset class="rows">
67 <legend>Add patrons</legend>
69 <li id="patron_search_line">
70 <label for="find_patron">Patron search: </label>
71 <input autocomplete="off" id="find_patron" type="text" style="width:150px" class="noEnterSubmit" />
73 <li id="add_patrons_by_search"><a href="#">
74 <span class="label"> </span>
75 <i class="fa fa-plus"></i> Search for patrons</a></li>
76 <li id="add_patrons_by_barcode"><a href="#">
77 <span class="label"> </span>
78 <i class="fa fa-plus"></i> Enter multiple card numbers</a></li>
79 <li id="patron_barcodes_line">
80 <label for="patrons_by_barcode">Card number list (one barcode per line):</label>
81 <textarea id="patrons_by_barcode" name="patrons_by_barcode" id="" cols="30" rows="10"></textarea>
85 <fieldset id="patron_barcodes_submit" class="action">
86 <input type="submit" value="Submit" />
89 <div class="clearfix"></div>
91 <fieldset id="patrons_to_add_fieldset">
92 <legend>Patrons to be added</legend>
93 <div id="patrons_to_add"></div>
95 <fieldset class="action">
96 <input type="hidden" name="patron_list_id" value="[% list.patron_list_id | html %]" />
97 <input type="submit" value="Add patrons" />
98 <a href="lists.pl" class="cancel">Cancel</a>
103 <form action="list.pl" id="remove_patrons" method="post">
105 <div id="searchheader">
106 <span class="checkall"><a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a></span> |
107 <span class="clearall"><a id="CheckNone" href="#"><i class="fa fa-remove"></i> Clear all</a></span> |
108 <div class="btn-group">
109 <button class="btn btn-default btn-xs list-remove" type="submit"><i class="fa fa-trash"></i> Remove selected</button>
112 <div class="btn-group">
113 <button class="btn btn-default btn-xs merge-patrons"><i class="fa fa-compress"></i> Merge selected patrons</button>
117 <table id="patron-list-table">
133 [% FOREACH p IN list.patron_list_patrons %]
136 <input type="checkbox" name="patrons_to_remove" class="selection" value="[% p.patron_list_patron_id | html %]" />
137 <input type="hidden" id="borrowernumber_[% p.patron_list_patron_id | html %]" value="[% p.borrowernumber.id | html %]" />
140 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% p.borrowernumber.borrowernumber | html %]">
141 [% p.borrowernumber.cardnumber | html %]
144 <td>[% p.borrowernumber.firstname | html %]</td>
145 <td>[% p.borrowernumber.surname | html %]</td>
147 [% p.borrowernumber.address | html %]
148 [% p.borrowernumber.address2 | html %]
149 [% p.borrowernumber.city | html %]
150 [% p.borrowernumber.state | html %]
151 [% p.borrowernumber.country | html %]
153 <td>[% p.borrowernumber.categorycode.description | html %] ([% p.borrowernumber.categorycode.categorycode | html %])</td>
154 <td>[% p.borrowernumber.branchcode.branchname | html %]</td>
155 <td><span title="[% p.borrowernumber.dateexpiry | html %]">[% p.borrowernumber.dateexpiry | $KohaDates %]</span></td>
156 <td>[% p.borrowernumber.borrowernotes | html %]</td>
162 <input type="hidden" name="patron_list_id" value="[% list.patron_list_id | html %]" />
163 <button type="submit" class="btn btn-default btn-sm list-remove"><i class="fa fa-trash" aria-hidden="true"></i> Remove selected patrons</button>
164 <button class="btn btn-default btn-sm merge-patrons" type="submit"><i class="fa fa-compress"></i> Merge selected patrons</button>
169 <div class="yui-b noprint">
170 [% INCLUDE 'tools-menu.inc' %]
174 [% MACRO jsinclude BLOCK %]
175 [% Asset.js("js/tools-menu.js") | $raw %]
176 [% INCLUDE 'datatables.inc' %]
178 [% Asset.js("js/autocomplete/patrons.js") | $raw %]
179 <script type="text/javascript">
180 var MSG_REMOVE_PATRON = _("Remove");
181 $(document).ready(function() {
182 $('#patrons_to_add_fieldset').hide();
184 $('#patron-list-table').dataTable($.extend(true, {}, dataTablesDefaults, {
185 "order": [[ 3, "asc" ]],
187 null,null,null,null,null,null,null,{ "sType": "title-string" },null
190 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
192 "sPaginationType": "four_button"
195 patron_autocomplete({
196 patron_container: $("#patrons_to_add"),
197 input_autocomplete: $("#find_patron"),
198 patron_input_name: 'patrons_to_add'
201 var checkBoxes = $("input[type='checkbox']","#patron-list-table");
203 $("#CheckAll").click(function(e){
205 checkBoxes.each(function(){
206 $(this).prop("checked",1);
209 $("#CheckNone").click(function(e){
211 checkBoxes.each(function(){
212 $(this).prop("checked",0);
216 $("#remove_patrons").submit(function(){
217 var checkedItems = $("input:checked");
218 if ($(checkedItems).size() == 0) {
219 alert(_("You must select one or more patrons to remove"));
222 $(checkedItems).parents('tr').addClass("warn");
223 if( confirm(_("Are you sure you want to remove the selected patrons?")) ) {
226 $(checkedItems).parents('tr').removeClass("warn");
231 $("#add_patrons_by_barcode a").on("click", function(){
232 $("#add_patrons_by_barcode, #patron_search_line").hide();
233 $("#add_patrons_by_search, #patron_barcodes_line, #patron_barcodes_submit").show();
236 $("#add_patrons_by_search a").on("click", function(){
237 $("#add_patrons_by_barcode, #patron_search_line").show();
238 $("#add_patrons_by_search, #patron_barcodes_line, #patron_barcodes_submit").hide();
241 $('.merge-patrons').on('click', function() {
242 var checkedItems = $("input:checked");
243 if ($(checkedItems).length < 2) {
244 alert(_("You must select one or more patrons to remove"));
247 $(checkedItems).parents('tr').addClass("warn");
248 if (confirm(_("Are you sure you want to remove the selected patrons?"))) {
249 var merge_patrons_url = '/cgi-bin/koha/members/merge-patrons.pl?' +
250 $('.selection:checked')
252 return "id=" + $( '#borrowernumber_' + $(this).val() ).val()
255 window.location.href = merge_patrons_url;
258 $(checkedItems).parents('tr').removeClass("warn");
266 [% INCLUDE 'intranet-bottom.inc' %]