4bbd2640ea080a0f647d02554d79dcc0c7c734ef
[koha-ffzg.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / memberentrygen.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE To %]
4 [% USE Koha %]
5 [% USE KohaDates %]
6 [% USE Branches %]
7 [% SET footerjs = 1 %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>Koha &rsaquo; Patrons &rsaquo;
10     [% UNLESS blocking_error %]
11         [% IF ( opadd ) %]Add
12         [% ELSIF ( opduplicate ) %]Duplicate
13         [% ELSE %] Modify
14         [% END %] patron
15         [% IF (firstname) %][% firstname | html %] [% END %]
16         [% IF (surname) %][% surname | html %] [% END %]
17         ([%IF categoryname %][% categoryname | html %][% ELSE %][% IF ( I ) %]Organization[% END %][% IF ( A ) %]Adult[% END %][% IF ( C ) %]Child[% END %][% IF ( P ) %]Professional[% END %][% IF ( S ) %]Staff[% END %][% END %])
18     [% END %]
19 </title>
20 [% INCLUDE 'doc-head-close.inc' %]
21 </head>
22
23 <body id="pat_memberentrygen" class="pat">
24 [% INCLUDE 'header.inc' %]
25 [% INCLUDE 'patron-search.inc' %]
26
27 <div id="breadcrumbs">
28     <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
29     [% UNLESS blocking_error %]
30     &rsaquo;[% IF (firstname || surname ) %] <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber | uri %]">[% IF (firstname) %][% firstname | html %] [% END %][% IF (surname) %][% surname | html %] [% END %]</a>  &rsaquo;[% END %]
31 <strong>[% IF ( opadd ) %]Add[% ELSIF ( opduplicate ) %]Duplicate[% ELSE %] Modify[% END %] patron ([%IF ( categoryname ) %][% categoryname | html %][% ELSE %][% IF ( I ) %]Organization[% END %][% IF ( A ) %]Adult[% END %][% IF ( C ) %]Child[% END %][% IF ( P ) %]Professional[% END %][% IF ( S ) %]Staff[% END %][% END %])</strong>
32     [% END %]
33 </div>
34
35 <div class="main container-fluid">
36     <div class="row">
37         [% IF ( opadd ) %]
38             <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
39         [% ELSE %]
40             <div class="col-sm-10 col-sm-push-2">
41         [% END %]
42             <main class="clearfix">
43                 [% INCLUDE 'blocking_errors.inc' %]
44
45     [% IF error_alert %]
46         [% IF ( error_alert == "no_email" ) %]
47             <div class="dialog alert">This member has no email</div>
48         [% ELSE %]
49             <div class="dialog alert">[% error_alert | html %]</div>
50         [% END %]
51     [% END %]
52     [% IF info_alert %]
53         <div class="dialog message">Email has been sent.</div>
54     [% END %]
55
56     [% INCLUDE 'noadd-warnings.inc' %]
57
58         [% UNLESS ( no_add ) %]
59     <h1>[% IF ( opadd ) %]Add[% ELSIF ( opduplicate ) %]Duplicate[% ELSE %] Modify[% END %] patron [% IF (firstname) %][% firstname | html %] [% END %][% IF (surname) %][% surname | html %] [% END %]([%IF ( categoryname ) %][% categoryname | html %][% ELSE %][% IF ( I ) %]Organization[% END %][% IF ( A ) %]Adult[% END %][% IF ( C ) %]Child[% END %][% IF ( P ) %]Professional[% END %][% IF ( S ) %]Staff[% END %][% END %])</h1>
60
61     [% IF quickadd && opadd && !check_member %]
62         <a href="#" class="toggle_quick_add"><i class="fa fa-plus-square"></i> Show full form</a>
63         <a href="#" class="toggle_quick_add" style="display:none"><i class="fa fa-minus-square"></i> Show brief form</a>
64     [% END %]
65
66         [% IF ( check_member ) %]
67                         <div class="dialog alert">
68                                 <h3>Duplicate patron record?</h3>
69                 <p><a class="popup" href="#" onclick="Dopop('moremember.pl?print=brief&amp;borrowernumber=[% check_member | html %]');return false;" >View existing record</a></p>
70                 <button id="duplicate" type="submit" class="new"><i class="fa fa-pencil"></i> It is a duplicate.
71                 Edit existing record</button>
72
73                 <button type="submit" id="not-duplicate" class="new"><i class="fa fa-plus"></i> Not a duplicate.
74                 Save as new record</button>
75                         </div>
76         [% END %]
77
78         [% IF ( nok ) %]
79                 <div class="dialog alert">
80                         <p>The following fields are wrong. Please fix them.</p>
81                         <ul>
82                         [% IF ( ERROR_login_exist ) %]
83                                 <li id="ERROR_login_exist">Username/password already exists.</li>
84                         [% END %]
85             [% IF ERROR_cardnumber_already_exists %]
86                 <li id="ERROR_cardnumber">Cardnumber already in use.</li>
87             [% END %]
88             [% IF ERROR_cardnumber_length %]
89                 <li id="ERROR_cardnumber">Cardnumber length is incorrect.</li>
90             [% END %]
91                         [% IF ( ERROR_age_limitations ) %]
92             <li id="ERROR_age_limitations">Patron's age is incorrect for their category.
93                     Ages allowed are [% age_low | html %]-[% age_high | html %].</li>
94                         [% END %]
95                         [% IF ( ERROR_branch ) %]
96                                 <li id="ERROR_branch">Library is invalid.</li>
97             [% END %]
98                         [% IF ( ERROR_dateofbirth ) %]
99                                 <li id="ERROR_dateofbirth">Date of birth is invalid.</li>
100                         [% END %]
101                         [% IF ( ERROR_dateenrolled ) %]
102                                 <li id="ERROR_dateenrolled">Date of enrollment is invalid.</li>
103                         [% END %]
104                         [% IF ( ERROR_dateexpiry ) %]
105                                 <li id="ERROR_dateexpiry">Date of expiration is invalid.</li>
106                         [% END %]
107             [% IF ( ERROR_password_too_short ) %]
108                 <li id="ERROR_short_password">Password must be at least [% minPasswordLength | html %] characters long.</li>
109             [% END %]
110             [% IF ( ERROR_password_too_weak ) %]
111                 <li id="ERROR_weak_password">Password must contain at least one digit, one lowercase and one uppercase.</li>
112             [% END %]
113             [% IF ( ERROR_password_has_whitespaces ) %]
114                 <li id="ERROR_weak_password">Password must not contain leading or trailing whitespaces.</li>
115             [% END %]
116                         [% IF ( ERROR_password_mismatch ) %]
117                                 <li id="ERROR_password_mismatch">Passwords do not match.</li>
118                         [% END %]
119             [% IF ( ERROR_extended_unique_id_failed ) %]
120                 <li id="ERROR_extended_unique_id_failed"><strong>[% ERROR_extended_unique_id_failed_description | html %]:</strong> Attribute value "[% ERROR_extended_unique_id_failed_value | html %]" is already in use by another patron record.</li>
121                         [% END %]
122             [% IF ERROR_bad_email %]
123                 <li id="ERROR_bad_email">The primary email is invalid.</li>
124             [% END %]
125             [% IF ERROR_bad_email_secondary %]
126                 <li id="ERROR_bad_email_secondary">The secondary email is invalid.</li>
127             [% END %]
128             [% IF ERROR_bad_email_alternative %]
129                 <li id="ERROR_bad_email_alternative">The alternative email is invalid.</li>
130             [% END %]
131                         </ul>
132                 </div>
133         [% END %]
134
135
136 <div id="toolbar" class="btn-toolbar">
137 [% UNLESS ( check_member ) %]
138     [% IF quickadd && opadd %]
139         <button class="btn btn-default toggler" id="save_quick_add" name="save"><i class="fa fa-save"></i> Save</button>
140     [% END %]
141     <button class="btn btn-default toggler" id="saverecord" name="save" ><i class="fa fa-save"></i> Save</button>
142     [% IF opadd %]
143         <a class="btn btn-default" href="/cgi-bin/koha/members/member.pl" class="toggler save_entryform">
144     [% ELSE %]
145         <a class="btn btn-default" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber | html %]">
146     [% END %]
147         <i class="fa fa-times"></i> Cancel
148     </a>
149 [% END %]
150 </div>
151
152 <form name="form" id="entryform"  action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off" class="toggler" >
153 [% UNLESS ( check_member ) %]
154     <input type="hidden" name="nodouble"  value="[% nodouble | html %]" />
155 [% END %]
156 <!--    field always hidden in different form (1,2,3) -->
157 <input type="hidden" name="BorrowerMandatoryField" value="[% BorrowerMandatoryField | html %]" />
158 <input type="hidden" name="category_type" value="[% category_type | html %]" />
159 <input type="hidden" name="updtype" value="[% updtype | html %]" />
160 <input type="hidden" name="destination" value="[% destination | html %]" />
161 <input type="hidden" name="check_member" value="[% check_member | html %]" />
162 <input type="hidden" name="borrowernumber" value="[% borrowernumber | html UNLESS opduplicate %]" />
163 <input type="hidden" name="nodouble"  value="[% nodouble | html UNLESS opduplicate %]" />
164 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
165 [% IF ( step ) %]<input type="hidden" name="step"  value="[% step | html %]" />[% END %]
166 [% IF ( opadd ) %]<input type="hidden" name="op" value="insert" />
167 [% ELSIF ( opduplicate ) %]
168 <input type="hidden" name="op" value="insert" />
169 [% ELSE %]
170 <input type="hidden" name="op" value="save" />
171 [% IF step == 4 || step == 5 || step == 6 || step == 2 || step == 1 || step == 7 %]
172 [%# Only put the cardnumber if we arent showing it in the form later %]
173 [% IF cardnumber %]
174 <input type="hidden" name="cardnumber" value="[% cardnumber | html %]" />
175 [% END %]
176 [% END %]
177 [% END %]
178
179 [% IF ( step_1 ) %]
180 [%UNLESS notitle && nosurname && nofirstname && nodateofbirth && noinitials && noothernames &&nosex %]
181         <fieldset class="rows" id="memberentry_identity">
182                 <legend id="identity_lgd">[% IF ( I ) %]Organization [% ELSE %]Patron [% END %]identity</legend>
183                 <ol>
184                 [% UNLESS ( I ) %]
185         [% UNLESS notitle %]
186         [% IF Koha.Preference('BorrowersTitles') %]
187             <li>
188             [% IF ( mandatorytitle ) %]
189                 <label for="btitle" class="required">
190             [% ELSE %]
191                 <label for="btitle">
192             [% END %]
193             Salutation: </label>
194             <select id="btitle" name="title">
195                 <option value=""></option>
196                 [% FOREACH t IN Koha.Preference('BorrowersTitles').split('\|') %]
197                     [% IF btitle == t %]
198                         <option value="[% t | html %]" selected="selected">[% t | html %]</option>
199                     [% ELSE %]
200                         <option value="[% t | html %]">[% t | html %]</option>
201                     [% END %]
202                 [% END %]
203             </select>
204             [% IF ( mandatorytitle ) %]<span class="required">Required</span>[% END %]
205             </li>
206                 [% END %]
207         [% END %]
208                 [% END %]
209         [% UNLESS nosurname %]
210                 <li>
211
212         [% IF ( I ) %]
213             <label for="surname" class="required">
214                 Name:
215             </label>
216         [% ELSE %]
217             [% IF ( mandatorysurname ) %]
218                 <label for="surname" class="required">
219             [% ELSE %]
220                 <label for="surname">
221             [% END %]
222             Surname: </label>
223         [% END %]
224
225                 [% IF ( uppercasesurnames ) %]
226             <input style="text-transform:uppercase;" type="text" id="surname" name="surname" size="20"  value="[% surname | html %]" />
227                 [% ELSE %]
228             <input type="text" id="surname" name="surname" size="20"  value="[% surname | html %]" />
229                 [% END %]
230                 [% IF ( mandatorysurname ) %]<span class="required">Required</span>[% END %]
231                 </li>
232         [% END %]
233                 [% UNLESS ( I ) %]
234         [% UNLESS nofirstname %]
235             <li>
236                 [% IF ( mandatoryfirstname ) %]
237                 <label for="firstname" class="required">
238                 [% ELSE %]
239                 <label for="firstname">
240                 [% END %]
241                 First name: </label>
242                 <input type="text" id="firstname" name="firstname" size="20"  value="[% firstname | html UNLESS opduplicate %]" />
243                 [% IF ( mandatoryfirstname ) %]<span class="required">Required</span>[% END %]
244             </li>
245         [% END %]
246         [% UNLESS nodateofbirth %]
247             <li>
248                 [% IF ( mandatorydateofbirth ) %]
249                 <label for="dateofbirth" class="required">
250                 [% ELSE %]
251                 <label for="dateofbirth">
252                 [% END %]
253                 Date of birth: </label>
254
255                 <input type="text" id="dateofbirth" name="dateofbirth" size="20" onchange="write_age();" value="[% dateofbirth | html UNLESS opduplicate %]" class="datepicker" />
256
257         [% IF ( mandatorydateofbirth ) %]<span class="required">Required</span>[% END %]
258         [% IF ( ERROR_dateofbirth ) %]<span class="required">(Error)</span>[% END %]
259                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
260             </li>
261         [% END %]
262         [% UNLESS noinitials %]
263             <li>
264                 [% IF ( mandatoryinitials ) %]
265                     <label for="initials" class="required">
266                 [% ELSE %]
267                     <label for="initials">
268                 [% END %]
269                 Initials: </label>
270                 <input type="text" id="initials" name="initials" size="20"  value="[% initials | html UNLESS opduplicate %]" />
271                 [% IF ( mandatoryinitials ) %]<span class="required">Required</span>[% END %]
272             </li>
273         [% END %]
274         [% END %]
275         [% UNLESS noothernames %]
276                 <li>
277                         [% IF ( mandatoryothernames ) %]
278                         <label for="othernames" class="required">
279                         [% ELSE %]
280                         <label for="othernames">
281                         [% END %]
282             Other name: </label>
283             <input type="text" id="othernames" name="othernames" size="20"  value="[% othernames | html UNLESS opduplicate %]" />
284 [% IF ( mandatoryothernames ) %]<span class="required">Required</span>[% END %]
285                 [% IF ( I ) %]<input type="hidden" name="sex" value="N" />[% END %]
286                 </li>
287         [% END %]
288     [% UNLESS ( I ) %]
289         [% UNLESS nosex %]
290                 <li class="radio">
291
292             [% UNLESS ( opduplicate ) %]
293                 [% IF ( female ) %]
294                     <label for="sex-female"><input type="radio" name="sex" id="sex-female" value="F" checked="checked" /> Female</label>
295                 [% ELSE %]
296                     <label for="sex-female"><input type="radio" name="sex" id="sex-female" value="F" /> Female</label>
297                 [% END %]
298                 [% IF ( male ) %]
299                     <label for="sex-male"><input type="radio" name="sex" id="sex-male" value="M" checked="checked" /> Male</label>
300                 [% ELSE %]
301                     <label for="sex-male"><input type="radio" name="sex" id="sex-male" value="M" /> Male</label>
302                 [% END %]
303                 [% IF ( none ) %]
304                     <label for="sex-none"><input type="radio" name="sex" id="sex-none" value=""  checked="checked" /> None specified</label>
305                 [% ELSE %]
306                     <label for="sex-none"><input type="radio" name="sex" id="sex-none" value="" /> None specified</label>
307                 [% END %]
308             [% ELSE %]
309                 <label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F" />
310                 <label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" />
311                 <label for="sex-none">None specified </label><input type="radio" name="sex" id="sex-none" value="" checked="checked" />
312             [% END %]
313
314         </li>
315         [% END %]
316     [% END %]
317                 </ol>
318         </fieldset>
319 [% END # hide fieldset %]
320
321 [% IF show_guarantor || guarantor %]
322     [% SET possible_relationships = Koha.Preference('borrowerRelationship') %]
323     <span id="memberentry_guarantor_anchor">
324     <fieldset id="memberentry_guarantor" class="rows">
325         <legend>Guarantor information</legend>
326
327         <span id="guarantor_relationships">
328             [% FOREACH r IN relationships %]
329                 <fieldset class="rows">
330                     <ol>
331                         [% IF category_type == 'I' %]
332                             <li class="guarantor-details" data-borrowernumber="[% r.guarantor_id | $raw %]">
333                                 <span class="label">Organization #:</span> [% IF ( r.guarantor_id ) %] <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% r.guarantor_id | uri %]" target="blank">[% r.guarantor_id | html %]</a>[% END %]
334                             </li>
335
336                             <li>
337                                 <label for="guarantor_surname">Organization name: </label>
338                                 <span>[% r.guarantor.surname | html %]</span>
339                             </li>
340                         [% ELSE %]
341                             <li class="guarantor-details" data-borrowernumber="[% r.guarantor_id | $raw %]">
342                                 <span class="label">Patron #:</span>
343                                 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% r.guarantor_id | uri %]" target="blank">[% r.guarantor_id | html %]</a>
344                             </li>
345
346                             [% IF r.guarantor.surname %]
347                                 <li>
348                                     <label for="guarantor_surname">Surname: </label>
349                                     <span>[% r.guarantor.surname | html %]</span>
350                                 </li>
351                             [% END %]
352
353                             [% IF r.guarantor.firstname %]
354                                 <li>
355                                     <label for="guarantor_firstname">First name: </label>
356                                     <span>[% r.guarantor.firstname | html %]</span>
357                                 </li>
358                             [% END %]
359
360                             <li>
361                                 <label for="relationship">Relationship: </label>
362                                 <span>[% r.relationship | html %]</span>
363                             </li>
364
365                             <li>
366                                 <label for="delete_guarantor-[% r.id | uri %]">Remove: </label>
367                                 <input type="checkbox" id="delete_guarantor-[% r.id | uri %]" name="delete_guarantor" value="[% r.id | html %]" />
368                             </li>
369                         [% END %]
370                     </ol>
371                 </fieldset>
372             [% END # END relationships foreach %]
373         </span>
374
375         <fieldset class="rows guarantor" id="guarantor_template">
376             <ol>
377                 <li class="guarantor-details" data-borrowernumber="0">
378                     <span class="label">Patron #:</span>
379                     <span class="new_guarantor_id_text"></span>
380                     <input type="hidden" class="new_guarantor_id" name="new_guarantor_id" value=""/>
381                 </li>
382
383                 <li>
384                     <label for="guarantor_surname">Surname: </label>
385                     <span class="new_guarantor_surname_text"></span>
386                 </li>
387
388                 <li>
389                     <label for="guarantor_firstname">First name: </label>
390                     <span class="new_guarantor_firstname_text"></span>
391                 </li>
392
393                 <li>
394                     <label for="guarantor_relationship">Relationship: </label>
395                     <select class="new_guarantor_relationship" name="new_guarantor_relationship">
396                         [% FOREACH pr IN possible_relationships.split('\|') %]
397                             <option value="[% pr | html %]">[% pr | html %]</option>
398                         [% END %]
399                     </select>
400                 </li>
401
402                 <li>
403                     <label for="guarantor_cancel">&nbsp;</label>
404                     <span><a href="#" class="guarantor_cancel">Remove</a></span>
405                 </li>
406             </ol>
407         </fieldset>
408
409             <ol>
410                 <input type="hidden" id="guarantor_id" value="" />
411                 <input name="guarantor_surname" id="guarantor_surname" type="hidden" />
412                 <input name="guarantor_firstname" id="guarantor_firstname" type="hidden" />
413
414                 <li>
415                     <a href="#" id="guarantor_search" class="btn btn-default"><i class="fa fa-plus"></i> Search to add</a>
416                 </li>
417
418                 [% IF relationships && Koha.Preference('AllowStaffToSetCheckoutsVisibilityForGuarantor') %]
419                     <li>
420                         <label for="privacy_guarantor_checkouts">Show checkouts to guarantors</label>
421                         <select name="privacy_guarantor_checkouts" id="privacy_guarantor_checkouts">
422                             [% IF privacy_guarantor_checkouts %]
423                                 <option value="0">No</option>
424                                 <option value="1" selected>Yes</option>
425                             [% ELSE %]
426                                 <option value="0" selected>No</option>
427                                 <option value="1">Yes</option>
428                             [% END %]
429                         </select>
430                         <div class="hint">Allow guarantors of this patron to view this patron's checkouts from the OPAC</div>
431                     </li>
432                 [% END %]
433                 [% IF relationships && Koha.Preference('AllowStaffToSetFinesVisibilityForGuarantor') %]
434                     <li>
435                         <label for="privacy_guarantor_fines">Show fines to guarantors</label>
436                         <select name="privacy_guarantor_fines" id="privacy_guarantor_fines">
437                             [% IF privacy_guarantor_fines %]
438                                 <option value="0">No</option>
439                                 <option value="1" selected>Yes</option>
440                             [% ELSE %]
441                                 <option value="0" selected>No</option>
442                                 <option value="1">Yes</option>
443                             [% END %]
444                         </select>
445                         <div class="hint">Allow guarantors of this patron to view this patron's fines from the OPAC</div>
446                     </li>
447                 [% END %]
448             </ol>
449     </fieldset>
450     </span>
451 [% END %]
452
453
454 [% UNLESS noaddress && noaddress2 && nocity && nostate && nozipcode && nocountry %]
455     [% IF Koha.Preference( 'AddressFormat' ) %]
456         [% INCLUDE "member-main-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
457     [% END %]
458 [% END # nostreet && nocity etc group%]
459
460 [% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %]
461     <fieldset class="rows" id="memberentry_contact">
462         <legend id="contact_lgd">Contact</legend><ol>
463
464         [% UNLESS nocontactname %]
465             <li>
466                 [% IF ( mandatorycontactname ) %]
467                     <label for="contactname" class="required">
468                 [% ELSE %]
469                     <label for="contactname">
470                 [% END %]
471                 Guarantor surname: </label>
472                 <input type="text" id="contactname" name="contactname" value="[% contactname | html %]" />
473                 [% IF ( mandatorycontactname ) %]<span class="required">Required</span>[% END %]<div class="hint">Non-patron guarantor surname</div>
474             </li>
475         [% END %]
476
477         [% UNLESS nocontactfirstname %]
478             <li>
479                 [% IF ( mandatorycontactfirstname ) %]
480                     <label for="contactfirstname" class="required">
481                 [% ELSE %]
482                     <label for="contactfirstname">
483                 [% END %]
484                 Guarantor first name: </label>
485                 <input type="text" id="contactfirstname" name="contactfirstname" value="[% contactfirstname | html %]" />
486                 [% IF ( mandatorycontactfirstname ) %]<span class="required">Required</span>[% END %]<div class="hint">Non-patron guarantor first name</div>
487             </li>
488         [% END %]
489
490         [% UNLESS norelationship %]
491             [% IF possible_relationships %]
492                 <li>
493                     <label for="relationship">Relationship: </label>
494                     <select class="relationship" name="relationship">
495                         <option value=""></option>
496                         [% FOREACH pr IN possible_relationships.split('\|') %]
497                             [% IF pr == relationship %]
498                                 <option value="[% pr | html %]" selected="selected">[% pr | html %]</option>
499                             [% ELSE %]
500                                 <option value="[% pr | html %]">[% pr | html %]</option>
501                             [% END %]
502                         [% END %]
503                     </select>
504                 </li>
505             [% END %]
506         [% END %]
507
508         [% UNLESS nophone %]
509             <li>
510                 [% IF ( mandatoryphone ) %]
511                     <label for="phone" class="required">
512                 [% ELSE %]
513                     <label for="phone">
514                 [% END %]
515                 Primary phone: </label>
516                 <input type="text" id="phone" name="phone" value="[% phone | html %]" />
517                 [% IF ( mandatoryphone ) %]<span class="required">Required</span>[% END %]<div class="hint">Shows on transit slips</div>
518             </li>
519         [% END %]
520
521         [% UNLESS nophonepro %]
522             <li>
523                 [% IF ( mandatoryphonepro ) %]
524                     <label for="phonepro" class="required">
525                 [% ELSE %]
526                     <label for="phonepro">
527                 [% END %]
528                 Secondary phone: </label>
529                 <input type="text" id="phonepro" name="phonepro" value="[% phonepro | html %]" />
530                 [% IF ( mandatoryphonepro ) %]<span class="required">Required</span>[% END %]
531             </li>
532         [% END %]
533
534         [% UNLESS nomobile %]
535             <li>
536                 [% IF ( mandatorymobile ) %]
537                     <label for="mobile" class="required">
538                 [% ELSE %]
539                     <label for="mobile">
540                 [% END %]
541                 Other phone: </label>
542                 <input type="text" id="mobile" name="mobile" value="[% mobile | html %]" />
543                 [% IF ( mandatorymobile ) %]<span class="required">Required</span>[% END %]
544             </li>
545         [% END %]
546
547         [% UNLESS noemail %]
548             <li>
549                 [% IF ( mandatoryemail ) %]
550                     <label for="email" class="required">
551                 [% ELSE %]
552                     <label for="email">
553                 [% END %]
554                 Primary email: </label>
555                 <input type="text" id="email" name="email" size="45" value="[% email | html %]" />
556                 [% IF ( mandatoryemail ) %]<span class="required">Required</span>[% END %]<div class="hint">Shows on transit slips</div>
557             </li>
558         [% END %]
559
560         [% UNLESS noemailpro %]
561             <li>
562                 [% IF ( mandatoryemailpro ) %]
563                     <label for="emailpro" class="required">
564                 [% ELSE %]
565                     <label for="emailpro">
566                 [% END %]
567                 Secondary email: </label>
568                 <input type="text" id="emailpro" name="emailpro" size="45" value="[% emailpro | html %]" />
569                 [% IF ( mandatoryemailpro ) %]<span class="required">Required</span>[% END %]
570             </li>
571         [% END %]
572
573         [% UNLESS nofax %]
574             <li>
575                 [% IF ( mandatoryfax ) %]
576                     <label for="fax" class="required">
577                 [% ELSE %]
578                     <label for="fax">
579                 [% END %]
580                 Fax: </label>
581                 <input type="text" id="fax" name="fax" value="[% fax | html %]" />
582                 [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %]
583             </li>
584         [% END %]
585     </ol>
586 </fieldset>
587 [%END # hide fieldset %]
588
589 <!-- ************************ STEP_1 *********************** -->
590 [% END %]
591 [% IF ( step_6 ) %]
592
593     [% UNLESS noB_address && noB_address2 && noB_city && noB_zipcode && noB_state && noB_country &&nocontactnote && noB_phone && noB_email %]
594     [% SWITCH Koha.Preference( 'AddressFormat' ) %]
595         [% CASE 'de' %]
596             [% INCLUDE 'member-alt-address-style-de.inc' %]
597         [% CASE # us %]
598             [% INCLUDE 'member-alt-address-style-us.inc' %]
599      [% END %]
600
601     [% END # UNLESS noB_address && noB_city && noB_state && noB_phone && noB_email %]
602 [% END %]
603 [% IF ( step_2 ) %]
604     [% UNLESS noaltcontactsurname && noaltcontactfirstname && noaltcontactaddress1 && noaltcontactaddress2 && noaltcontactaddress3 && noaltcontactstate && noaltcontactzipcode && noaltcontactcountry && noaltcontactphone %]
605     [% SWITCH Koha.Preference( 'AddressFormat' ) %]
606         [% CASE 'de' %]
607             [% INCLUDE 'member-alt-contact-style-de.inc' %]
608         [% CASE # us %]
609             [% INCLUDE 'member-alt-contact-style-us.inc' %]
610      [% END %]
611     [% END # UNLESS noaltcontactsurname && noaltcontactfirstname etc %]
612
613 [% END %]
614 [% IF ( step_3 ) %]
615
616   [% SET autoMemberNum = Koha.Preference('autoMemberNum') %]
617   <fieldset class="rows" id="memberentry_library_management">
618     <legend id="library_management_lgd">Library management</legend><ol>
619       [% UNLESS nocardnumber %]
620         <li>
621           [% IF mandatorycardnumber %]
622             <label for="cardnumber" class="required">
623           [% ELSE %]
624             <label for="cardnumber" class="validated">
625           [% END %]
626             Card number: </label>
627
628           <!-- NOTE: div.hint closing tag isn't on the same line -->
629           [% IF minlength_cardnumber == maxlength_cardnumber %]
630                 <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber | html %]" minlength="[% minlength_cardnumber | html %]" maxlength="[% maxlength_cardnumber | html %]" />
631                 [% IF mandatorycardnumber %]<span class="required">Required</span>[% END %]<span id="cn_max" class="required">Card number must not be more than [% maxlength_cardnumber | html %] characters.</span>
632                 <div class="hint">Card number must be exactly [% minlength_cardnumber | html %] characters.
633           [% ELSIF minlength_cardnumber && maxlength_cardnumber %]
634                 <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber | html %]" minlength="[% minlength_cardnumber | html %]" maxlength="[% maxlength_cardnumber | html %]" />
635                 [% IF mandatorycardnumber %]<span class="required">Required</span>[% END %]<span id="cn_max" class="required">Card number must not be more than [% maxlength_cardnumber | html %] characters.</span>
636                 <div class="hint">Card number must be between [% minlength_cardnumber | html %] and [% maxlength_cardnumber | html %] characters.
637           [% ELSIF maxlength_cardnumber %]
638                 <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber | html %]" maxlength="[% maxlength_cardnumber | html %]" />
639                 [% IF mandatorycardnumber %]<span class="required">Required</span>[% END %]<span id="cn_max" class="required">Card number must not be more than [% maxlength_cardnumber | html %] characters.</span>
640                 <div class="hint">Card number can be up to [% maxlength_cardnumber | html %] characters.
641           [% ELSE %]
642                 <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber | html %]" />
643                 [% IF mandatorycardnumber %]<span class="required">Required</span>[% END %]
644                 <div class="hint">There is no minimum or maximum character length.
645           [% END %]
646           [% IF autoMemberNum %]
647                 [% IF mandatorycardnumber %]
648                     <br/><span class="error">AutoMemberNum is set to enabled, but cardnumber is marked as mandatory in BorrowerMandatoryField: auto calc has been disabled.</span>
649                 [% ELSE %]
650                     <br/>Leave blank for auto calc during registration
651                 [% END %]
652           [% END %]
653                 </div><!--/hint div -->
654         </li>
655       [% END %]
656       [% UNLESS nobranchcode %]
657     <li>
658         <label for="libraries" class="required">Library:</label>
659         <select name="branchcode" size="1" id="libraries">
660             [% PROCESS options_for_libraries libraries => Branches.all( selected => userbranch, only_from_group => 1 ) %]
661         </select>
662         <span class="required">Required</span>
663     </li>
664         [% END %]
665     <li>
666         <label for="categorycode_entry" class="required">Category: </label>
667         <select id="categorycode_entry" name="categorycode" onchange="update_category_code(this);">
668         [% FOREACH typeloo IN typeloop %]
669             [% FOREACH categoryloo IN typeloo.categoryloop %]
670                 [% IF ( loop.first ) %]
671                     [% IF ( typeloo.typename_C ) %]<optgroup label="Child">[% END %]
672                     [% IF ( typeloo.typename_A ) %]<optgroup label="Adult">[% END %]
673                     [% IF ( typeloo.typename_S ) %]<optgroup label="Staff">[% END %]
674                     [% IF ( typeloo.typename_I ) %]<optgroup label="Organization">[% END %]
675                     [% IF ( typeloo.typename_P ) %]<optgroup label="Professional">[% END %]
676                     [% IF ( typeloo.typename_X ) %]<optgroup label="Statistical">[% END %]
677                 [% END %]
678                 [% IF ( categoryloo.categorycodeselected ) %]
679                     <option value="[% categoryloo.categorycode | html %]" selected="selected" data-typename="[% typeloo.typename | html %]">[% categoryloo.categoryname | html %]</option>
680                 [% ELSE %]
681                     <option value="[% categoryloo.categorycode | html %]" data-typename="[% typeloo.typename | html %]">[% categoryloo.categoryname | html %]</option>
682                 [% END %]
683                 [% IF ( loop.last ) %]
684                     </optgroup>
685                 [% END %]
686             [% END %]
687        [% END %]
688        </select>
689        <span class="required">Required</span>
690     </li>
691         [% UNLESS nosort1 %]
692     <li>
693       [% IF ( mandatorysort1 ) %]
694         <label for="sort1" class="required">
695       [% ELSE %]
696         <label for="sort1">
697       [% END %]
698       Sort 1: </label>
699       [% PROCESS 'av-build-dropbox.inc' name="sort1", category="Bsort1", default=sort1, size = 20 %]
700       [% IF ( mandatorysort1 ) %]<span class="required">Required</span>[% END %]
701     </li>
702         [% END %]
703         [% UNLESS nosort2 %]
704     <li>
705     [% IF ( mandatorysort2 ) %]
706     <label for="sort2" class="required">
707     [% ELSE %]
708     <label for="sort2">
709     [% END %]
710     Sort 2: </label>
711     [% PROCESS 'av-build-dropbox.inc' name="sort2", category="Bsort2", default=sort2, size = 20 %]
712     [% IF ( mandatorysort2 ) %]<span class="required">Required</span>[% END %]
713     </li>
714         [% END %]
715     [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
716       <li><label for="checkprevcheckout">Check for previous checkouts: </label>
717         <select name="checkprevcheckout" id="checkprevcheckout">
718         [% IF ( checkprevcheckout == 'yes' ) %]
719           <option value="yes" selected="selected">Yes if settings allow it</option>
720           <option value="no">No if settings allow it</option>
721           <option value="inherit">Inherit from settings</option>
722         [% ELSIF ( checkprevcheckout == 'no' ) %]
723           <option value="yes">Yes if settings allow it</option>
724           <option value="no" selected="selected">No if settings allow it</option>
725           <option value="inherit">Inherit from settings</option>
726         [% ELSE %]
727           <option value="yes">Yes if settings allow it</option>
728           <option value="no">No if settings allow it</option>
729           <option value="inherit" selected="selected">Inherit from settings</option>
730         [% END %]
731         </select>
732        </li>
733      [% END %]
734     [% IF Koha.Preference('TranslateNotices') %]
735         <li>
736             <label for="lang">Preferred language for notices: </label>
737             <select id="lang" name="lang">
738                 <option value="default">Default</option>
739                 [% FOR language IN languages %]
740                     [% FOR sublanguage IN language.sublanguages_loop %]
741                         [% IF language.plural %]
742                             [% IF sublanguage.rfc4646_subtag == lang %]
743                                 <option value="[% sublanguage.rfc4646_subtag | html %]" selected="selected">[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
744                             [% ELSE %]
745                                 <option value="[% sublanguage.rfc4646_subtag | html %]">[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
746                             [% END %]
747                         [% ELSE %]
748                             [% IF sublanguage.rfc4646_subtag == lang %]
749                                 <option value="[% sublanguage.rfc4646_subtag | html %]" selected="selected">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
750                             [% ELSE %]
751                                 <option value="[% sublanguage.rfc4646_subtag | html %]">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
752                             [% END %]
753                         [% END %]
754                     [% END %]
755                 [% END %]
756             </select>
757         </li>
758     [% END %]
759    </ol>
760   </fieldset>
761     [% UNLESS nodateenrolled &&  noopacnote && noborrowernotes %]
762         <fieldset class="rows" id="memberentry_subscription">
763         <legend id="library_setup_lgd">Library set-up</legend><ol>
764         [% UNLESS nodateenrolled %]
765                 <li>
766                         [% IF ( mandatorydateenrolled ) %]
767             <label for="from" class="required">
768                         [% ELSE %]
769             <label for="from">
770                         [% END %]
771                         Registration date: </label>
772             [% IF ( dateformat == "metric" ) %]
773                 <input type="text" id="from" name="dateenrolled"  maxlength="10" size="10" onchange="CheckDate(document.form.dateenrolled);check_manip_date('verify');" value="[% dateenrolled | html %]" class="datepickerfrom" />
774             [% ELSE %]
775                 <input type="text" id="from" name="dateenrolled"  maxlength="10" size="10" value="[% dateenrolled | html %]" class="datepickerfrom" />
776             [% END %]
777                 [% IF ( mandatorydateenrolled ) %]<span class="required">Required</span>[% END %]
778                 [% IF ( ERROR_dateenrolled ) %]<span class="required">(Error)</span>[% END %]
779                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
780                 </li>
781         [% END %]
782         [% UNLESS nodateexpiry %]
783                 <li>
784         [% ELSE %]
785                 <li style="display:none">
786         [% END %]
787                         [% IF ( mandatorydateexpiry ) %]
788             <label for="to" class="required">
789                         [% ELSE %]
790             <label for="to">
791                         [% END %]
792                         Expiry date (leave blank for auto calc): </label>
793             [% IF ( dateformat == "metric" ) %]
794                                 [% UNLESS ( opadd ) %]
795                     <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');" value="[% dateexpiry | html UNLESS opduplicate %]" class="datepickerto" />
796                                 [% ELSE %]
797                     <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');" class="datepickerto" />
798                                 [% END %]
799                         [% ELSE %]
800                                 [% UNLESS ( opadd ) %]
801                 <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" value="[% dateexpiry | html UNLESS opduplicate %]" class="datepickerto" />
802                                 [% ELSE %]
803                 <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" value="[% dateexpiry | html %]" class="datepickerto" />
804                                 [% END %]
805                         [% END %]
806                 [% IF ( mandatorydateexpiry ) %]<span class="required">Required</span>[% END %]
807                 [% IF ( ERROR_dateexpiry ) %]<span class="required">(Error)</span>[% END %]
808                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
809                 </li>
810         [% UNLESS noopacnote %]
811                 <li>
812                         [% IF ( mandatoryopacnote ) %]
813                                 <label for="opacnote" class="required">
814                         [% ELSE %]
815                                 <label for="opacnote">
816             [% END %]
817                         OPAC note: </label>
818             <textarea id="opacnote" name="opacnote" cols="55" rows="5">[% opacnote | html UNLESS opduplicate %]</textarea>
819                         <div class="hint">This message appears on this patron's user page in the OPAC</div>
820           [% IF ( mandatoryopacnote ) %]<span class="required">Required</span>[% END %]
821                 </li>
822         [% END %]
823         [% UNLESS noborrowernotes %]
824                 <li>
825             [% IF ( mandatoryborrowernotes ) %]
826                                 <label for="borrowernotes" class="required">
827                         [% ELSE %]
828                                 <label for="borrowernotes">
829                         [% END %]
830                         Circulation note: </label>
831             <textarea id="borrowernotes" name="borrowernotes" cols="55" rows="5">[% borrowernotes | html UNLESS opduplicate %]</textarea>
832                         <div class="hint">This message displays when checking out to this patron</div>
833           [% IF ( mandatoryborrowernotes ) %]<span class="required">Required</span>[% END %]
834                 </li>
835         [% END %]
836                 </ol>
837         </fieldset>
838     [% END # hide fieldset %]
839
840     [% UNLESS nouserid && nopassword %]
841         <fieldset class="rows" id="memberentry_userid">
842         <legend id="opac_staff_login_lgd">OPAC/Staff login</legend><ol>
843         [% UNLESS nouserid %]
844                 <li>
845                         [% IF ( mandatoryuserid ) %]
846                         <label for="userid" class="required">
847                         [% ELSE %]
848                         <label for="userid">
849                         [% END %]
850                         Username: </label>
851
852 [% IF ( NoUpdateLogin ) %]
853         [% IF ( opduplicate ) %]
854                 <input type="text" id="userid" name="userid" size="20" disabled="disabled" />
855         [% ELSE %]
856                 <input type="text" id="userid" name="userid" size="20" disabled="disabled" value="[% userid | html %]" />
857         [% END %]
858 [% ELSE %]
859         [% IF ( opduplicate ) %]
860                 <input type="text" id="userid" name="userid" size="20" value="" />
861         [% ELSE %]
862                 <input type="text" id="userid" name="userid" size="20" value="[% userid | html %]" />
863         [% END %]
864 [% END %]
865
866 [%# Dummy input to avoid Firefox from using userid/password saved for authentication %]
867 <input type="text" disabled="disabled" style="display:none" />
868
869           [% IF ( mandatoryuserid ) %]<span class="required">Required</span>[% END %]
870                 </li>
871         [%END %]
872         [% UNLESS nopassword %]
873                 <li>
874                         [% IF ( mandatorypassword ) %]
875                         <label for="password" class="required">
876                         [% ELSE %]
877                         <label for="password">
878                         [% END %]
879                         Password: </label>
880                         [% IF ( opadd ) %]
881                         [% IF ( NoUpdateLogin ) %]
882                                 [% IF ( opduplicate ) %]
883                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" />
884                                 [% ELSE %]
885                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" value="[% password | html %]" />
886                                 [% END %]
887 [% ELSE %]
888                                 [% IF ( opduplicate ) %]
889                                         <input type="password" id="password" name="password" size="20" />
890                                 [% ELSE %]
891                                         <input type="password" id="password" name="password" size="20" value="[% password | html %]" />
892                                 [% END %]
893 [% END %]
894                         [% ELSE %]
895                         [% IF ( password ) %]
896                                 [% IF ( NoUpdateLogin ) %]
897                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" value="****" />
898                                 [% ELSE %]
899                                         [% IF ( opduplicate ) %]
900                                                 <input type="password" id="password" name="password" size="20" />
901                                         [% ELSE %]
902                                                 <input type="password" id="password" name="password" size="20" value="****" />
903                                         [% END %]
904                                 [% END %]
905                         [% ELSE %]
906                                 [% IF ( NoUpdateLogin ) %]
907                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" value="" />
908                                 [% ELSE %]
909                                         <input type="password" id="password" name="password" size="20" value="" />
910                                 [% END %]
911                         [% END %]
912                         [% END %]
913             [% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %]
914             [% IF ( ERROR_password_too_short ) %]<span class="required">Password is too short</span>[% END %]
915             [% IF ( ERROR_password_too_weak ) %]<span class="required">Password is too weak</span>[% END %]
916             [% IF ( ERROR_password_has_whitespaces ) %]<span class="required">Password has leading or trailing whitespaces</span>[% END %]
917             <div class="hint">Minimum password length: [% minPasswordLength | html %]</div>
918                 </li>
919                 <li>
920                         [% IF ( mandatorypassword ) %]
921                         <label for="password2" class="required">
922                         [% ELSE %]
923                         <label for="password2">
924                         [% END %]
925                         Confirm password: </label>
926                         [% IF ( opadd ) %]
927                         [% IF ( NoUpdateLogin ) %]
928                                 [% IF ( opduplicate ) %]
929                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" />
930                                 [% ELSE %]
931                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" value="[% password | html %]" />
932                                 [% END %]
933 [% ELSE %]
934                                 [% IF ( opduplicate ) %]
935                                         <input type="password" id="password2" name="password2" size="20" />
936                                 [% ELSE %]
937                                         <input type="password" id="password2" name="password2" size="20" value="[% password | html %]" />
938                                 [% END %]
939 [% END %]
940                         [% ELSE %]
941                         [% IF ( password ) %]
942                                 [% IF ( NoUpdateLogin ) %]
943                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" value="****" />
944                                 [% ELSE %]
945                                         [% IF ( opduplicate ) %]
946                                                 <input type="password" id="password2" name="password2" size="20" />
947                                         [% ELSE %]
948                                                 <input type="password" id="password2" name="password2" size="20" value="****" />
949                                         [% END %]
950                                 [% END %]
951                         [% ELSE %]
952                                 [% IF ( NoUpdateLogin ) %]
953                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" value="" />
954                                 [% ELSE %]
955                                         <input type="password" id="password2" name="password2" size="20" value="" />
956                                 [% END %]
957                         [% END %]
958                         [% END %]
959           [% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %][% IF ( ERROR_password_mismatch ) %]<span class="required">Passwords do not match</span>[% END %]
960                 </li>
961                 </ol>
962                 </fieldset>
963         [% END # hide fieldset %][% END %]
964                 <!--this zones are not necessary in modif mode -->
965         [% UNLESS ( opadd || opduplicate ) %]
966         <fieldset class="rows" id="memberentry_account_flags">
967             <legend id="account_flags_lgd">Patron account flags</legend>
968                         <ol class="radio">
969                         [% FOREACH flagloo IN flagloop %]
970                                 <li><label class="radio" for="yes[% flagloo.name | html %]">
971                 [% IF ( flagloo.key == 'gonenoaddress' ) %]Gone no address:[% END %]
972                 [% IF ( flagloo.key == 'lost' ) %]Lost card:[% END %]
973                 </label>
974                 [% IF CAN_user_circulate_manage_restrictions %]
975                             <label for="yes[% flagloo.name | html %]">
976                                 [% IF ( flagloo.yes ) %]
977                                 <input type="radio" id="yes[% flagloo.name | html %]" name="[% flagloo.name | html %]" value="1" checked="checked" />
978                                 [% ELSE %]
979                                 <input type="radio" id="yes[% flagloo.name | html %]" name="[% flagloo.name | html %]" value="1" />
980                                 [% END %]
981                             Yes </label>
982                             <label for="no[% flagloo.name | html %]">
983                                 [% IF ( flagloo.no ) %]
984                                 <input type="radio" id="no[% flagloo.name | html %]" name="[% flagloo.name | html %]" value="0" checked="checked"/>
985                                 [% ELSE %]
986                                 <input type="radio" id="no[% flagloo.name | html %]" name="[% flagloo.name | html %]" value="0" />
987                                 [% END %]
988                             No </label>
989                 [% ELSE %]
990                   [% IF flagloo.yes %]Yes[% ELSE %]No[% END %]
991                 [% END %]
992
993             </li>
994                         [% END %]
995
996                         </ol>
997                         </fieldset>
998
999               <fieldset class="rows" id="memberentry_restrictions">
1000                 <legend id="restrictions_lgd">Patron restrictions</legend>
1001
1002                 [% IF ( debarments ) %]
1003                     <table>
1004                         <thead>
1005                             <tr>
1006                                  <th>Type</th>
1007                                  <th>Comment</th>
1008                                  <th>Expiration</th>
1009                                  <th>Created</th>
1010                                  [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
1011                                    <th>Remove?</th>
1012                                  [% END %]
1013                             </tr>
1014                         </thead>
1015
1016                         <tbody>
1017                             [% FOREACH d IN debarments %]
1018                                 <tr>
1019                                     <td>[% d.type | html %]</td>
1020                                     <td>
1021                                     [% IF d.comment.search('OVERDUES_PROCESS') %]
1022                                         Restriction added by overdues process [% d.comment.remove('OVERDUES_PROCESS ') | $raw %]
1023                                     [% ELSE %]
1024                                         [% d.comment | $raw %]
1025                                     [% END %]
1026                                     </td>
1027                                     <td>[% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] <i>Indefinite</i> [% END %]</td>
1028                                     <td>[% d.created | $KohaDates %]</td>
1029                                     [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
1030                                       <td>
1031                                         <input type="checkbox" id="debarment_[% d.borrower_debarment_id | html %]" name="remove_debarment" value="[% d.borrower_debarment_id | html %]" />
1032                                       </td>
1033                                     [% END %]
1034                                 </tr>
1035                             [% END %]
1036                         </tbody>
1037                     </table>
1038                 [% ELSE %]
1039                     <p>Patron is currently unrestricted.</p>
1040                 [% END %]
1041
1042                 [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
1043                     <p><a href="#" id="add_manual_restriction">Add manual restriction</a></p>
1044                     <fieldset id="manual_restriction_form">
1045                         <input type="hidden" id="add_debarment" name="add_debarment" value="0" />
1046                         <legend id="manual_restriction_lgd">Add manual restriction</legend>
1047                         <ol>
1048                             <li><label for="debarred_comment">Comment: </label><input type="text" id="debarred_comment" name="debarred_comment" onchange="$('#add_debarment').val(1);" /></li>
1049                             <li><label for="debarred_expiration">Expiration: </label><input name="debarred_expiration" id="debarred_expiration" size="10" value="" class="datepicker" onchange="$('#add_debarment').val(1);" type="text" />
1050                                     <a href='javascript:void(0)' onclick="$('#debarred_expiration').val('');">Clear date</a></li>
1051
1052                         </ol>
1053                         <p>
1054                             <a class="cancel" id="cancel_manual_restriction" href="#">Cancel</a>
1055                         </p>
1056                     </fieldset>
1057                 [% END %]
1058             </fieldset>
1059                 [% END %]
1060
1061 [% END %]
1062
1063 [% IF ( step_7 ) %]
1064 [% IF Koha.Preference('HouseboundModule') %]
1065   <fieldset class="rows" id="memberentry_housebound_roles">
1066     <legend id="housebound_roles">Housebound roles</legend>
1067     <ol class="radio">
1068       <li>
1069         <label class="radio" for="housebound_chooser">
1070           Chooser:
1071         </label>
1072         [% IF ( housebound_role.housebound_chooser == 1 ) %]
1073         <label for="yes_housebound_chooser">Yes </label>
1074         <input type="radio" id="yes_housebound_chooser"
1075                name="housebound_chooser" value="1"
1076                checked="checked" />
1077         <label for="no_housebound_chooser">No </label>
1078         <input type="radio" id="no_housebound_chooser"
1079                name="housebound_chooser" value="0" />
1080         [% ELSE %]
1081         <label for="yes_housebound_chooser">Yes </label>
1082         <input type="radio" id="yes_housebound_chooser"
1083                name="housebound_chooser" value="1" />
1084         <label for="no_housebound_chooser">No </label>
1085         <input type="radio" id="no_housebound_chooser"
1086                name="housebound_chooser" value="0"
1087                checked="checked" />
1088         [% END %]
1089       </li>
1090       <li>
1091         <label class="radio" for="housebound_deliverer">Deliverer:</label>
1092         [% IF ( housebound_role.housebound_deliverer == 1 ) %]
1093         <label for="yes_housebound_deliverer">Yes </label>
1094         <input type="radio" id="yes_housebound_deliverer"
1095                name="housebound_deliverer" value="1"
1096                checked="checked" />
1097         <label for="no_housebound_deliverer">No </label>
1098         <input type="radio" id="no_housebound_deliverer"
1099                name="housebound_deliverer" value="0" />
1100         [% ELSE %]
1101         <label for="yes_housebound_deliverer">Yes </label>
1102         <input type="radio" id="yes_housebound_deliverer"
1103                name="housebound_deliverer" value="1" />
1104         <label for="no_housebound_deliverer">No </label>
1105         <input type="radio" id="no_housebound_deliverer"
1106                name="housebound_deliverer" value="0"
1107                checked="checked" />
1108         [% END %]
1109       </li>
1110     </ol>
1111   </fieldset>
1112 [% END # hide fieldset %]
1113 [% END # IF step_7 %]
1114
1115 [% IF ( step_4 ) %]
1116 [% IF Koha.Preference('ExtendedPatronAttributes') %][% UNLESS ( no_patron_attribute_types ) %]
1117   <fieldset class="rows" id="memberentry_patron_attributes">
1118     <legend id="patron_attributes_lgd">Additional attributes and identifiers</legend>
1119     <input type="hidden" name="setting_extended_patron_attributes" value="1" />
1120     [% FOREACH pa_loo IN patron_attributes %]
1121         <ol class="attributes_table">
1122             [% IF pa_loo.class %]
1123                 <fieldset id="aai_[% pa_loo.class | html %]">
1124                 <legend id="[% pa_loo.class | html %]_lgd">[% pa_loo.lib | html %]</legend>
1125             [% END %]
1126             [% FOREACH patron_attribute IN pa_loo.items %]
1127                 <li data-category_code="[% patron_attribute.category_code | html %]">
1128                     <label for="[% patron_attribute.form_id | html %]">[% patron_attribute.description | html %]: </label>
1129                         [% IF ( patron_attribute.use_dropdown ) %]
1130                             <select id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]">
1131                                 <option value=""></option>
1132                                 [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
1133                                     [% IF auth_val_loo.authorised_value == patron_attribute.value %]
1134                                         <option value="[% auth_val_loo.authorised_value | html %]" selected="selected">
1135                                             [% auth_val_loo.lib | html %]
1136                                         </option>
1137                                     [% ELSE %]
1138                                         <option value="[% auth_val_loo.authorised_value | html %]" >
1139                                             [% auth_val_loo.lib | html %]
1140                                         </option>
1141                                     [% END %]
1142                                 [% END %]
1143                             </select>
1144                         [% ELSE %]
1145                             <textarea rows="2" cols="30" id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]">[% patron_attribute.value | html %]</textarea>
1146                         [% END %]
1147                         <input type="hidden" id="[% patron_attribute.form_id | html %]_code" name="[% patron_attribute.form_id | html %]_code" value="[% patron_attribute.code | html %]" />
1148                         <a href="#" onclick="clear_entry(this); return false;"><i class="fa fa-fw fa-trash"></i> Clear</a>
1149                         [% IF ( patron_attribute.repeatable ) %]
1150                         <a href="#" onclick="clone_entry(this); return false;"><i class="fa fa-fw fa-plus"></i> New</a>
1151                         [% END %]
1152                 </li>
1153             [% END %]
1154             [% IF pa_loo.class %]</fieldset>[% END %]
1155         </ol>
1156     [% END %]
1157   </fieldset>
1158 [% END %][% END %][% END %]
1159
1160 [% IF ( step_5 ) %][% IF ( EnhancedMessagingPreferences ) %]
1161   <fieldset class="rows" id="memberentry_messaging_prefs">
1162     <legend id="patron_messaging_prefs_lgd">Patron messaging preferences</legend>
1163     <div id="messaging_prefs_loading" class="form-message" style="display:none">
1164         <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading new messaging defaults
1165     </div>
1166     <input type="hidden" name="setting_messaging_prefs" value="1" />
1167     [% INCLUDE 'messaging-preference-form.inc' %]
1168     [% IF ( SMSSendDriver ) %]
1169         <p><label for="SMSnumber">SMS number:</label>
1170             <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber | html %]" />
1171             <span class="hint">SMS number should be in the format 1234567890 or +11234567890</span>
1172         </p>
1173         [% UNLESS nosms_provider_id %]
1174         <p>
1175             <label for="sms_provider_id">SMS provider:</label>
1176             <select id="sms_provider_id" name="sms_provider_id">
1177                 <option value="">Unknown</option>
1178                 [% FOREACH s IN sms_providers %]
1179                     [% IF s.id == sms_provider_id %]
1180                         <option value="[% s.id | html %]" selected="selected">[% s.name | html %]</option>
1181                     [% ELSE %]
1182                         <option value="[% s.id | html %]">[% s.name | html %]</option>
1183                     [% END %]
1184                 [% END %]
1185             </select>
1186         </p>
1187         [% END %]
1188     [% END %]
1189   </fieldset>
1190 [% END %] [% END %]
1191
1192 </form>
1193
1194 [% IF quickadd && opadd  && !check_member %]
1195     <form id="quick_add_form" class="toggler">
1196         <fieldset class="rows quick_add"><legend>Quick add</legend>
1197             <ol id="quick_add_list">
1198             </ol>
1199         </fieldset>
1200     </form>
1201 [% END %]
1202
1203 [% END %]
1204             </main>
1205         </div> <!-- /.col-sm-10.col-sm-push-2 -->
1206
1207         [% UNLESS ( opadd ) %]
1208             <div class="col-sm-2 col-sm-pull-10">
1209                 <aside>
1210                     [% INCLUDE 'circ-menu.inc' %]
1211                 </aside>
1212             </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1213         [% END %]
1214      </div> <!-- /.row -->
1215
1216 [% MACRO jsinclude BLOCK %]
1217     [% Asset.js("lib/hc-sticky.js") | $raw %]
1218     [% INCLUDE 'calendar.inc' %]
1219     [% INCLUDE 'str/members-menu.inc' %]
1220     [% Asset.js("js/members-menu.js") | $raw %]
1221     <script>
1222         function update_cardnumber_warning(size){
1223             var max_len = [% maxlength_cardnumber | html %];
1224             if ( size >= max_len ) {
1225                 $("#cn_max").show();
1226             } else {
1227                 $("#cn_max").hide();
1228             }
1229         }
1230         var Sticky;
1231         $(document).ready(function() {
1232
1233                 $("#saverecord").css({ 'margin-left': 0 });
1234
1235             Sticky = $("#toolbar");
1236             Sticky.hcSticky({
1237                 stickTo: "main",
1238                 stickyClass: "floating"
1239             });
1240
1241             [% IF categorycode %]
1242                 update_category_code( "[% categorycode | html %]" );
1243             [% ELSE %]
1244                 if ( $("#categorycode_entry").length > 0 ){
1245                     var category_code = $("#categorycode_entry").find("option:selected").val();
1246                     update_category_code( category_code );
1247                 }
1248             [% END %]
1249
1250             [% IF guarantor %]
1251                 select_user( '[% guarantor.borrowernumber | html %]', [% To.json( guarantor.unblessed ) | $raw %] );
1252             [% END %]
1253
1254             $("#cn_max").hide();
1255             var content;
1256             $("#cardnumber").on("keydown", function(e){
1257                 content = $(this).val();
1258             });
1259             $("#cardnumber").on("keyup", function(e){
1260                 // .val() will return the value of the input after the key has been released
1261                 var l = $(this).val().length;
1262                 if ( l == content.length + 1 ) { l--; }
1263                 update_cardnumber_warning(l);
1264             });
1265             $("#cardnumber").bind("paste", function(e){
1266                 var pastedData = e.originalEvent.clipboardData.getData('text');
1267                 update_cardnumber_warning(pastedData.length - 1);
1268             } );
1269             var toggle_quick_add = $(".toggle_quick_add");
1270             $(toggle_quick_add).click(function(e){
1271                 toggle_quick_add.toggle();
1272                 e.preventDefault();
1273                 var toggle_to = '';
1274                 var toggle_from = '';
1275                 if( $("#entryform:visible").length ) {
1276                     toggle_to = "#quick_add_form label";
1277                     toggle_from = "#entryform label";
1278                     $("#memberentry_guarantor").appendTo("#quick_add_form");
1279                 } else {
1280                     toggle_to="#entryform label";
1281                     toggle_from = "#quick_add_form label";
1282                     $("#memberentry_guarantor").appendTo("#memberentry_guarantor_anchor");
1283                 }
1284                 $(toggle_from).each(function() {
1285                     var input_label = $(this).attr('for');
1286                     if ( input_label == 'sex-male' || input_label == 'sex-none' || input_label == 'sex-female' ) {
1287                         $(toggle_to+"[for='"+input_label+"']").next().prop('checked', $(this).next().prop('checked') );
1288                         return;
1289                     }
1290                     $(toggle_to+"[for='"+input_label+"']").next().val(  $(this).next().val() );
1291                 });
1292
1293                 $(".toggler").toggle();
1294             });
1295
1296             $("#save_quick_add").click(function(){
1297                 $("#quick_add_form").validate();
1298                 if( $("#quick_add_form").valid()){
1299                     $('.toggle_quick_add').click();
1300                     $("#memberentry_guarantor").appendTo("#memberentry_guarantor_anchor");
1301                     $('#saverecord').click();
1302                 }
1303                 else {return false;}
1304             });
1305
1306             $("#saverecord").click(function(){
1307                 if( check_form_borrowers() ){
1308                     $("#entryform").submit();
1309                 }
1310             });
1311
1312             $('#duplicate').on('click', function() {
1313                 $("input[name='op']").val('modify');
1314                 $("input[name='borrowernumber']").val('[% check_member | html %]');
1315                 $("input[name='check_member']").val('');
1316                 $('#entryform').submit();
1317             });
1318
1319             $('#not-duplicate').on('click', function() {
1320                 $("input[name='nodouble']").val('1');
1321                 $('#entryform').submit();
1322             });
1323         });
1324
1325         var MSG_SEPARATOR = _("Separator must be / in field %s");
1326         var MSG_INCORRECT_DAY = _("Invalid day entered in field %s");
1327         var MSG_INCORRECT_MONTH = _("Invalid month entered in field %s");
1328         var MSG_INCORRECT_YEAR = _("Invalid year entered in field %s");
1329         var MSG_DUPLICATE_PATRON = _("Warning: Duplicate patron");
1330         var MSG_DUPLICATE_ORGANIZATION = _("Warning: Duplicate organization");
1331         var MSG_LATE_EXPIRY = _("Warning: Expiration date falls before enrollment date");
1332         var MSG_DUPLICATE_SUSPICION = _("Please confirm whether this is a duplicate patron");
1333         var MSG_MONTH = _("%s month")
1334         var MSG_MONTHS = _("%s months")
1335         var MSG_YEAR = _("%s year")
1336         var MSG_YEARS = _("%s years")
1337         var LABEL_CHANGE = _("Change");
1338         var LABEL_SET_TO_PATRON = _("Set to patron");
1339         var LABEL_AGE = _("Age");
1340         var MSG_MESSAGING_DFEAULTS = _("Change messaging preferences to default for this category?");
1341
1342         [% IF quickadd && opadd  && !check_member %]
1343             $(document).ready(function () {
1344
1345                 $("#entryform,#saverecord").hide();
1346                 [% q_add_f = Koha.Preference('PatronQuickAddFields').split('\|') %]
1347                 var qaddfields = [[% FOREACH field IN q_add_f.unique %]"[% field | html %]",[% END %]];
1348                 $("#entryform label").each(function () {
1349                     var input_label = $(this).attr('for');
1350                     if ( input_label == 'sex-female' ) {
1351                         input_label='sex';
1352                     }
1353                     else if ( input_label == 'btitle' ) {
1354                         input_label='title';
1355                     }
1356                     if( qaddfields.indexOf( input_label ) != -1 || $(this).attr('class') == 'required' ){
1357                        $(this).parent().clone().appendTo("#quick_add_list");
1358                        [% UNLESS mandatorypassword %]
1359                              if( input_label == 'password' ) $("#entryform label[for='password2']").parent().clone().appendTo("#quick_add_list");
1360                        [% END %]
1361                     }
1362                 });
1363                 if ( $("#memberentry_guarantor").length ) {
1364                     $("#memberentry_guarantor").appendTo("#quick_add_form");
1365                 }
1366                 $("#quick_add_form").show();
1367             });
1368         [% END %]
1369         $("#guarantor_template").hide();
1370
1371     </script>
1372     [% Asset.js("js/members.js") | $raw %]
1373     [% Asset.js("js/messaging-preference-form.js") | $raw %]
1374     [% PROCESS 'password_check.inc' %]
1375     [% PROCESS 'add_password_check' new_password => 'password' %]
1376 [% END %]
1377
1378 [% INCLUDE 'intranet-bottom.inc' %]