Bug 27618: Don't show dropdown if PatronSelfRegistrationLibraryList only has one...
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-memberentry.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE AuthorisedValues %]
4 [% USE Categories %]
5 [% USE Koha %]
6 [% USE Branches %]
7 [% USE KohaDates %]
8 [% USE Math %]
9 [% SET userupdateview = 1 %]
10 [% BLOCK streetnumber %]
11     [% UNLESS hidden.defined('streetnumber') %]
12         <li>
13             [% IF mandatory.defined('streetnumber') %]
14                 <label for="borrower_streetnumber" class="required">Street number:</label>
15             [% ELSE %]
16                 <label for="borrower_streetnumber">Street number:</label>
17             [% END %]
18
19             <input type="text" id="borrower_streetnumber" name="borrower_streetnumber" value="[% borrower.streetnumber | html %]" />
20             [% IF mandatory.defined('streetnumber') %]<span class="required">Required</span>[% END %]
21         </li>
22     [% END %]
23 [% END %]
24
25 [% INCLUDE 'doc-head-open.inc' %]
26     <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo; [% IF action == 'edit' %]Update your personal details[% ELSE %]Register a new account[% END %]</title>
27 [% INCLUDE 'doc-head-close.inc' %]
28 [% BLOCK cssinclude %][% END %]
29 </head>
30
31 [% IF action == 'edit' %]
32 [% INCLUDE 'bodytag.inc' bodyid='opac-patron-update' %]
33 [% ELSE %]
34 <body id="opac-patron-registration" class="opac">
35 [% END %]
36 [% INCLUDE 'masthead.inc' %]
37
38 <div class="main">
39     <nav aria-label="breadcrumb">
40         <ul class="breadcrumb">
41             <li class="breadcrumb-item">
42                 <a href="/cgi-bin/koha/opac-main.pl">Home</a>
43             </li>
44             [% IF action == 'edit' %]
45                 <li class="breadcrumb-item">
46                     <a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a>
47                 </li>
48                 <li class="breadcrumb-item active">
49                     <a href="#">Your personal details</a>
50                 </li>
51             [% ELSE %]
52                 <li class="breadcrumb-item active">
53                     <a href="#">Register a new account</a>
54                 </li>
55             [% END %]
56         </ul>
57     </nav>
58
59     <div class="container-fluid">
60         <div class="row">
61             <div class="col col-lg-2 order-2 order-lg-1">
62                 <div id="navigation">
63                     [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
64                 </div>
65             </div>
66             <div class="col-md-12 col-lg-10 order-1">
67                 [% IF action == 'edit' %]
68                     <div id="update-account" class="maincontent">
69                 [% ELSE %]
70                     <div id="add-account" class="maincontent">
71                 [% END %]
72
73                 [% IF action == 'edit' %]
74                     [% UNLESS OPACPatronDetails %]
75                         <div class="alert alert-info">To make changes to your record please contact the library.</div>
76                     [% END %]
77                     [% IF nochanges %]
78                         <div class="alert alert-error">No changes were made.</div>
79                     [% END %]
80                 [% END %]
81
82                 [% IF empty_mandatory_fields %]
83                     <div class="alert alert-warning">You have not filled out all required fields. Please fill in all missing fields and resubmit.</div>
84                 [% END %]
85
86                 [% IF invalid_form_fields %]
87                     <div class="alert alert-error"><strong>The following fields contain invalid information:</strong>
88                         <ul>
89                             [% FOREACH field IN invalid_form_fields %]
90                                 [% IF field == "email" %]<li>Contact information: <a href="#borrower_email">primary email address</a></li>[% END %]
91                                 [% IF field == "emailpro" %]<li>Contact information: <a href="#borrower_emailpro">secondary email address</a></li>[% END %]
92                                 [% IF field == "B_email" %]<li>Alternate address information: <a href="#borrower_B_email">email address</a></li>[% END %]
93                                 [% IF field == "password_match" %]<li>Passwords do not match! <a href="#password">password</a></li>[% END %]
94                                 [% IF field == "password_too_short" %]
95                                     <li>Password must be at least [% patron.category.effective_min_password_length | html %] characters long.</li>
96                                 [% END %]
97                                 [% IF field == "password_too_weak" %]
98                                     <li>Password must contain at least one digit, one lowercase and one uppercase.</li>
99                                 [% END %]
100                                 [% IF field == "password_has_whitespaces" %]
101                                     <li>Password must not contain leading or trailing whitespaces.</li>
102                                 [% END %]
103                                 [% IF field == "duplicate_email" %]
104                                     <li>This email address already exists in our database.</li>
105                                 [% END %]
106                                 [% IF field == "email_match" %]
107                                     <li>Emails do not match! <a href="#borrower_repeat_email">confirm email address</a></li>
108                                 [% END %]
109                             [% END %]
110                         </ul>
111                         <span>Please correct and resubmit.</span>
112                     </div>
113                 [% END %]
114
115                 [% IF cardnumber_wrong_length || cardnumber_already_exists %]
116                     <div class="alert alert-error">
117                         [% IF cardnumber_wrong_length %]
118                         <a href="#borrower_cardnumber"><strong>The entered card number is the wrong length.</strong></a>
119                         [% ELSIF cardnumber_already_exists %]
120                         <a href="#borrower_cardnumber"><strong>The entered card number is already in use.</strong></a>
121                         [% END %]
122                         <span>Please correct and resubmit.</span>
123                     </div>
124                 [% END %]
125
126                 [% IF failed_captcha %]
127                     <div class="alert alert-warning">You typed in the wrong characters in the box before submitting. Please try again.</div>
128                 [% END %]
129
130                 [% IF has_guarantor_flag && !Koha.Preference('OPACPrivacy') && ( Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') || Koha.Preference('AllowPatronToSetFinesVisibilityForGuarantor') ) %]
131                     <div class="row">
132                         <div class="col">
133                             <fieldset class="rows" id="memberentry_privacy">
134                                 <legend id="privacy_legend">Privacy</legend>
135                                 <ol>
136                                     [% IF Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %]
137                                     <li>
138                                         <label>Allow your guarantor to view your current checkouts?</label>
139                                         <select id="privacy_guarantor_checkouts">
140                                             <option value="0">No</option>
141                                             [% IF borrower.privacy_guarantor_checkouts %]
142                                                 <option value="1" selected="selected">Yes</option>
143                                             [% ELSE %]
144                                                 <option value="1">Yes</option>
145                                             [% END %]
146                                         </select>
147                                         <span class="hint">
148                                             <a id="update_privacy_guarantor_checkouts" href="#" class="btn btn-primary">Update</a>
149                                             <span id="update_privacy_guarantor_checkouts_message" class="alert" style="display:none"></span>
150                                         </span>
151                                     </li>
152                                     [% END %]
153
154                                     [% IF Koha.Preference('AllowPatronToSetFinesVisibilityForGuarantor') %]
155                                     <li>
156                                         <label>Allow your guarantor to view your current fines?</label>
157                                         <select id="privacy_guarantor_fines">
158                                             <option value="0">No</option>
159                                             [% IF borrower.privacy_guarantor_fines %]
160                                                 <option value="1" selected="selected">Yes</option>
161                                             [% ELSE %]
162                                                 <option value="1">Yes</option>
163                                             [% END %]
164                                         </select>
165                                         <span class="hint">
166                                             <a id="update_privacy_guarantor_fines" href="#" class="btn btn-primary">Update</a>
167                                             <span id="update_privacy_guarantor_fines_message" class="alert" style="display:none"></span>
168                                         </span>
169                                     </li>
170                                     [% END %]
171
172                                     <li>
173                                         <span class="hint">
174                                             Guaranteed by
175                                             [% FOREACH gr IN patron.guarantor_relationships %]
176                                                 [% SET g = gr.guarantor %]
177                                                 [% g.firstname | html %] [% g.surname | html %]
178                                                 [%- IF ! loop.last %], [% END %]
179                                             [% END %]
180                                         </span>
181                                     </li>
182                                 </ol>
183                             </fieldset>
184                         </div>
185                     </div>
186                 [% END %]
187
188                 [% IF ( extended_unique_id_failed_code ) %]
189                     <div class="alert" id="extended_unique_id_failed"><a href="#patron-attr-start-[% extended_unique_id_failed_code | uri %]">[% extended_unique_id_failed_description _ ': ' | html %]</a> Value is already in use ([% extended_unique_id_failed_value | html %])</div>
190                 [% END %]
191
192                 <form method="post" action="/cgi-bin/koha/opac-memberentry.pl" id="memberentry-form" autocomplete="off">
193
194                     [%# Following on one line for translatability %]
195                     [% UNLESS ( hidden.defined('cardnumber') || ( !borrower && Koha.Preference('autoMemberNum') ) ) && hidden.defined('dateexpiry') && hidden.defined('branchcode') && hidden.defined('categorycode') %]
196                         <div class="row">
197                             <div class="col">
198                                 <fieldset class="rows" id="memberentry_library">
199
200                                     <legend id="library_legend">Library</legend>
201                                         <ol>
202                                             [% UNLESS hidden.defined('cardnumber') || ( !borrower && Koha.Preference('autoMemberNum') ) %]
203                                             <li>
204                                                 [% IF mandatory.defined('cardnumber') %]
205                                                     <label for="borrower_cardnumber" class="required">Library card number:</label>
206                                                 [% ELSE %]
207                                                     <label for="borrower_cardnumber">Library card number:</label>
208                                                 [% END %]
209                                                 [% IF borrower && !(cardnumber_wrong_length || cardnumber_already_exists) %]
210                                                     [% borrower.cardnumber | html %]
211                                                 [% ELSE %]
212                                                     [% IF minlength_cardnumber == maxlength_cardnumber %]
213                                                         <input type="text" id="borrower_cardnumber" name="borrower_cardnumber" size="20" value="[% borrower.cardnumber | html %]" minlength="[% minlength_cardnumber | html %]" maxlength="[% maxlength_cardnumber | html %]" />
214                                                         [% IF ( mandatory.defined('cardnumber') ) %]<span class="required">Required</span>[% END %]
215                                                         <div class="hint">Card number must be exactly [% minlength_cardnumber | html %] characters.</div>
216                                                     [% ELSIF minlength_cardnumber && maxlength_cardnumber %]
217                                                         <input type="text" id="borrower_cardnumber" name="borrower_cardnumber" size="20" value="[% borrower.cardnumber | html %]" minlength="[% minlength_cardnumber | html %]" maxlength="[% maxlength_cardnumber | html %]" />
218                                                         [% IF ( mandatory.defined('cardnumber') ) %]<span class="required">Required</span>[% END %]
219                                                         <div class="hint">Card number must be between [% minlength_cardnumber | html %] and [% maxlength_cardnumber | html %] characters.</div>
220                                                     [% ELSIF maxlength_cardnumber %]
221                                                         <input type="text" id="borrower_cardnumber" name="borrower_cardnumber" size="20" value="[% borrower.cardnumber | html %]" maxlength="[% maxlength_cardnumber | html %]" />
222                                                         [% IF ( mandatory.defined('cardnumber') ) %]<span class="required">Required</span>[% END %]
223                                                         <div class="hint">Card number can be up to [% maxlength_cardnumber | html %] characters.</div>
224                                                     [% ELSE %]
225                                                         <input type="text" id="borrower_cardnumber" name="borrower_cardnumber" size="20" value="[% borrower.cardnumber | html %]" />
226                                                         [% IF ( mandatory.defined('cardnumber') ) %]<span class="required">Required</span>[% END %]
227                                                         <div class="hint">There is no minimum or maximum character length.</div>
228                                                     [% END %]
229                                                 [% END %]
230                                             </li>
231                                             [% END %]
232
233                                             [% UNLESS hidden.defined('dateexpiry') %]
234                                             <li>
235                                                 <label>Expiration date:</label>
236                                                 [% borrower.dateexpiry | $KohaDates  %]
237                                             </li>
238                                             [% END %]
239
240                                             [% UNLESS hidden.defined('branchcode') %]
241                                                 <li>
242                                                     [% IF ( libraries.size > 1 ) %]
243                                                         [% IF mandatory.defined('branchcode') %]
244                                                             <label for="borrower_branchcode" class="required">Home library:</label>
245                                                         [% ELSE %]
246                                                             <label for="borrower_branchcode">Home library:</label>
247                                                         [% END %]
248
249                                                         <select id="borrower_branchcode" name="borrower_branchcode">
250                                                             [% FOREACH l IN libraries %]
251                                                                 [% IF l.branchcode == borrower.branchcode %]
252                                                                     <option value="[% l.branchcode | html %]" selected="selected">[% l.branchname | html %]</option>
253                                                                 [% ELSE %]
254                                                                     <option value="[% l.branchcode | html %]">[% l.branchname | html %]</option>
255                                                                 [% END %]
256                                                             [% END %]
257                                                         </select>
258                                                     [% ELSE %]
259                                                         <span class="label">Home library:</span>
260                                                         [% FOREACH l IN libraries %]
261                                                             [% l.branchname | html %]
262                                                             <input type="hidden" name="borrower_branchcode" value="[% l.branchcode | html %]" />
263                                                         [% END %]
264                                                     [% END %]
265                                                 </li>
266                                             [% END %]
267
268                                             [% UNLESS hidden.defined('categorycode') %]
269                                                 <li>
270                                                     <label for="borrower_categorycode">
271                                                     Category:</label>
272
273                                                     [% IF borrower %]
274                                                         [% Categories.GetName( borrower.categorycode ) | html %]
275                                                         <input type="hidden" name="borrower_categorycode" value="[% borrower.categorycode | html %]" />
276                                                     [% ELSE %]
277                                                         <select id="borrower_categorycode" name="borrower_categorycode">
278                                                             [% FOREACH c IN Categories.all() %]
279                                                                 [% IF c.categorycode == Koha.Preference('PatronSelfRegistrationDefaultCategory') %]
280                                                                     <option value="[% c.categorycode | html %]" data-pwd-length="[% c.effective_min_password_length | html %]" data-pwd-strong="[% c.effective_require_strong_password | html %]" selected="selected">[% c.description | html %]</option>
281                                                                 [% ELSE %]
282                                                                     <option value="[% c.categorycode | html %]" data-pwd-length="[% c.effective_min_password_length | html %]" data-pwd-strong="[% c.effective_require_strong_password | html %]">[% c.description | html %]</option>
283                                                                 [% END %]
284                                                             [% END %]
285                                                         </select>
286                                                     [% END %]
287                                                 </li>
288                                             [% END %]
289                                         </ol>
290                                     </fieldset>
291                                 </div> <!-- /.col -->
292                             </div> <!-- /.row -->
293                     [% END # / defined 'branchcode' %]
294
295                     [%# Following on one line for translatability %]
296                     [% UNLESS hidden.defined('title') && hidden.defined('surname') && hidden.defined('firstname') && hidden.defined('dateofbirth') && hidden.defined('initials') && hidden.defined('othernames') && hidden.defined('sex') %]
297                         <div class="row">
298                             <div class="col">
299                                 <fieldset class="rows" id="memberentry_identity">
300                                     <legend id="identity_legend">Identity</legend>
301
302                                     <ol>
303                                         [% UNLESS hidden.defined('title') || !Koha.Preference('BorrowersTitles') %]
304                                             <li>
305                                                 [% IF mandatory.defined('title') %]
306                                                     <label for="borrower_title" class="required">Salutation:</label>
307                                                 [% ELSE %]
308                                                     <label for="borrower_title">Salutation:</label>
309                                                 [% END %]
310
311                                                 <select id="borrower_title" name="borrower_title">
312                                                     <option value=""></option>
313                                                     [% FOREACH mt IN Koha.Preference('BorrowersTitles').split('\|') %]
314                                                         [% IF mt == borrower.title %]
315                                                             <option value="[% mt | html %]" selected="selected">[% mt | html %]</option>
316                                                         [% ELSE %]
317                                                             <option value="[% mt | html %]">[% mt | html %]</option>
318                                                         [% END %]
319                                                     [% END %]
320                                                 </select>
321                                             </li>
322                                         [% END %]
323
324                                         [% UNLESS hidden.defined('surname') %]
325                                             <li>
326                                                 [% IF mandatory.defined('surname') %]
327                                                     <label for="borrower_surname" class="required">Surname:</label>
328                                                 [% ELSE %]
329                                                     <label for="borrower_surname">Surname:</label>
330                                                 [% END %]
331
332                                                 <input type="text" id="borrower_surname" name="borrower_surname" value="[% borrower.surname | html %]" />
333                                                 [% IF mandatory.defined('surname') %]<span class="required">Required</span>[% END %]
334                                             </li>
335                                         [% END %]
336
337                                         [% UNLESS hidden.defined('firstname') %]
338                                             <li>
339                                                 [% IF mandatory.defined('firstname') %]
340                                                     <label for="borrower_firstname" class="required">First name:</label>
341                                                 [% ELSE %]
342                                                     <label for="borrower_firstname">First name:</label>
343                                                 [% END %]
344
345                                                 <input type="text" id="borrower_firstname" name="borrower_firstname" value="[% borrower.firstname | html %]" />
346                                                 [% IF mandatory.defined('firstname') %]<span class="required">Required</span>[% END %]
347                                             </li>
348                                         [% END %]
349
350                                         [% UNLESS hidden.defined('dateofbirth') %]
351                                             <li>
352                                                 [% IF mandatory.defined('dateofbirth') %]
353                                                     <label for="borrower_dateofbirth" class="required">Date of birth:</label>
354                                                 [% ELSE %]
355                                                     <label for="borrower_dateofbirth">Date of birth:</label>
356                                                 [% END %]
357
358                                                 <input type="text" id="borrower_dateofbirth" name="borrower_dateofbirth" value="[% borrower.dateofbirth | $KohaDates %]" size="10" />
359
360                                                 [% UNLESS action == 'edit' && !OPACPatronDetails %]
361                                                     [% UNLESS ( mandatory.defined('dateofbirth') ) %]
362                                                         <a href="#" style="font-size:85%;text-decoration:none;" class="cleardate">Clear date</a>
363                                                     [% END %]
364                                                 [% END %]
365
366                                                 [% IF mandatory.defined('dateofbirth') %]<span class="required">Required</span>[% END %]
367                                             </li>
368                                         [% END %]
369
370                                         [% UNLESS hidden.defined('initials') %]
371                                             <li>
372                                                 [% IF mandatory.defined('initials') %]
373                                                     <label for="borrower_initials" class="required">Initials:</label>
374                                                 [% ELSE %]
375                                                     <label for="borrower_initials">Initials:</label>
376                                                 [% END %]
377
378                                                 <input type="text" id="borrower_initials" name="borrower_initials" value="[% borrower.initials | html %]" />
379                                                 [% IF mandatory.defined('initials') %]<span class="required">Required</span>[% END %]
380                                             </li>
381                                         [% END %]
382
383                                         [% UNLESS hidden.defined('othernames') %]
384                                             <li>
385                                                 [% IF mandatory.defined('othernames') %]
386                                                     <label for="borrower_othernames" class="required">Other names:</label>
387                                                 [% ELSE %]
388                                                     <label for="borrower_othernames">Other names:</label>
389                                                 [% END %]
390
391                                                 <input type="text" id="borrower_othernames" name="borrower_othernames" value="[% borrower.othernames | html %]" />
392                                                 [% IF mandatory.defined('othernames') %]<span class="required">Required</span>[% END %]
393                                             </li>
394                                         [% END %]
395
396                                         [% UNLESS hidden.defined('sex') %]
397                                             <li class="lradio">
398                                                 <label for="sex-female" class="radio inline"><span class="patronsex-female">Female:</span></label>
399                                                 [% IF borrower.sex == 'F' %]
400                                                     <input type="radio" name="borrower_sex" id="sex-female" value="F" checked="checked" />
401                                                 [% ELSE %]
402                                                     <input type="radio" name="borrower_sex" id="sex-female" value="F" />
403                                                 [% END %]
404
405                                                 <label for="sex-male" class="radio inline"><span class="patronsex-male">Male:</span></label>
406                                                 [% IF borrower.sex == 'M' %]
407                                                     <input type="radio" name="borrower_sex" id="sex-male" value="M" checked="checked" />
408                                                 [% ELSE %]
409                                                     <input type="radio" name="borrower_sex" id="sex-male" value="M" />
410                                                 [% END %]
411
412                                                 <label for="sex-other" class="radio inline"><span class="patronsex-other">Other:</span></label>
413                                                 [% IF borrower.sex == 'O' %]
414                                                     <input type="radio" name="borrower_sex" id="sex-other" value="O" checked="checked" />
415                                                 [% ELSE %]
416                                                     <input type="radio" name="borrower_sex" id="sex-other" value="O" />
417                                                 [% END %]
418
419                                                 <label for="sex-none" class="radio inline"><span class="patronsex-none">None specified:</span></label>
420                                                 [% IF borrower.sex == '' %]
421                                                     <input type="radio" name="borrower_sex" id="sex-none" value="" checked="checked" />
422                                                 [% ELSE %]
423                                                     <input type="radio" name="borrower_sex" id="sex-none" value="" />
424                                                 [% END %]
425                                             </li>
426                                         [% END %]
427                                     </ol>
428                                 </fieldset>
429                             </div> <!-- /.col -->
430                             [% IF ( display_patron_image ) %]
431                                 <div class="col-sm-2">
432                                     <p class="patronimage">
433                                        <img src="/cgi-bin/koha/opac-patron-image.pl" alt="" />
434                                     </p>
435                                 </div>
436                             [% END %]
437                         </div> <!-- /.row -->
438                     [% END # /UNLESS fields hidden %]
439
440                     [%# Following on one line for translatability %]
441                     [% UNLESS hidden.defined('streetnumber') && hidden.defined('address') && hidden.defined('address2') && hidden.defined('city') && hidden.defined('state') && hidden.defined('zipcode') && hidden.defined('country') %]
442                         <div class="row">
443                             <div class="col">
444                                 <fieldset class="rows" id="memberentry_mainaddress">
445                                     <legend id="mainaddress_legend">Main address</legend>
446
447                                     <ol>
448                                         [% IF Koha.Preference('AddressFormat') != 'de' %][% INCLUDE streetnumber %][% END %]
449
450                                         [% UNLESS hidden.defined('address') %]
451                                             <li>
452                                                 [% IF mandatory.defined('address') %]
453                                                     <label for="borrower_address" class="required">Address:</label>
454                                                 [% ELSE %]
455                                                     <label for="borrower_address">Address:</label>
456                                                 [% END %]
457
458                                                 <input type="text" id="borrower_address" name="borrower_address" value="[% borrower.address | html %]" />
459                                                 [% IF mandatory.defined('address') %]<span class="required">Required</span>[% END %]
460                                             </li>
461                                         [% END %]
462
463                                         [% IF Koha.Preference('AddressFormat') == 'de' %][% INCLUDE streetnumber %][% END %]
464
465                                         [% UNLESS hidden.defined('address2') %]
466                                             <li>
467                                                 [% IF mandatory.defined('address2') %]
468                                                     <label for="borrower_address2" class="required">Address 2:</label>
469                                                 [% ELSE %]
470                                                     <label for="borrower_address2">Address 2:</label>
471                                                 [% END %]
472
473                                                 <input type="text" id="borrower_address2" name="borrower_address2" value="[% borrower.address2 | html %]" />
474                                                 [% IF mandatory.defined('address2') %]<span class="required">Required</span>[% END %]
475                                             </li>
476                                         [% END %]
477
478                                         [% UNLESS hidden.defined('city') %]
479                                             <li>
480                                                 [% IF mandatory.defined('city') %]
481                                                     <label for="borrower_city" class="required">City:</label>
482                                                 [% ELSE %]
483                                                     <label for="borrower_city">City:</label>
484                                                 [% END %]
485
486                                                 <input type="text" id="borrower_city" name="borrower_city" value="[% borrower.city | html %]" />
487                                                 [% IF mandatory.defined('city') %]<span class="required">Required</span>[% END %]
488                                             </li>
489                                         [% END %]
490
491                                         [% UNLESS hidden.defined('state') %]
492                                             <li>
493                                                 [% IF mandatory.defined('state') %]
494                                                     <label for="borrower_state" class="required">State:</label>
495                                                 [% ELSE %]
496                                                     <label for="borrower_state">State:</label>
497                                                 [% END %]
498
499                                                 <input type="text" id="borrower_state" name="borrower_state" value="[% borrower.state | html %]" />
500                                                 [% IF mandatory.defined('state') %]<span class="required">Required</span>[% END %]
501                                             </li>
502                                         [% END %]
503
504                                         [% UNLESS hidden.defined('zipcode') %]
505                                             <li>
506                                                 [% IF mandatory.defined('zipcode') %]
507                                                     <label for="borrower_zipcode" class="required">ZIP/Postal code:</label>
508                                                 [% ELSE %]
509                                                     <label for="borrower_zipcode">ZIP/Postal code:</label>
510                                                 [% END %]
511
512                                                 <input type="text" id="borrower_zipcode" name="borrower_zipcode" value="[% borrower.zipcode | html %]" />
513                                                 [% IF mandatory.defined('zipcode') %]<span class="required">Required</span>[% END %]
514                                             </li>
515                                         [% END %]
516
517                                         [% UNLESS hidden.defined('country') %]
518                                             <li>
519                                                 [% IF mandatory.defined('country') %]
520                                                     <label for="borrower_country" class="required">Country:</label>
521                                                 [% ELSE %]
522                                                     <label for="borrower_country">Country:</label>
523                                                 [% END %]
524
525                                                 <input type="text" id="borrower_country" name="borrower_country" value="[% borrower.country | html %]" />
526                                                 [% IF mandatory.defined('country') %]<span class="required">Required</span>[% END %]
527                                             </li>
528                                         [% END %]
529
530                                     </ol>
531                                 </fieldset>
532                             </div> <!-- /.col -->
533                         </div> <!-- /.row -->
534                     [% END %]
535
536                     [%# Following on one line for translatability %]
537                     [% UNLESS hidden.defined('phone') && hidden.defined('phonepro') && hidden.defined('mobile') && hidden.defined('email') && hidden.defined('emailpro') && hidden.defined('fax') %]
538                         <div class="row">
539                             <div class="col">
540                                 <fieldset class="rows" id="memberentry_contact">
541                                     <legend id="contact_legend">Contact information</legend>
542
543                                     <ol>
544                                         [% UNLESS hidden.defined('phone') %]
545                                             <li>
546                                                 [% IF mandatory.defined('phone') %]
547                                                     <label for="borrower_phone" class="required">Primary phone:</label>
548                                                 [% ELSE %]
549                                                     <label for="borrower_phone">Primary phone:</label>
550                                                 [% END %]
551
552                                                 <input type="text" id="borrower_phone" name="borrower_phone" value="[% borrower.phone | html %]" />
553                                                 [% IF mandatory.defined('phone') %]<span class="required">Required</span>[% END %]
554                                             </li>
555                                         [% END %]
556
557                                         [% UNLESS hidden.defined('phonepro') %]
558                                             <li>
559                                                 [% IF mandatory.defined('phonepro') %]
560                                                     <label for="borrower_phonepro" class="required">Secondary phone:</label>
561                                                 [% ELSE %]
562                                                     <label for="borrower_phonepro">Secondary phone:</label>
563                                                 [% END %]
564
565                                                 <input type="text" id="borrower_phonepro" name="borrower_phonepro" value="[% borrower.phonepro | html %]" />
566                                                 [% IF mandatory.defined('phonepro') %]<span class="required">Required</span>[% END %]
567                                             </li>
568                                         [% END %]
569
570                                         [% UNLESS hidden.defined('mobile') %]
571                                             <li>
572                                                 [% IF mandatory.defined('mobile') %]
573                                                     <label for="borrower_mobile" class="required">Other phone:</label>
574                                                 [% ELSE %]
575                                                     <label for="borrower_mobile">Other phone:</label>
576                                                 [% END %]
577
578                                                 <input type="text" id="borrower_mobile" name="borrower_mobile" value="[% borrower.mobile | html %]" />
579                                                 [% IF mandatory.defined('mobile') %]<span class="required">Required</span>[% END %]
580                                             </li>
581                                         [% END %]
582
583                                         [% UNLESS hidden.defined('email') %]
584                                             <li>
585                                                 [% IF mandatory.defined('email') %]
586                                                     <label for="borrower_email" class="required">Primary email:</label>
587                                                 [% ELSE %]
588                                                     <label for="borrower_email">Primary email:</label>
589                                                 [% END %]
590
591                                                 <input type="text" id="borrower_email" name="borrower_email" value="[% borrower.email | html %]" />
592                                                 [% IF mandatory.defined('email') %]<span class="required">Required</span>[% END %]
593                                             </li>
594
595                                             [% IF action != 'edit' and Koha.Preference('PatronSelfRegistrationConfirmEmail') %]
596                                                 <li>
597                                                     [% IF mandatory.defined('email') %]
598                                                         <label for="borrower_repeat_email" class="required">Confirm primary email:</label>
599                                                     [% ELSE %]
600                                                         <label for="borrower_repeat_email">Confirm primary email:</label>
601                                                     [% END %]
602
603                                                     <input type="text" id="borrower_repeat_email" name="borrower_repeat_email" autocomplete=off>
604                                                     [% IF mandatory.defined('email') %]<span class="required">Required</span>[% END %]
605                                                 </li>
606                                             [% END %]
607                                         [% END %]
608
609                                         [% UNLESS hidden.defined('emailpro') %]
610                                             <li>
611                                                 [% IF mandatory.defined('emailpro') %]
612                                                     <label for="borrower_emailpro" class="required">Secondary email:</label>
613                                                 [% ELSE %]
614                                                     <label for="borrower_emailpro">Secondary email:</label>
615                                                 [% END %]
616
617                                                 <input type="text" id="borrower_emailpro" name="borrower_emailpro" value="[% borrower.emailpro | html %]" />
618                                                 [% IF mandatory.defined('emailpro') %]<span class="required">Required</span>[% END %]
619                                             </li>
620                                         [% END %]
621
622                                         [% UNLESS hidden.defined('fax') %]
623                                             <li>
624                                                 [% IF mandatory.defined('fax') %]
625                                                     <label for="borrower_fax" class="required">Fax:</label>
626                                                 [% ELSE %]
627                                                     <label for="borrower_fax">Fax:</label>
628                                                 [% END %]
629
630                                                 <input type="text" id="borrower_fax" name="borrower_fax" value="[% borrower.fax | html %]" />
631                                                 [% IF mandatory.defined('fax') %]<span class="required">Required</span>[% END %]
632                                             </li>
633                                         [% END %]
634                                     </ol>
635                                 </fieldset>
636                             </div> <!-- /.col -->
637                         </div> <!-- /.row -->
638                     [% END %]
639
640                     [%# Following on one line for translatability %]
641                     [% UNLESS hidden.defined('B_address') && hidden.defined('B_address2') && hidden.defined('B_city') && hidden.defined('B_state') && hidden.defined('B_zipcode') && hidden.defined('B_country') && hidden.defined('B_phone') && hidden.defined('B_email') && hidden.defined('contactnote') %]
642                         <div class="row">
643                             <div class="col">
644                                 <fieldset class="rows" id="memberentry_alternateaddress">
645                                     <legend id="alternateaddress_legend">Alternate address</legend>
646
647                                     <ol>
648                                         [% UNLESS hidden.defined('B_address') %]
649                                             <li>
650                                                 [% IF mandatory.defined('B_address') %]
651                                                     <label for="borrower_B_address" class="required">Address:</label>
652                                                 [% ELSE %]
653                                                     <label for="borrower_B_address">Address:</label>
654                                                 [% END %]
655
656                                                 <input type="text" id="borrower_B_address" name="borrower_B_address" value="[% borrower.B_address | html %]" />
657                                                 [% IF mandatory.defined('B_address') %]<span class="required">Required</span>[% END %]
658                                             </li>
659                                         [% END %]
660
661                                         [% UNLESS hidden.defined('B_address2') %]
662                                             <li>
663                                                 [% IF mandatory.defined('B_address2') %]
664                                                     <label for="borrower_B_address2" class="required">Address 2:</label>
665                                                 [% ELSE %]
666                                                     <label for="borrower_B_address2">Address 2:</label>
667                                                 [% END %]
668
669                                                 <input type="text" id="borrower_B_address2" name="borrower_B_address2" value="[% borrower.B_address2 | html %]" />
670                                                 [% IF mandatory.defined('B_address2') %]<span class="required">Required</span>[% END %]
671                                             </li>
672                                         [% END %]
673
674                                         [% UNLESS hidden.defined('B_city') %]
675                                             <li>
676                                                 [% IF mandatory.defined('B_city') %]
677                                                     <label for="borrower_B_city" class="required">City:</label>
678                                                 [% ELSE %]
679                                                     <label for="borrower_B_city">City:</label>
680                                                 [% END %]
681
682                                                 <input type="text" id="borrower_B_city" name="borrower_B_city" value="[% borrower.B_city | html %]" />
683                                                 [% IF mandatory.defined('B_city') %]<span class="required">Required</span>[% END %]
684                                             </li>
685                                         [% END %]
686
687                                         [% UNLESS hidden.defined('B_state') %]
688                                             <li>
689                                                 [% IF mandatory.defined('B_state') %]
690                                                     <label for="borrower_B_state" class="required">State:</label>
691                                                 [% ELSE %]
692                                                     <label for="borrower_B_state">State:</label>
693                                                 [% END %]
694
695                                                 <input type="text" id="borrower_B_state" name="borrower_B_state" value="[% borrower.B_state | html %]" />
696                                                 [% IF mandatory.defined('B_state') %]<span class="required">Required</span>[% END %]
697                                             </li>
698                                         [% END %]
699
700                                         [% UNLESS hidden.defined('B_zipcode') %]
701                                             <li>
702                                                 [% IF mandatory.defined('B_zipcode') %]
703                                                     <label for="borrower_B_zipcode" class="required">ZIP/Postal code:</label>
704                                                 [% ELSE %]
705                                                     <label for="borrower_B_zipcode">ZIP/Postal code:</label>
706                                                 [% END %]
707
708                                                 <input type="text" id="borrower_B_zipcode" name="borrower_B_zipcode" value="[% borrower.B_zipcode | html %]" />
709                                                 [% IF mandatory.defined('B_zipcode') %]<span class="required">Required</span>[% END %]
710                                             </li>
711                                         [% END %]
712
713                                         [% UNLESS hidden.defined('B_country') %]
714                                             <li>
715                                                 [% IF mandatory.defined('B_country') %]
716                                                     <label for="borrower_B_country" class="required">Country:</label>
717                                                 [% ELSE %]
718                                                     <label for="borrower_B_country">Country:</label>
719                                                 [% END %]
720
721                                                 <input type="text" id="borrower_B_country" name="borrower_B_country" value="[% borrower.B_country | html %]" />
722                                                 [% IF mandatory.defined('B_country') %]<span class="required">Required</span>[% END %]
723                                             </li>
724                                         [% END %]
725
726                                         [% UNLESS hidden.defined('B_phone') %]
727                                             <li>
728                                                 [% IF mandatory.defined('B_phone') %]
729                                                     <label for="borrower_B_phone" class="required">Phone:</label>
730                                                 [% ELSE %]
731                                                     <label for="borrower_B_phone">Phone:</label>
732                                                 [% END %]
733
734                                                 <input type="text" id="borrower_B_phone" name="borrower_B_phone" value="[% borrower.B_phone | html %]" />
735                                                 [% IF mandatory.defined('B_phone') %]<span class="required">Required</span>[% END %]
736                                             </li>
737                                         [% END %]
738
739                                         [% UNLESS hidden.defined('B_email') %]
740                                             <li>
741                                                 [% IF mandatory.defined('B_email') %]
742                                                     <label for="borrower_B_email" class="required">Email:</label>
743                                                 [% ELSE %]
744                                                     <label for="borrower_B_email">Email:</label>
745                                                 [% END %]
746
747                                                 <input type="text" id="borrower_B_email" name="borrower_B_email" value="[% borrower.B_email | html %]" />
748                                                 [% IF mandatory.defined('B_email') %]<span class="required">Required</span>[% END %]
749                                             </li>
750                                         [% END %]
751
752                                         [% UNLESS hidden.defined('contactnote') %]
753                                             <li>
754                                                 [% IF mandatory.defined('contactnote') %]
755                                                     <label for="borrower_contactnote" class="required">Contact note:</label>
756                                                 [% ELSE %]
757                                                     <label for="borrower_contactnote">Contact note:</label>
758                                                 [% END %]
759
760                                                 <textarea id="borrower_contactnote" name="borrower_contactnote" cols="30" rows="2">[% borrower.contactnote | html %]</textarea>
761                                                 [% IF mandatory.defined('contactnote') %]<span class="required">Required</span>[% END %]
762                                             </li>
763                                         [% END %]
764
765                                     </ol>
766                                 </fieldset>
767                             </div> <!-- /.col -->
768                         </div> <!-- /.row -->
769                     [% END %]
770
771                     [%# Following on one line for translatability %]
772                     [% UNLESS hidden.defined('altcontactsurname') && hidden.defined('altcontactfirstname') && hidden.defined('altcontactaddress1') && hidden.defined('altcontactaddress2') && hidden.defined('altcontactaddress3') && hidden.defined('altcontactstate') && hidden.defined('altcontactzipcode') && hidden.defined('altcontactcountry') && hidden.defined('altcontactphone') %]
773                         <div class="row">
774                             <div class="col">
775                                 <fieldset class="rows" id="memberentry_alternatecontact">
776                                     <legend id="alternatecontact_legend">Alternate contact</legend>
777
778                                     <ol>
779                                         [% UNLESS hidden.defined('altcontactsurname') %]
780                                             <li>
781                                                 [% IF mandatory.defined('altcontactsurname') %]
782                                                     <label for="borrower_altcontactsurname" class="required">Surname:</label>
783                                                 [% ELSE %]
784                                                     <label for="borrower_altcontactsurname">Surname:</label>
785                                                 [% END %]
786
787                                                 <input type="text" id="borrower_altcontactsurname" name="borrower_altcontactsurname" value="[% borrower.altcontactsurname | html %]" />
788                                                 [% IF mandatory.defined('altcontactsurname') %]<span class="required">Required</span>[% END %]
789                                             </li>
790                                         [% END %]
791
792                                         [% UNLESS hidden.defined('altcontactfirstname') %]
793                                             <li>
794                                                 [% IF mandatory.defined('altcontactfirstname') %]
795                                                     <label for="borrower_altcontactfirstname" class="required">First name:</label>
796                                                 [% ELSE %]
797                                                     <label for="borrower_altcontactfirstname">First name:</label>
798                                                 [% END %]
799
800                                                 <input type="text" id="borrower_altcontactfirstname" name="borrower_altcontactfirstname" value="[% borrower.altcontactfirstname | html %]" />
801                                                 [% IF mandatory.defined('altcontactfirstname') %]<span class="required">Required</span>[% END %]
802                                             </li>
803                                         [% END %]
804
805                                         [% UNLESS hidden.defined('altcontactaddress1') %]
806                                             <li>
807                                                 [% IF mandatory.defined('altcontactaddress1') %]
808                                                     <label for="borrower_altcontactaddress1" class="required">Address:</label>
809                                                 [% ELSE %]
810                                                     <label for="borrower_altcontactaddress1">Address:</label>
811                                                 [% END %]
812
813                                                 <input type="text" id="borrower_altcontactaddress1" name="borrower_altcontactaddress1" value="[% borrower.altcontactaddress1 | html %]" />
814                                                 [% IF mandatory.defined('altcontactaddress1') %]<span class="required">Required</span>[% END %]
815                                             </li>
816                                         [% END %]
817
818                                         [% UNLESS hidden.defined('altcontactaddress2') %]
819                                             <li>
820                                                 [% IF mandatory.defined('altcontactaddress2') %]
821                                                     <label for="borrower_altcontactaddress2" class="required">Address 2:</label>
822                                                 [% ELSE %]
823                                                     <label for="borrower_altcontactaddress2">Address 2:</label>
824                                                 [% END %]
825
826                                                 <input type="text" id="borrower_altcontactaddress2" name="borrower_altcontactaddress2" value="[% borrower.altcontactaddress2 | html %]" />
827                                                 [% IF mandatory.defined('altcontactaddress2') %]<span class="required">Required</span>[% END %]
828                                             </li>
829                                         [% END %]
830
831                                         [% UNLESS hidden.defined('altcontactaddress3') %]
832                                             <li>
833                                                 [% IF mandatory.defined('altcontactaddress3') %]
834                                                     <label for="borrower_altcontactaddress3" class="required">City:</label>
835                                                 [% ELSE %]
836                                                     <label for="borrower_altcontactaddress3">City:</label>
837                                                 [% END %]
838
839                                                 <input type="text" id="borrower_altcontactaddress3" name="borrower_altcontactaddress3" value="[% borrower.altcontactaddress3 | html %]" />
840                                                 [% IF mandatory.defined('altcontactaddress3') %]<span class="required">Required</span>[% END %]
841                                             </li>
842                                         [% END %]
843
844                                         [% UNLESS hidden.defined('altcontactstate') %]
845                                             <li>
846                                                 [% IF mandatory.defined('altcontactstate') %]
847                                                     <label for="borrower_altcontactstate" class="required">State:</label>
848                                                 [% ELSE %]
849                                                     <label for="borrower_altcontactstate">State:</label>
850                                                 [% END %]
851
852                                                 <input type="text" id="borrower_altcontactstate" name="borrower_altcontactstate" value="[% borrower.altcontactstate | html %]" />
853                                                 [% IF mandatory.defined('altcontactstate') %]<span class="required">Required</span>[% END %]
854                                             </li>
855                                         [% END %]
856
857                                         [% UNLESS hidden.defined('altcontactzipcode') %]
858                                             <li>
859                                                 [% IF mandatory.defined('altcontactzipcode') %]
860                                                     <label for="borrower_altcontactzipcode" class="required">ZIP/Postal code:</label>
861                                                 [% ELSE %]
862                                                     <label for="borrower_altcontactzipcode">ZIP/Postal code:</label>
863                                                 [% END %]
864
865                                                 <input type="text" id="borrower_altcontactzipcode" name="borrower_altcontactzipcode" value="[% borrower.altcontactzipcode | html %]" />
866                                                 [% IF mandatory.defined('altcontactzipcode') %]<span class="required">Required</span>[% END %]
867                                             </li>
868                                         [% END %]
869
870                                         [% UNLESS hidden.defined('altcontactcountry') %]
871                                             <li>
872                                                 [% IF mandatory.defined('altcontactcountry') %]
873                                                     <label for="borrower_altcontactcountry" class="required">Country:</label>
874                                                 [% ELSE %]
875                                                     <label for="borrower_altcontactcountry">Country:</label>
876                                                 [% END %]
877
878                                                 <input type="text" id="borrower_altcontactcountry" name="borrower_altcontactcountry" value="[% borrower.altcontactcountry | html %]" />
879                                                 [% IF mandatory.defined('altcontactcountry') %]<span class="required">Required</span>[% END %]
880                                             </li>
881                                         [% END %]
882
883                                         [% UNLESS hidden.defined('altcontactphone') %]
884                                             <li>
885                                                 [% IF mandatory.defined('altcontactphone') %]
886                                                     <label for="borrower_altcontactphone" class="required">Phone:</label>
887                                                 [% ELSE %]
888                                                     <label for="borrower_altcontactphone">Phone:</label>
889                                                 [% END %]
890
891                                                 <input type="text" id="borrower_altcontactphone" name="borrower_altcontactphone" value="[% borrower.altcontactphone | html %]" />
892                                                 [% IF mandatory.defined('altcontactphone') %]<span class="required">Required</span>[% END %]
893                                             </li>
894                                         [% END %]
895                                     </ol>
896                                 </fieldset>
897                             </div> <!-- /.col -->
898                         </div> <!-- /.row -->
899                     [% END %]
900
901                     [% UNLESS action == 'edit' || hidden.defined('password') %]
902                         <div class="row">
903                             <div class="col">
904                                 <fieldset class="rows" id="memberentry_password">
905                                     <legend id="contact_legend">Password</legend>
906                                     <div class="alert alert-info">
907                                         [% IF patron %]
908                                             [% IF ( patron.category.effective_require_strong_password ) %]
909                                                 <p>Your password must contain at least [% patron.category.effective_min_password_length | html %] characters, including UPPERCASE, lowercase and numbers.</p>
910                                             [% ELSE %]
911                                                 <p>Your password must be at least [% patron.category.effective_min_password_length | html %] characters long.</p>
912                                             [% END %]
913                                         [% ELSE %]
914                                             <p id="password_alert"></p>
915                                         [% END %]
916                                         [% UNLESS mandatory.defined('password') %]
917                                             <p>If you do not enter a password a system generated password will be created.</p>
918                                         [% END %]
919                                     </div>
920
921                                     [% IF mandatory.defined('password') %]
922                                         <ol>
923                                             <li><label for="borrower_password" class="required">Password</label>
924                                                 <input type="password" name="borrower_password" id="password" />
925                                                 <span class="required">Required</span>
926                                             </li>
927                                             <li><label for="borrower_password2" class="required">Confirm password</label>
928                                                 <input type="password" name="borrower_password2" id="password2" />
929                                                 <span class="required">Required</span>
930                                             </li>
931                                         </ol>
932                                     [% ELSE %]
933                                         <ol>
934                                             <li><label for="borrower_password">Password</label>
935                                                 <input type="password" name="borrower_password" id="password" />
936                                             </li>
937                                             <li><label for="borrower_password2">Confirm password</label>
938                                                 <input type="password" name="borrower_password2" id="password2" />
939                                             </li>
940                                         </ol>
941                                     [% END %]
942                                 </fieldset>
943                             </div> <!-- /.col -->
944                         </div> <!-- /.row -->
945                    [% END %]
946
947                     [% IF ( Koha.Preference('ExtendedPatronAttributes') && patron_attribute_classes.size && ! ( action == 'new' && Koha.Preference('PatronSelfRegistrationVerifyByEmail') ) ) %]
948                         <div class="row">
949                             <div class="col">
950                                 [% FOREACH pa_class IN patron_attribute_classes %]
951                                     [% IF pa_class.class %]
952                                         <fieldset id="aai_[% pa_loo.class | html %]" class="rows patron-attributes">
953                                             <legend>[% pa_class.lib | html %]</legend>
954                                     [% ELSE %]
955                                         <fieldset class="rows patron-attributes">
956                                             <legend>Additional information</legend>
957                                     [% END %]
958                                         <ol class="attributes_table">
959                                             [% FOREACH pa IN pa_class.items %]
960                                                 [% FOREACH pa_value IN pa.values %]
961                                                     [% IF loop.first %]<a name="patron-attr-start-[% pa.type.code | html %]"></a>[% END %]
962                                                     [% form_id = 'patron-attr-' _ Math.int( Math.rand(1000000) ) %]
963                                                     <li data-category_code="[% pa.type.category_code | html %]">
964                                                         [% IF pa.type.mandatory && pa.type.opac_editable %]
965                                                             <label for="[% form_id | html %]" class="required">[% pa.type.description | html %]: </label>
966                                                         [% ELSE %]
967                                                             <label for="[% form_id | html %]">[% pa.type.description | html %]: </label>
968                                                         [% END %]
969                                                         [% IF pa.type.opac_editable %]
970                                                             <input type="hidden" name="patron_attribute_code" value="[% pa.type.code | html %]" />
971                                                             [% IF ( pa.type.authorised_value_category ) %]
972                                                                 <select id="[% form_id | html %]" name="patron_attribute_value">
973                                                                     <option value=""></option>
974                                                                     [% FOREACH auth_val IN AuthorisedValues.Get( pa.type.authorised_value_category, 1 ) %]
975                                                                         [% IF ( auth_val.authorised_value == pa_value ) %]
976                                                                             <option value="[% auth_val.authorised_value | html %]" selected="selected">
977                                                                                 [% auth_val.lib | html %]
978                                                                             </option>
979                                                                         [% ELSE %]
980                                                                             <option value="[% auth_val.authorised_value | html %]" >
981                                                                                 [% auth_val.lib | html %]
982                                                                             </option>
983                                                                         [% END %]
984                                                                     [% END %]
985                                                                 </select>
986                                                             [% ELSE %]
987                                                                 <textarea rows="2" cols="30" id="[% form_id | html %]" name="patron_attribute_value">[% pa_value | html %]</textarea>
988                                                             [% END %]
989                                                             [% IF pa.type.mandatory %]
990                                                                 <span class="required">Required</span>
991                                                             [% END %]
992                                                             <a href="#" class="clear-attribute">Clear</a>
993                                                             [% IF ( pa.type.repeatable ) %]
994                                                             <a href="#" class="clone-attribute">New</a>
995                                                             [% END %]
996                                                         [% ELSE %]
997                                                             [% IF ( pa.type.authorised_value_category ) %]
998                                                                 [% AuthorisedValues.GetByCode( pa.type.authorised_value_category, pa_value, 1 ) | html_line_break %]
999                                                             [% ELSE %]
1000                                                                 [% pa_value | html_line_break %]
1001                                                             [% END %]
1002                                                         [% END %]
1003                                                     </li>
1004                                                 [% END %]
1005                                             [% END %]
1006                                         </ol>
1007                                     </fieldset>
1008                                 [% END %]
1009                             </div> <!-- /.col -->
1010                         </div> <!-- /.row -->
1011                     [% END %]
1012
1013                     [% IF Koha.Preference('GDPR_Policy') && action != 'edit' %]
1014                         <div class="row">
1015                             <div class="col">
1016                                 <fieldset class="rows" id="memberentry_gdpr_consent">
1017                                     <legend>GDPR consent</legend>
1018                                     <ol>
1019                                     <li>
1020                                         <label></label><span><input type="checkbox" name="borrower_gdpr_proc_consent" value="agreed"> I agree with your processing of my personal data as outlined in the <a target="_blank" href="[% Koha.Preference('PrivacyPolicyURL') | url %]">privacy policy</a>. <span class="required">Required</span></span>
1021                                     </li>
1022                                     </ol>
1023                                 </fieldset>
1024                             </div> <!-- /.col -->
1025                         </div> <!-- /.row -->
1026                    [% END %]
1027
1028                    [% UNLESS action == 'edit' %]
1029                         <div class="row">
1030                             <div class="col">
1031                                 <fieldset class="rows" id="memberentry_captcha">
1032                                     <legend>Verification</legend>
1033                                     <ol>
1034
1035                                         <li>
1036                                             <label for="captcha" class="required">Verification:</label>
1037
1038                                             <input type="text" name="captcha" id="captcha" />
1039                                             <input type="hidden" name="captcha_digest" value="[% captcha_digest | html %]" />
1040
1041                                             <span class="hint">Please type the following characters into the preceding box: <strong>[% captcha | html %]</strong></span>
1042                                         </li>
1043                                     </ol>
1044                                 </fieldset>
1045                             </div> <!-- /.col -->
1046                         </div> <!-- /.row -->
1047                     [% END %]
1048
1049                     <div class="row">
1050                         <div class="col">
1051                             [% IF action == 'edit' %]
1052                                 [% IF OPACPatronDetails %]
1053                                     <fieldset class="action">
1054                                         <input type="hidden" name="action" value="update" />
1055                                         <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
1056                                         <input type="submit" class="btn btn-primary" value="Submit update request" />
1057                                     </fieldset>
1058                                 [% END %]
1059                             [% ELSE %]
1060                                 <fieldset class="action">
1061                                     <input type="hidden" name="action" value="create" />
1062                                     <input type="submit" class="btn btn-primary" value="Submit" />
1063                                 </fieldset>
1064                             [% END %]
1065                         </div> <!-- /.col -->
1066                     </div> <!-- /.row -->
1067
1068                 </form>
1069
1070                     </div><!--/div#update-account -->
1071                 </div>
1072             </div>
1073         </div>
1074     </div>
1075
1076 [% INCLUDE 'opac-bottom.inc' %]
1077 [% BLOCK jsinclude %]
1078     [% Asset.js("lib/jquery/plugins/jquery.validate.min.js") | $raw %]
1079     [% INCLUDE 'calendar.inc' %]
1080
1081     <script>
1082
1083         $(document).ready(function() {
1084             [% IF action == 'edit' && !OPACPatronDetails %]
1085                 $("#memberentry-form :input").attr('readonly', true);
1086                 $("#borrower_branchcode").attr('disabled',true);
1087                 $("#borrower_title").attr('disabled',true);
1088                 $('#memberentry-form :radio').attr('disabled',true);
1089                 $('span.required').remove();
1090                 $('label.required').removeClass('required');
1091             [% END %]
1092
1093             $("#memberentry-form").validate({
1094                 rules: {
1095                     borrower_email: {
1096                         email: true
1097                     },
1098                     borrower_repeat_email: {
1099                         equalTo: '#borrower_email'
1100                     },
1101                     borrower_emailpro: {
1102                         email: true
1103                     },
1104                     borrower_B_email: {
1105                         email: true
1106                     },
1107                     borrower_password: {
1108                         [% IF mandatory.defined('password') %]
1109                         required: true,
1110                         [% END %]
1111                         password_strong: true,
1112                         password_no_spaces: true
1113                     },
1114                     borrower_password2: {
1115                         [% IF mandatory.defined('password') %]
1116                         required: true,
1117                         [% END %]
1118                         password_match: true
1119                     },
1120                     captcha: {
1121                         required: true,
1122                     }
1123                 },
1124                 submitHandler: function(form) {
1125                     if (form.beenSubmitted) {
1126                         return false;
1127                     }
1128                     else {
1129                         form.beenSubmitted = true;
1130                         form.submit();
1131                     }
1132                 },
1133                 errorPlacement: function(error, element) {
1134                     offset = element.offset();
1135                     error.insertAfter(element)
1136                     error.addClass('error');  // add a class to the wrapper
1137                     error.css('position', 'absolute');
1138                     error.css('left', offset.left + element.outerWidth() + 10);
1139                     error.css('top', offset.top);
1140                     error.css('width', 'auto');
1141                 }
1142             });
1143
1144             [% IF patron.guarantor_relationships && !Koha.Preference('OPACPrivacy') %]
1145
1146                 [% IF Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %]
1147                     $('#update_privacy_guarantor_checkouts').click( function() {
1148                         var can_see_checkouts = $('#privacy_guarantor_checkouts').val() == 1;
1149                         $.ajax({
1150                             url: "/api/v1/public/patrons/[% logged_in_user.borrowernumber | uri %]/guarantors/can_see_checkouts",
1151                             type: "PUT",
1152                             data: JSON.stringify({
1153                                 allowed: can_see_checkouts
1154                             }),
1155                             contentType: "application/json",
1156                             success: function () {
1157                                 $('#update_privacy_guarantor_checkouts_message')
1158                                     .fadeIn("slow")
1159                                     .text(_("Your setting has been updated!"))
1160                                     .delay(5000)
1161                                     .fadeOut("slow");
1162                             },
1163                             error: function () {
1164                                 $('#update_privacy_guarantor_checkouts_message')
1165                                     .fadeIn("slow")
1166                                     .text(_("Unable to update your setting!"))
1167                                     .delay(5000)
1168                                     .fadeOut("slow");
1169                             }
1170                         });
1171                     });
1172                 [% END %]
1173
1174                 [% IF Koha.Preference('AllowPatronToSetFinesVisibilityForGuarantor') %]
1175                     $('#update_privacy_guarantor_fines').click( function() {
1176                         var can_see_charges = $('#privacy_guarantor_fines').val() == 1;
1177                         $.ajax({
1178                             url: "/api/v1/public/patrons/[% logged_in_user.borrowernumber | uri %]/guarantors/can_see_charges",
1179                             type: 'PUT',
1180                             data: JSON.stringify({ 
1181                                 allowed: can_see_charges
1182                             }),
1183                             contentType: 'application/json',
1184                             success: function() {
1185                                 $('#update_privacy_guarantor_fines_message')
1186                                     .fadeIn("slow")
1187                                     .text( _("Your setting has been updated!") )
1188                                     .delay( 5000 )
1189                                     .fadeOut("slow");
1190                             },
1191                             error: function() {
1192                                 $('#update_privacy_guarantor_fines_message')
1193                                     .fadeIn("slow")
1194                                     .text( _("Unable to update your setting!") )
1195                                     .delay( 5000 )
1196                                     .fadeOut("slow");
1197                             }
1198                         });
1199                     });
1200                 [% END %]
1201             [% END %]
1202
1203             $(".patron-attributes").on( 'click', '.clear-attribute', function() {
1204                 $(this).parent()
1205                     .find('textarea').attr('value', '').end()
1206                     .find('select').attr('value', '').end();
1207
1208                 return false;
1209             } );
1210
1211             $(".patron-attributes").on( 'click', '.clone-attribute', function() {
1212                 var clone = $(this).parent().clone().insertAfter( $(this).parent() );
1213
1214                 var newId = 50 + parseInt(Math.random() * 100000);
1215                 $('input[type!="hidden"],select,textarea', clone).attr('id', 'patron-attr-' + newId).attr('value', '');
1216                 $("label", clone).attr('for', 'patron-attr-' + newId).attr('value', '');
1217
1218                 return false;
1219             } );
1220         });
1221
1222     $(".cleardate").on("click", function(){
1223         $('#borrower_dateofbirth').val('');
1224         return false;
1225     });
1226
1227     [% IF action != 'edit' and Koha.Preference('PatronSelfRegistrationConfirmEmail') %]
1228         $("#borrower_email").bind("cut copy paste", function(e){
1229             e.preventDefault();
1230             $("#borrower_email").bind("contextmenu", function(e){
1231                 e.preventDefault();
1232             });
1233         });
1234         $("#borrower_repeat_email").bind("cut copy paste", function(e){
1235             e.preventDefault();
1236             $("#borrower_repeat_email").bind("contextmenu", function(e){
1237                 e.preventDefault();
1238             });
1239         });
1240     [% END %]
1241
1242     [% UNLESS patron %]
1243         var PWD_STRONG_MSG = _("Password must contain at least %s characters, including UPPERCASE, lowercase and numbers");
1244         var PWD_WEAK_MSG = _("Password must contain at least %s characters");
1245         var default_password_length = [% defaultCategory.effective_min_password_length | html %];
1246         var default_strong_password = [% defaultCategory.effective_require_strong_password ? defaultCategory.effective_require_strong_password : 0 | html %];
1247         $(document).ready(function() {
1248             var setPwdMessage = function() {
1249                 var require_strong = $('select#borrower_categorycode option:selected').length ? $('select#borrower_categorycode option:selected').data('pwdStrong') : default_strong_password;
1250                 var min_length = $('select#borrower_categorycode option:selected').length ? $('select#borrower_categorycode option:selected').data('pwdLength') : default_password_length;
1251                 $('#password_alert').html((require_strong?PWD_STRONG_MSG:PWD_WEAK_MSG).format(min_length));
1252             };
1253             setPwdMessage();
1254             $('select#borrower_categorycode').change(setPwdMessage);
1255         });
1256     [% END %]
1257     //]]>
1258     </script>
1259     [% PROCESS 'password_check.inc' new_password => 'borrower_password', category_selector => '#borrower_categorycode', RequireStrongPassword => patron ? patron.category.effective_require_strong_password : defaultCategory.effective_require_strong_password, minPasswordLength => patron ? patron.category.effective_min_password_length : defaultCategory.effective_min_password_length %]
1260
1261 [% END %]