Bug 19584: Check compare barcodes box when uploading barcodes
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / patron_lists / list.tt
1 [% USE KohaDates %]
2 [% SET footerjs = 1 %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha &rsaquo; Tools &rsaquo; Patron lists &rsaquo; [% list.name %] &rsaquo; Add patrons</title>
5 [% INCLUDE 'doc-head-close.inc' %]
6
7 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
8 <style type="text/css">
9     #add_patrons_by_search {
10         display: none;
11     }
12     #patron_barcodes_line {
13         display: none;
14     }
15     #patron_barcodes_submit {
16         display: none;
17     }
18     #searchheader {
19         margin-top: 1em;
20     }
21 </style>
22 </head>
23
24 <body id="patlist_list" class="pat patlist">
25 [% INCLUDE 'header.inc' %]
26 [% INCLUDE 'cat-search.inc' %]
27 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; <a href="lists.pl">Patron lists</a> &rsaquo; <a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% list.id %]">[% list.name |html %]</a> &rsaquo; Add patrons</div>
28
29 <div id="doc3" class="yui-t2">
30    <div id="bd">
31     <div id="yui-main">
32         <div class="yui-b">
33         <h1>[% list.name |html %]</h1>
34
35         [% IF ( not_found.size > 0 ) %]
36         <div class="dialog alert"><p>Warning, the following cardnumbers were not found:</p></div>
37         <table style="margin:auto;">
38             <thead>
39                 <tr><th>Cardnumbers not found</th></tr>
40             </thead>
41             <tbody>
42             [% FOREACH nf IN not_found %]
43                 <tr><td>[% nf |html %]</td></td>
44             [% END %]
45             </tbody>
46         </table>
47         [% END %]
48
49         [% IF ( existed.size > 0 ) %]
50         <div class="dialog alert"><p>Warning, the following cardnumbers were already in this list:</p></div>
51         <table style="margin:auto;">
52             <thead>
53                 <tr><th>Cardnumbers already in list</th></tr>
54             </thead>
55             <tbody>
56             [% FOREACH ed IN existed %]
57                 <tr><td>[% ed |html %]</td></td>
58             [% END %]
59             </tbody>
60         </table>
61         [% END %]
62
63         <form action="list.pl" id="add_patrons" method="post" class="clearfix">
64             <fieldset class="rows">
65                 <legend>Add patrons</legend>
66                 <ol>
67                     <li id="patron_search_line">
68                         <label for="find_patron">Patron search: </label>
69                         <input autocomplete="off" id="find_patron" type="text" style="width:150px" class="noEnterSubmit" />
70                     </li>
71                     <li id="add_patrons_by_search"><a href="#">
72                         <span class="label">&nbsp;</span>
73                         <i class="fa fa-plus"></i> Search for patrons</a></li>
74                     <li id="add_patrons_by_barcode"><a href="#">
75                         <span class="label">&nbsp;</span>
76                         <i class="fa fa-plus"></i> Enter multiple card numbers</a></li>
77                     <li id="patron_barcodes_line">
78                         <label for="patrons_by_barcode">Card number list (one barcode per line):</label>
79                         <textarea id="patrons_by_barcode" name="patrons_by_barcode" id="" cols="30" rows="10"></textarea>
80                     </li>
81                 </ol>
82             </fieldset>
83             <fieldset id="patron_barcodes_submit" class="action">
84                 <input type="submit" value="Submit" />
85             </fieldset>
86
87             <div class="clearfix"></div>
88
89             <fieldset id="patrons_to_add_fieldset">
90                 <legend>Patrons to be added</legend>
91                 <div id="patrons_to_add"></div>
92
93                 <fieldset class="action">
94                     <input type="hidden" name="patron_list_id" value="[% list.patron_list_id %]" />
95                     <input type="submit" value="Add patrons" />
96                     <a href="lists.pl" class="cancel">Cancel</a>
97                 </fieldset>
98             </fieldset>
99         </form>
100
101         <form action="list.pl" id="remove_patrons" method="post">
102
103             <div id="searchheader">
104                 <span class="checkall"><a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a></span> |
105                 <span class="clearall"><a id="CheckNone" href="#"><i class="fa fa-remove"></i> Clear all</a></span> |
106                 <div class="btn-group">
107                     <button class="btn btn-default btn-xs list-remove" type="submit"><i class="fa fa-trash"></i> Remove selected</button>
108                 </div>
109             </div>
110
111             <table id="patron-list-table">
112                 <thead>
113                     <tr>
114                         <th>&nbsp;</th>
115                         <th>Card</th>
116                         <th>First name</th>
117                         <th>Surname</th>
118                         <th>Address</th>
119                         <th>Category</th>
120                         <th>Library</th>
121                         <th>Expires on</th>
122                         <th>Circ notes</th>
123                     </tr>
124                 </thead>
125
126                 <tbody>
127                     [% FOREACH p IN list.patron_list_patrons %]
128                         <tr>
129                             <td><input type="checkbox" name="patrons_to_remove" value="[% p.patron_list_patron_id %]" /></td>
130                             <td>
131                                 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% p.borrowernumber.borrowernumber %]">
132                                     [% p.borrowernumber.cardnumber %]
133                                 </a>
134                             </td>
135                             <td>[% p.borrowernumber.firstname %]</td>
136                             <td>[% p.borrowernumber.surname %]</td>
137                             <td>
138                                 [% p.borrowernumber.address %]
139                                 [% p.borrowernumber.address2 %]
140                                 [% p.borrowernumber.city %]
141                                 [% p.borrowernumber.state %]
142                                 [% p.borrowernumber.country %]
143                             </td>
144                             <td>[% p.borrowernumber.categorycode.description %] ([% p.borrowernumber.categorycode.categorycode %])</td>
145                             <td>[% p.borrowernumber.branchcode.branchname %]</td>
146                             <td><span title="[% p.borrowernumber.dateexpiry %]">[% p.borrowernumber.dateexpiry | $KohaDates %]</span></td>
147                             <td>[% p.borrowernumber.borrowernotes %]</td>
148                         </tr>
149                     [% END %]
150                 </tbody>
151             </table>
152
153             <input type="hidden" name="patron_list_id" value="[% list.patron_list_id %]" />
154             <button type="submit" class="btn btn-default btn-sm"><i class="fa fa-trash" aria-hidden="true"></i> Remove selected patrons</button>
155         </form>
156
157             </div>
158         </div>
159         <div class="yui-b noprint">
160             [% INCLUDE 'tools-menu.inc' %]
161         </div>
162     </div>
163
164 [% MACRO jsinclude BLOCK %]
165     <script type="text/javascript" src="[% interface %]/[% theme %]/js/tools-menu_[% KOHA_VERSION %].js"></script>
166     [% INCLUDE 'datatables.inc' %]
167
168     <script type="text/javascript" src="[% interface %]/js/autocomplete/patrons_[% KOHA_VERSION %].js"></script>
169     <script type="text/javascript">
170         var MSG_REMOVE_PATRON = _("Remove");
171         $(document).ready(function() {
172             $('#patrons_to_add_fieldset').hide();
173
174                 $('#patron-list-table').dataTable($.extend(true, {}, dataTablesDefaults, {
175                     "order": [[ 3, "asc" ]],
176                     "aoColumns": [
177                         null,null,null,null,null,null,null,{ "sType": "title-string" },null
178                     ],
179                     "aoColumnDefs": [
180                         { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
181                     ],
182                     "sPaginationType": "four_button"
183                 } ));
184
185             patron_autocomplete({
186                 patron_container: $("#patrons_to_add"),
187                 input_autocomplete: $("#find_patron"),
188                 patron_input_name: 'patrons_to_add'
189             });
190
191             var checkBoxes = $("input[type='checkbox']","#patron-list-table");
192
193             $("#CheckAll").click(function(e){
194                 e.preventDefault();
195                 checkBoxes.each(function(){
196                     $(this).prop("checked",1);
197                 });
198             });
199             $("#CheckNone").click(function(e){
200                 e.preventDefault();
201                 checkBoxes.each(function(){
202                     $(this).prop("checked",0);
203                 });
204             });
205
206             $("#remove_patrons").submit(function(){
207                 var checkedItems = $("input:checked");
208                 if ($(checkedItems).size() == 0) {
209                     alert(_("You must select one or more patrons to remove"));
210                     return false;
211                 }
212                 $(checkedItems).parents('tr').addClass("warn");
213                 if( confirm(_("Are you sure you want to remove the selected patrons?")) ) {
214                     return true;
215                 } else {
216                     $(checkedItems).parents('tr').removeClass("warn");
217                     return false;
218                 }
219             });
220
221             $("#add_patrons_by_barcode a").on("click", function(){
222                 $("#add_patrons_by_barcode, #patron_search_line").hide();
223                 $("#add_patrons_by_search, #patron_barcodes_line, #patron_barcodes_submit").show();
224             });
225
226             $("#add_patrons_by_search a").on("click", function(){
227                 $("#add_patrons_by_barcode, #patron_search_line").show();
228                 $("#add_patrons_by_search, #patron_barcodes_line, #patron_barcodes_submit").hide();
229             });
230         });
231     </script>
232 [% END %]
233
234 [% INCLUDE 'intranet-bottom.inc' %]