4 [% USE ColumnsSettings %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 [% INCLUDE 'columns_settings.inc' %]
8 <title>Koha › Tools › Patron lists › [% list.name | html %] › Add patrons</title>
9 [% INCLUDE 'doc-head-close.inc' %]
12 #add_patrons_by_search {
15 #patron_barcodes_line {
18 #patron_barcodes_submit {
27 <body id="patlist_list" class="pat patlist">
28 [% INCLUDE 'header.inc' %]
29 [% INCLUDE 'cat-search.inc' %]
30 <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>
32 <div class="main container-fluid">
34 <div class="col-sm-10 col-sm-push-2">
37 <h1>[% list.name | html %]</h1>
39 [% IF ( not_found.size > 0 ) %]
40 <div class="dialog alert"><p>Warning, the following cardnumbers were not found:</p></div>
41 <table style="margin:auto;">
43 <tr><th>Cardnumbers not found</th></tr>
46 [% FOREACH nf IN not_found %]
47 <tr><td>[% nf | html %]</td></td>
53 [% IF ( existed.size > 0 ) %]
54 <div class="dialog alert"><p>Warning, the following cardnumbers were already in this list:</p></div>
55 <table style="margin:auto;">
57 <tr><th>Cardnumbers already in list</th></tr>
60 [% FOREACH ed IN existed %]
61 <tr><td>[% ed | html %]</td></td>
67 <form action="list.pl" id="add_patrons" method="post" class="clearfix">
68 <fieldset class="rows">
69 <legend>Add patrons</legend>
71 <li id="patron_search_line">
72 <label for="find_patron">Patron search: </label>
73 <input autocomplete="off" id="find_patron" type="text" style="width:150px" class="noEnterSubmit" />
75 <li id="add_patrons_by_search"><a href="#">
76 <span class="label"> </span>
77 <i class="fa fa-plus"></i> Search for patrons</a></li>
78 <li id="add_patrons_by_barcode"><a href="#">
79 <span class="label"> </span>
80 <i class="fa fa-plus"></i> Enter multiple card numbers</a></li>
81 <li id="patron_barcodes_line">
82 <label for="patrons_by_barcode">Card number list (one barcode per line):</label>
83 <textarea id="patrons_by_barcode" name="patrons_by_barcode" id="" cols="30" rows="10"></textarea>
87 <fieldset id="patron_barcodes_submit" class="action">
88 <input type="submit" value="Submit" />
91 <div class="clearfix"></div>
93 <fieldset id="patrons_to_add_fieldset">
94 <legend>Patrons to be added</legend>
95 <div id="patrons_to_add"></div>
97 <fieldset class="action">
98 <input type="hidden" name="patron_list_id" value="[% list.patron_list_id | html %]" />
99 <input type="submit" value="Add patrons" />
100 <a href="lists.pl" class="cancel">Cancel</a>
105 <form action="list.pl" id="remove_patrons" method="post">
107 <div id="searchheader">
108 <span class="checkall"><a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a></span> |
109 <span class="clearall"><a id="CheckNone" href="#"><i class="fa fa-remove"></i> Clear all</a></span> |
110 <div class="btn-group">
111 <button class="btn btn-default btn-xs list-remove" type="submit"><i class="fa fa-trash"></i> Remove selected</button>
114 <div class="btn-group">
115 <button class="btn btn-default btn-xs merge-patrons"><i class="fa fa-compress"></i> Merge selected patrons</button>
119 <table id="patron-list-table">
135 [% FOREACH p IN list.patron_list_patrons %]
138 <input type="checkbox" name="patrons_to_remove" class="selection" value="[% p.patron_list_patron_id | html %]" />
139 <input type="hidden" id="borrowernumber_[% p.patron_list_patron_id | html %]" value="[% p.borrowernumber.id | html %]" />
142 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% p.borrowernumber.borrowernumber | uri %]">
143 [% p.borrowernumber.cardnumber | html %]
146 <td>[% p.borrowernumber.firstname | html %]</td>
147 <td>[% p.borrowernumber.surname | html %]</td>
149 [% p.borrowernumber.address | html %]
150 [% p.borrowernumber.address2 | html %]
151 [% p.borrowernumber.city | html %]
152 [% p.borrowernumber.state | html %]
153 [% p.borrowernumber.country | html %]
155 <td>[% p.borrowernumber.categorycode.description | html %] ([% p.borrowernumber.categorycode.categorycode | html %])</td>
156 <td>[% p.borrowernumber.branchcode.branchname | html %]</td>
157 <td><span title="[% p.borrowernumber.dateexpiry | html %]">[% p.borrowernumber.dateexpiry | $KohaDates %]</span></td>
158 <td>[% p.borrowernumber.borrowernotes | html %]</td>
164 <input type="hidden" name="patron_list_id" value="[% list.patron_list_id | html %]" />
165 <button type="submit" class="btn btn-default btn-sm list-remove"><i class="fa fa-trash" aria-hidden="true"></i> Remove selected patrons</button>
166 <button class="btn btn-default btn-sm merge-patrons" type="submit"><i class="fa fa-compress"></i> Merge selected patrons</button>
170 </div> <!-- /.col-sm-10.col-sm-push-2 -->
172 <div class="col-sm-2 col-sm-pull-10">
174 [% INCLUDE 'tools-menu.inc' %]
176 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
177 </div> <!-- /.row -->
179 [% MACRO jsinclude BLOCK %]
180 [% Asset.js("js/tools-menu.js") | $raw %]
181 [% INCLUDE 'datatables.inc' %]
183 [% Asset.js("js/autocomplete/patrons.js") | $raw %]
185 var MSG_REMOVE_PATRON = _("Remove");
186 $(document).ready(function() {
187 $('#patrons_to_add_fieldset').hide();
189 var columns_settings_table = [% ColumnsSettings.GetColumns('members', 'patron-lists', 'patron-list-table', 'json') | $raw %]
190 KohaTable('patron-list-table', {
191 "order": [[ 3, "asc" ]],
193 null,null,null,null,null,null,null,{ "sType": "title-string" },null
196 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
198 "sPaginationType": "full"
199 }, columns_settings_table);
201 patron_autocomplete({
202 patron_container: $("#patrons_to_add"),
203 input_autocomplete: $("#find_patron"),
204 patron_input_name: 'patrons_to_add'
207 var checkBoxes = $("input[type='checkbox']","#patron-list-table");
209 $("#CheckAll").click(function(e){
211 checkBoxes.each(function(){
212 $(this).prop("checked",1);
215 $("#CheckNone").click(function(e){
217 checkBoxes.each(function(){
218 $(this).prop("checked",0);
222 $("#remove_patrons").submit(function(){
223 var checkedItems = $("input:checked");
224 if ($(checkedItems).size() == 0) {
225 alert(_("You must select one or more patrons to remove"));
228 $(checkedItems).parents('tr').addClass("warn");
229 if( confirm(_("Are you sure you want to remove the selected patrons?")) ) {
232 $(checkedItems).parents('tr').removeClass("warn");
237 $("#add_patrons_by_barcode a").on("click", function(){
238 $("#add_patrons_by_barcode, #patron_search_line").hide();
239 $("#add_patrons_by_search, #patron_barcodes_line, #patron_barcodes_submit").show();
242 $("#add_patrons_by_search a").on("click", function(){
243 $("#add_patrons_by_barcode, #patron_search_line").show();
244 $("#add_patrons_by_search, #patron_barcodes_line, #patron_barcodes_submit").hide();
247 $('.merge-patrons').on('click', function() {
248 var checkedItems = $("input:checked");
249 if ($(checkedItems).length < 2) {
250 alert(_("You must select two or more patrons to merge"));
253 $(checkedItems).parents('tr').addClass("warn");
254 if (confirm(_("Are you sure you want to merge the selected patrons?"))) {
255 var merge_patrons_url = '/cgi-bin/koha/members/merge-patrons.pl?' +
256 $('.selection:checked')
258 return "id=" + $( '#borrowernumber_' + $(this).val() ).val()
261 window.location.href = merge_patrons_url;
264 $(checkedItems).parents('tr').removeClass("warn");
272 [% INCLUDE 'intranet-bottom.inc' %]