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 %]
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 class="main container-fluid">
33 <div class="col-sm-10 col-sm-push-2">
36 <h1>[% list.name | html %]</h1>
38 [% IF ( not_found.size > 0 ) %]
39 <div class="dialog alert"><p>Warning, the following cardnumbers were not found:</p></div>
40 <table style="margin:auto;">
42 <tr><th>Cardnumbers not found</th></tr>
45 [% FOREACH nf IN not_found %]
46 <tr><td>[% nf | html %]</td></td>
52 [% IF ( existed.size > 0 ) %]
53 <div class="dialog alert"><p>Warning, the following cardnumbers were already in this list:</p></div>
54 <table style="margin:auto;">
56 <tr><th>Cardnumbers already in list</th></tr>
59 [% FOREACH ed IN existed %]
60 <tr><td>[% ed | html %]</td></td>
66 <form action="list.pl" id="add_patrons" method="post" class="clearfix">
67 <fieldset class="rows">
68 <legend>Add patrons</legend>
70 <li id="patron_search_line">
71 <label for="find_patron">Patron search: </label>
72 <input autocomplete="off" id="find_patron" type="text" style="width:150px" class="noEnterSubmit" />
74 <li id="add_patrons_by_search"><a href="#">
75 <span class="label"> </span>
76 <i class="fa fa-plus"></i> Search for patrons</a></li>
77 <li id="add_patrons_by_barcode"><a href="#">
78 <span class="label"> </span>
79 <i class="fa fa-plus"></i> Enter multiple card numbers</a></li>
80 <li id="patron_barcodes_line">
81 <label for="patrons_by_barcode">Card number list (one barcode per line):</label>
82 <textarea id="patrons_by_barcode" name="patrons_by_barcode" id="" cols="30" rows="10"></textarea>
86 <fieldset id="patron_barcodes_submit" class="action">
87 <input type="submit" value="Submit" />
90 <div class="clearfix"></div>
92 <fieldset id="patrons_to_add_fieldset">
93 <legend>Patrons to be added</legend>
94 <div id="patrons_to_add"></div>
96 <fieldset class="action">
97 <input type="hidden" name="patron_list_id" value="[% list.patron_list_id | html %]" />
98 <input type="submit" value="Add patrons" />
99 <a href="lists.pl" class="cancel">Cancel</a>
104 <form action="list.pl" id="remove_patrons" method="post">
106 <div id="searchheader">
107 <span class="checkall"><a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a></span> |
108 <span class="clearall"><a id="CheckNone" href="#"><i class="fa fa-remove"></i> Clear all</a></span> |
109 <div class="btn-group">
110 <button class="btn btn-default btn-xs list-remove" type="submit"><i class="fa fa-trash"></i> Remove selected</button>
113 <div class="btn-group">
114 <button class="btn btn-default btn-xs merge-patrons"><i class="fa fa-compress"></i> Merge selected patrons</button>
118 <table id="patron-list-table">
134 [% FOREACH p IN list.patron_list_patrons %]
137 <input type="checkbox" name="patrons_to_remove" class="selection" value="[% p.patron_list_patron_id | html %]" />
138 <input type="hidden" id="borrowernumber_[% p.patron_list_patron_id | html %]" value="[% p.borrowernumber.id | html %]" />
141 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% p.borrowernumber.borrowernumber | uri %]">
142 [% p.borrowernumber.cardnumber | html %]
145 <td>[% p.borrowernumber.firstname | html %]</td>
146 <td>[% p.borrowernumber.surname | html %]</td>
148 [% p.borrowernumber.address | html %]
149 [% p.borrowernumber.address2 | html %]
150 [% p.borrowernumber.city | html %]
151 [% p.borrowernumber.state | html %]
152 [% p.borrowernumber.country | html %]
154 <td>[% p.borrowernumber.categorycode.description | html %] ([% p.borrowernumber.categorycode.categorycode | html %])</td>
155 <td>[% p.borrowernumber.branchcode.branchname | html %]</td>
156 <td><span title="[% p.borrowernumber.dateexpiry | html %]">[% p.borrowernumber.dateexpiry | $KohaDates %]</span></td>
157 <td>[% p.borrowernumber.borrowernotes | html %]</td>
163 <input type="hidden" name="patron_list_id" value="[% list.patron_list_id | html %]" />
164 <button type="submit" class="btn btn-default btn-sm list-remove"><i class="fa fa-trash" aria-hidden="true"></i> Remove selected patrons</button>
165 <button class="btn btn-default btn-sm merge-patrons" type="submit"><i class="fa fa-compress"></i> Merge selected patrons</button>
169 </div> <!-- /.col-sm-10.col-sm-push-2 -->
171 <div class="col-sm-2 col-sm-pull-10">
173 [% INCLUDE 'tools-menu.inc' %]
175 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
176 </div> <!-- /.row -->
178 [% MACRO jsinclude BLOCK %]
179 [% Asset.js("js/tools-menu.js") | $raw %]
180 [% INCLUDE 'datatables.inc' %]
182 [% Asset.js("js/autocomplete/patrons.js") | $raw %]
184 var MSG_REMOVE_PATRON = _("Remove");
185 $(document).ready(function() {
186 $('#patrons_to_add_fieldset').hide();
188 $('#patron-list-table').dataTable($.extend(true, {}, dataTablesDefaults, {
189 "order": [[ 3, "asc" ]],
191 null,null,null,null,null,null,null,{ "sType": "title-string" },null
194 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
196 "sPaginationType": "four_button"
199 patron_autocomplete({
200 patron_container: $("#patrons_to_add"),
201 input_autocomplete: $("#find_patron"),
202 patron_input_name: 'patrons_to_add'
205 var checkBoxes = $("input[type='checkbox']","#patron-list-table");
207 $("#CheckAll").click(function(e){
209 checkBoxes.each(function(){
210 $(this).prop("checked",1);
213 $("#CheckNone").click(function(e){
215 checkBoxes.each(function(){
216 $(this).prop("checked",0);
220 $("#remove_patrons").submit(function(){
221 var checkedItems = $("input:checked");
222 if ($(checkedItems).size() == 0) {
223 alert(_("You must select one or more patrons to remove"));
226 $(checkedItems).parents('tr').addClass("warn");
227 if( confirm(_("Are you sure you want to remove the selected patrons?")) ) {
230 $(checkedItems).parents('tr').removeClass("warn");
235 $("#add_patrons_by_barcode a").on("click", function(){
236 $("#add_patrons_by_barcode, #patron_search_line").hide();
237 $("#add_patrons_by_search, #patron_barcodes_line, #patron_barcodes_submit").show();
240 $("#add_patrons_by_search a").on("click", function(){
241 $("#add_patrons_by_barcode, #patron_search_line").show();
242 $("#add_patrons_by_search, #patron_barcodes_line, #patron_barcodes_submit").hide();
245 $('.merge-patrons').on('click', function() {
246 var checkedItems = $("input:checked");
247 if ($(checkedItems).length < 2) {
248 alert(_("You must select two or more patrons to merge"));
251 $(checkedItems).parents('tr').addClass("warn");
252 if (confirm(_("Are you sure you want to merge the selected patrons?"))) {
253 var merge_patrons_url = '/cgi-bin/koha/members/merge-patrons.pl?' +
254 $('.selection:checked')
256 return "id=" + $( '#borrowernumber_' + $(this).val() ).val()
259 window.location.href = merge_patrons_url;
262 $(checkedItems).parents('tr').removeClass("warn");
270 [% INCLUDE 'intranet-bottom.inc' %]