4 [% USE TablesSettings %]
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' %]
31 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
34 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
37 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
40 <a href="lists.pl">Patron lists</a>
43 <a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% list.id | uri %]">[% list.name | html %]</a>
46 <a href="#" aria-current="page">
53 <div class="main container-fluid">
55 <div class="col-sm-10 col-sm-push-2">
58 <h1>[% list.name | html %]</h1>
60 [% IF ( not_found.size > 0 ) %]
61 <div class="dialog alert"><p>Warning, the following cardnumbers were not found:</p></div>
62 <table style="margin:auto;">
64 <tr><th>Cardnumbers not found</th></tr>
67 [% FOREACH nf IN not_found %]
68 <tr><td>[% nf | html %]</td></td>
74 [% IF ( existed.size > 0 ) %]
75 <div class="dialog alert"><p>Warning, the following cardnumbers were already in this list:</p></div>
76 <table style="margin:auto;">
78 <tr><th>Cardnumbers already in list</th></tr>
81 [% FOREACH ed IN existed %]
82 <tr><td>[% ed | html %]</td></td>
88 <form action="list.pl" id="add_patrons" method="post" class="clearfix">
89 <fieldset class="rows">
90 <legend>Add patrons</legend>
92 <li id="patron_search_line">
93 <label for="find_patron">Patron search: </label>
94 <input autocomplete="off" id="find_patron" type="text" style="width:150px" class="noEnterSubmit" />
96 <li id="add_patrons_by_search"><a href="#">
97 <span class="label"> </span>
98 <i class="fa fa-plus"></i> Search for patrons</a></li>
99 <li id="add_patrons_by_barcode"><a href="#">
100 <span class="label"> </span>
101 <i class="fa fa-plus"></i> Enter multiple card numbers</a></li>
102 <li id="patron_barcodes_line">
103 <label for="patrons_by_barcode">Card number list (one barcode per line):</label>
104 <textarea id="patrons_by_barcode" name="patrons_by_barcode" id="" cols="30" rows="10"></textarea>
108 <fieldset id="patron_barcodes_submit" class="action">
109 <input type="submit" value="Submit" />
112 <div class="clearfix"></div>
114 <fieldset id="patrons_to_add_fieldset">
115 <legend>Patrons to be added</legend>
116 <div id="patrons_to_add"></div>
118 <fieldset class="action">
119 <input type="hidden" name="patron_list_id" value="[% list.patron_list_id | html %]" />
120 <input type="submit" value="Add patrons" />
121 <a href="lists.pl" class="cancel">Cancel</a>
126 <form action="list.pl" id="remove_patrons" method="post">
128 <div class="searchheader" id="searchheader">
129 <span class="checkall"><a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a></span> |
130 <span class="clearall"><a id="CheckNone" href="#"><i class="fa fa-remove"></i> Clear all</a></span> |
131 <div class="btn-group">
132 <button class="btn btn-default btn-xs list-remove" type="submit"><i class="fa fa-trash"></i> Remove selected</button>
135 <div class="btn-group">
136 <button class="btn btn-default btn-xs merge-patrons"><i class="fa fa-compress"></i> Merge selected patrons</button>
140 <table id="patron-list-table">
143 <th class="NoSort"> </th>
156 [% FOREACH p IN list.patron_list_patrons %]
159 <input type="checkbox" name="patrons_to_remove" class="selection" value="[% p.patron_list_patron_id | html %]" />
160 <input type="hidden" id="borrowernumber_[% p.patron_list_patron_id | html %]" value="[% p.borrowernumber.id | html %]" />
163 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% p.borrowernumber.borrowernumber | uri %]">
164 [% p.borrowernumber.cardnumber | html %]
167 <td>[% p.borrowernumber.firstname | html %]</td>
168 <td>[% p.borrowernumber.surname | html %]</td>
170 [% p.borrowernumber.address | html %]
171 [% p.borrowernumber.address2 | html %]
172 [% p.borrowernumber.city | html %]
173 [% p.borrowernumber.state | html %]
174 [% p.borrowernumber.country | html %]
176 <td>[% p.borrowernumber.categorycode.description | html %] ([% p.borrowernumber.categorycode.categorycode | html %])</td>
177 <td>[% p.borrowernumber.branchcode.branchname | html %]</td>
178 <td data-order="[% p.borrowernumber.dateexpiry | html %]">[% p.borrowernumber.dateexpiry | $KohaDates %]</td>
179 <td>[% p.borrowernumber.borrowernotes | html %]</td>
185 <input type="hidden" name="patron_list_id" value="[% list.patron_list_id | html %]" />
186 <button type="submit" class="btn btn-default btn-sm list-remove"><i class="fa fa-trash" aria-hidden="true"></i> Remove selected patrons</button>
187 <button class="btn btn-default btn-sm merge-patrons" type="submit"><i class="fa fa-compress"></i> Merge selected patrons</button>
191 </div> <!-- /.col-sm-10.col-sm-push-2 -->
193 <div class="col-sm-2 col-sm-pull-10">
195 [% INCLUDE 'tools-menu.inc' %]
197 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
198 </div> <!-- /.row -->
200 [% MACRO jsinclude BLOCK %]
201 [% Asset.js("js/tools-menu.js") | $raw %]
202 [% INCLUDE 'datatables.inc' %]
204 [% Asset.js("js/autocomplete/patrons.js") | $raw %]
206 var MSG_REMOVE_PATRON = _("Remove");
207 $(document).ready(function() {
208 $('#patrons_to_add_fieldset').hide();
210 var columns_settings_table = [% TablesSettings.GetColumns('members', 'patron-lists', 'patron-list-table', 'json') | $raw %]
211 KohaTable('patron-list-table', {
212 "order": [[ 3, "asc" ]],
213 "sPaginationType": "full"
214 }, columns_settings_table);
216 patron_autocomplete({
217 patron_container: $("#patrons_to_add"),
218 input_autocomplete: $("#find_patron"),
219 patron_input_name: 'patrons_to_add'
222 var checkBoxes = $("input[type='checkbox']","#patron-list-table");
224 $("#CheckAll").click(function(e){
226 checkBoxes.each(function(){
227 $(this).prop("checked",1);
230 $("#CheckNone").click(function(e){
232 checkBoxes.each(function(){
233 $(this).prop("checked",0);
237 $("#remove_patrons").submit(function(){
238 var checkedItems = $("input:checked");
239 if ($(checkedItems).size() == 0) {
240 alert(_("You must select one or more patrons to remove"));
243 $(checkedItems).parents('tr').addClass("warn");
244 if( confirm(_("Are you sure you want to remove the selected patrons?")) ) {
247 $(checkedItems).parents('tr').removeClass("warn");
252 $("#add_patrons_by_barcode a").on("click", function(){
253 $("#add_patrons_by_barcode, #patron_search_line").hide();
254 $("#add_patrons_by_search, #patron_barcodes_line, #patron_barcodes_submit").show();
257 $("#add_patrons_by_search a").on("click", function(){
258 $("#add_patrons_by_barcode, #patron_search_line").show();
259 $("#add_patrons_by_search, #patron_barcodes_line, #patron_barcodes_submit").hide();
262 $('.merge-patrons').on('click', function() {
263 var checkedItems = $("input:checked");
264 if ($(checkedItems).length < 2) {
265 alert(_("You must select two or more patrons to merge"));
268 $(checkedItems).parents('tr').addClass("warn");
269 if (confirm(_("Are you sure you want to merge the selected patrons?"))) {
270 var merge_patrons_url = '/cgi-bin/koha/members/merge-patrons.pl?' +
271 $('.selection:checked')
273 return "id=" + $( '#borrowernumber_' + $(this).val() ).val()
276 window.location.href = merge_patrons_url;
279 $(checkedItems).parents('tr').removeClass("warn");
287 [% INCLUDE 'intranet-bottom.inc' %]