4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha › Tools › Patron lists › [% list.name %] › Add patrons</title>
6 [% INCLUDE 'doc-head-close.inc' %]
8 [% Asset.css("css/datatables.css") %]
9 <style type="text/css">
10 #add_patrons_by_search {
13 #patron_barcodes_line {
16 #patron_barcodes_submit {
25 <body id="patlist_list" class="pat patlist">
26 [% INCLUDE 'header.inc' %]
27 [% INCLUDE 'cat-search.inc' %]
28 <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 %]">[% list.name |html %]</a> › Add patrons</div>
30 <div id="doc3" class="yui-t2">
34 <h1>[% list.name |html %]</h1>
36 [% IF ( not_found.size > 0 ) %]
37 <div class="dialog alert"><p>Warning, the following cardnumbers were not found:</p></div>
38 <table style="margin:auto;">
40 <tr><th>Cardnumbers not found</th></tr>
43 [% FOREACH nf IN not_found %]
44 <tr><td>[% nf |html %]</td></td>
50 [% IF ( existed.size > 0 ) %]
51 <div class="dialog alert"><p>Warning, the following cardnumbers were already in this list:</p></div>
52 <table style="margin:auto;">
54 <tr><th>Cardnumbers already in list</th></tr>
57 [% FOREACH ed IN existed %]
58 <tr><td>[% ed |html %]</td></td>
64 <form action="list.pl" id="add_patrons" method="post" class="clearfix">
65 <fieldset class="rows">
66 <legend>Add patrons</legend>
68 <li id="patron_search_line">
69 <label for="find_patron">Patron search: </label>
70 <input autocomplete="off" id="find_patron" type="text" style="width:150px" class="noEnterSubmit" />
72 <li id="add_patrons_by_search"><a href="#">
73 <span class="label"> </span>
74 <i class="fa fa-plus"></i> Search for patrons</a></li>
75 <li id="add_patrons_by_barcode"><a href="#">
76 <span class="label"> </span>
77 <i class="fa fa-plus"></i> Enter multiple card numbers</a></li>
78 <li id="patron_barcodes_line">
79 <label for="patrons_by_barcode">Card number list (one barcode per line):</label>
80 <textarea id="patrons_by_barcode" name="patrons_by_barcode" id="" cols="30" rows="10"></textarea>
84 <fieldset id="patron_barcodes_submit" class="action">
85 <input type="submit" value="Submit" />
88 <div class="clearfix"></div>
90 <fieldset id="patrons_to_add_fieldset">
91 <legend>Patrons to be added</legend>
92 <div id="patrons_to_add"></div>
94 <fieldset class="action">
95 <input type="hidden" name="patron_list_id" value="[% list.patron_list_id %]" />
96 <input type="submit" value="Add patrons" />
97 <a href="lists.pl" class="cancel">Cancel</a>
102 <form action="list.pl" id="remove_patrons" method="post">
104 <div id="searchheader">
105 <span class="checkall"><a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a></span> |
106 <span class="clearall"><a id="CheckNone" href="#"><i class="fa fa-remove"></i> Clear all</a></span> |
107 <div class="btn-group">
108 <button class="btn btn-default btn-xs list-remove" type="submit"><i class="fa fa-trash"></i> Remove selected</button>
112 <table id="patron-list-table">
128 [% FOREACH p IN list.patron_list_patrons %]
130 <td><input type="checkbox" name="patrons_to_remove" value="[% p.patron_list_patron_id %]" /></td>
132 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% p.borrowernumber.borrowernumber %]">
133 [% p.borrowernumber.cardnumber %]
136 <td>[% p.borrowernumber.firstname %]</td>
137 <td>[% p.borrowernumber.surname %]</td>
139 [% p.borrowernumber.address %]
140 [% p.borrowernumber.address2 %]
141 [% p.borrowernumber.city %]
142 [% p.borrowernumber.state %]
143 [% p.borrowernumber.country %]
145 <td>[% p.borrowernumber.categorycode.description %] ([% p.borrowernumber.categorycode.categorycode %])</td>
146 <td>[% p.borrowernumber.branchcode.branchname %]</td>
147 <td><span title="[% p.borrowernumber.dateexpiry %]">[% p.borrowernumber.dateexpiry | $KohaDates %]</span></td>
148 <td>[% p.borrowernumber.borrowernotes %]</td>
154 <input type="hidden" name="patron_list_id" value="[% list.patron_list_id %]" />
155 <button type="submit" class="btn btn-default btn-sm"><i class="fa fa-trash" aria-hidden="true"></i> Remove selected patrons</button>
160 <div class="yui-b noprint">
161 [% INCLUDE 'tools-menu.inc' %]
165 [% MACRO jsinclude BLOCK %]
166 [% Asset.js("js/tools-menu.js") %]
167 [% INCLUDE 'datatables.inc' %]
169 [% Asset.js("js/autocomplete/patrons.js") %]
170 <script type="text/javascript">
171 var MSG_REMOVE_PATRON = _("Remove");
172 $(document).ready(function() {
173 $('#patrons_to_add_fieldset').hide();
175 $('#patron-list-table').dataTable($.extend(true, {}, dataTablesDefaults, {
176 "order": [[ 3, "asc" ]],
178 null,null,null,null,null,null,null,{ "sType": "title-string" },null
181 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
183 "sPaginationType": "four_button"
186 patron_autocomplete({
187 patron_container: $("#patrons_to_add"),
188 input_autocomplete: $("#find_patron"),
189 patron_input_name: 'patrons_to_add'
192 var checkBoxes = $("input[type='checkbox']","#patron-list-table");
194 $("#CheckAll").click(function(e){
196 checkBoxes.each(function(){
197 $(this).prop("checked",1);
200 $("#CheckNone").click(function(e){
202 checkBoxes.each(function(){
203 $(this).prop("checked",0);
207 $("#remove_patrons").submit(function(){
208 var checkedItems = $("input:checked");
209 if ($(checkedItems).size() == 0) {
210 alert(_("You must select one or more patrons to remove"));
213 $(checkedItems).parents('tr').addClass("warn");
214 if( confirm(_("Are you sure you want to remove the selected patrons?")) ) {
217 $(checkedItems).parents('tr').removeClass("warn");
222 $("#add_patrons_by_barcode a").on("click", function(){
223 $("#add_patrons_by_barcode, #patron_search_line").hide();
224 $("#add_patrons_by_search, #patron_barcodes_line, #patron_barcodes_submit").show();
227 $("#add_patrons_by_search a").on("click", function(){
228 $("#add_patrons_by_barcode, #patron_search_line").show();
229 $("#add_patrons_by_search, #patron_barcodes_line, #patron_barcodes_submit").hide();
235 [% INCLUDE 'intranet-bottom.inc' %]