Bug 27148: (follow-up) Fix require_strong variable set
[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 mandatory.defined('branchcode') %]
243                                                         <label for="borrower_branchcode" class="required">Home library:</label>
244                                                     [% ELSE %]
245                                                         <label for="borrower_branchcode">Home library:</label>
246                                                     [% END %]
247
248                                                     <select id="borrower_branchcode" name="borrower_branchcode">
249                                                         [% FOREACH l IN libraries %]
250                                                             [% IF l.branchcode == borrower.branchcode %]
251                                                                 <option value="[% l.branchcode | html %]" selected="selected">[% l.branchname | html %]</option>
252                                                             [% ELSE %]
253                                                                 <option value="[% l.branchcode | html %]">[% l.branchname | html %]</option>
254                                                             [% END %]
255                                                         [% END %]
256                                                     </select>
257                                                 </li>
258                                             [% END %]
259
260                                             [% UNLESS hidden.defined('categorycode') %]
261                                                 <li>
262                                                     <label for="borrower_categorycode">
263                                                     Category:</label>
264
265                                                     [% IF borrower %]
266                                                         [% Categories.GetName( borrower.categorycode ) | html %]
267                                                         <input type="hidden" name="borrower_categorycode" value="[% borrower.categorycode | html %]" />
268                                                     [% ELSE %]
269                                                         <select id="borrower_categorycode" name="borrower_categorycode">
270                                                             [% FOREACH c IN Categories.all() %]
271                                                                 [% IF c.categorycode == Koha.Preference('PatronSelfRegistrationDefaultCategory') %]
272                                                                     <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>
273                                                                 [% ELSE %]
274                                                                     <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>
275                                                                 [% END %]
276                                                             [% END %]
277                                                         </select>
278                                                     [% END %]
279                                                 </li>
280                                             [% END %]
281                                         </ol>
282                                     </fieldset>
283                                 </div> <!-- /.col -->
284                             </div> <!-- /.row -->
285                     [% END # / defined 'branchcode' %]
286
287                     [%# Following on one line for translatability %]
288                     [% UNLESS hidden.defined('title') && hidden.defined('surname') && hidden.defined('firstname') && hidden.defined('dateofbirth') && hidden.defined('initials') && hidden.defined('othernames') && hidden.defined('sex') %]
289                         <div class="row">
290                             <div class="col">
291                                 <fieldset class="rows" id="memberentry_identity">
292                                     <legend id="identity_legend">Identity</legend>
293
294                                     <ol>
295                                         [% UNLESS hidden.defined('title') || !Koha.Preference('BorrowersTitles') %]
296                                             <li>
297                                                 [% IF mandatory.defined('title') %]
298                                                     <label for="borrower_title" class="required">Salutation:</label>
299                                                 [% ELSE %]
300                                                     <label for="borrower_title">Salutation:</label>
301                                                 [% END %]
302
303                                                 <select id="borrower_title" name="borrower_title">
304                                                     <option value=""></option>
305                                                     [% FOREACH mt IN Koha.Preference('BorrowersTitles').split('\|') %]
306                                                         [% IF mt == borrower.title %]
307                                                             <option value="[% mt | html %]" selected="selected">[% mt | html %]</option>
308                                                         [% ELSE %]
309                                                             <option value="[% mt | html %]">[% mt | html %]</option>
310                                                         [% END %]
311                                                     [% END %]
312                                                 </select>
313                                             </li>
314                                         [% END %]
315
316                                         [% UNLESS hidden.defined('surname') %]
317                                             <li>
318                                                 [% IF mandatory.defined('surname') %]
319                                                     <label for="borrower_surname" class="required">Surname:</label>
320                                                 [% ELSE %]
321                                                     <label for="borrower_surname">Surname:</label>
322                                                 [% END %]
323
324                                                 <input type="text" id="borrower_surname" name="borrower_surname" value="[% borrower.surname | html %]" />
325                                                 [% IF mandatory.defined('surname') %]<span class="required">Required</span>[% END %]
326                                             </li>
327                                         [% END %]
328
329                                         [% UNLESS hidden.defined('firstname') %]
330                                             <li>
331                                                 [% IF mandatory.defined('firstname') %]
332                                                     <label for="borrower_firstname" class="required">First name:</label>
333                                                 [% ELSE %]
334                                                     <label for="borrower_firstname">First name:</label>
335                                                 [% END %]
336
337                                                 <input type="text" id="borrower_firstname" name="borrower_firstname" value="[% borrower.firstname | html %]" />
338                                                 [% IF mandatory.defined('firstname') %]<span class="required">Required</span>[% END %]
339                                             </li>
340                                         [% END %]
341
342                                         [% UNLESS hidden.defined('dateofbirth') %]
343                                             <li>
344                                                 [% IF mandatory.defined('dateofbirth') %]
345                                                     <label for="borrower_dateofbirth" class="required">Date of birth:</label>
346                                                 [% ELSE %]
347                                                     <label for="borrower_dateofbirth">Date of birth:</label>
348                                                 [% END %]
349
350                                                 <input type="text" id="borrower_dateofbirth" name="borrower_dateofbirth" value="[% borrower.dateofbirth | $KohaDates %]" size="10" />
351
352                                                 [% UNLESS action == 'edit' && !OPACPatronDetails %]
353                                                     [% UNLESS ( mandatory.defined('dateofbirth') ) %]
354                                                         <a href="#" style="font-size:85%;text-decoration:none;" class="cleardate">Clear date</a>
355                                                     [% END %]
356                                                 [% END %]
357
358                                                 [% IF mandatory.defined('dateofbirth') %]<span class="required">Required</span>[% END %]
359                                             </li>
360                                         [% END %]
361
362                                         [% UNLESS hidden.defined('initials') %]
363                                             <li>
364                                                 [% IF mandatory.defined('initials') %]
365                                                     <label for="borrower_initials" class="required">Initials:</label>
366                                                 [% ELSE %]
367                                                     <label for="borrower_initials">Initials:</label>
368                                                 [% END %]
369
370                                                 <input type="text" id="borrower_initials" name="borrower_initials" value="[% borrower.initials | html %]" />
371                                                 [% IF mandatory.defined('initials') %]<span class="required">Required</span>[% END %]
372                                             </li>
373                                         [% END %]
374
375                                         [% UNLESS hidden.defined('othernames') %]
376                                             <li>
377                                                 [% IF mandatory.defined('othernames') %]
378                                                     <label for="borrower_othernames" class="required">Other names:</label>
379                                                 [% ELSE %]
380                                                     <label for="borrower_othernames">Other names:</label>
381                                                 [% END %]
382
383                                                 <input type="text" id="borrower_othernames" name="borrower_othernames" value="[% borrower.othernames | html %]" />
384                                                 [% IF mandatory.defined('othernames') %]<span class="required">Required</span>[% END %]
385                                             </li>
386                                         [% END %]
387
388                                         [% UNLESS hidden.defined('sex') %]
389                                             <li class="lradio">
390                                                 <label for="sex-female" class="radio inline"><span class="patronsex-female">Female:</span></label>
391                                                 [% IF borrower.sex == 'F' %]
392                                                     <input type="radio" name="borrower_sex" id="sex-female" value="F" checked="checked" />
393                                                 [% ELSE %]
394                                                     <input type="radio" name="borrower_sex" id="sex-female" value="F" />
395                                                 [% END %]
396
397                                                 <label for="sex-male" class="radio inline"><span class="patronsex-male">Male:</span></label>
398                                                 [% IF borrower.sex == 'M' %]
399                                                     <input type="radio" name="borrower_sex" id="sex-male" value="M" checked="checked" />
400                                                 [% ELSE %]
401                                                     <input type="radio" name="borrower_sex" id="sex-male" value="M" />
402                                                 [% END %]
403
404                                                 <label for="sex-other" class="radio inline"><span class="patronsex-other">Other:</span></label>
405                                                 [% IF borrower.sex == 'O' %]
406                                                     <input type="radio" name="borrower_sex" id="sex-other" value="O" checked="checked" />
407                                                 [% ELSE %]
408                                                     <input type="radio" name="borrower_sex" id="sex-other" value="O" />
409                                                 [% END %]
410
411                                                 <label for="sex-none" class="radio inline"><span class="patronsex-none">None specified:</span></label>
412                                                 [% IF borrower.sex == '' %]
413                                                     <input type="radio" name="borrower_sex" id="sex-none" value="" checked="checked" />
414                                                 [% ELSE %]
415                                                     <input type="radio" name="borrower_sex" id="sex-none" value="" />
416                                                 [% END %]
417                                             </li>
418                                         [% END %]
419                                     </ol>
420                                 </fieldset>
421                             </div> <!-- /.col -->
422                             [% IF ( display_patron_image ) %]
423                                 <div class="col-sm-2">
424                                     <p class="patronimage">
425                                        <img src="/cgi-bin/koha/opac-patron-image.pl" alt="" />
426                                     </p>
427                                 </div>
428                             [% END %]
429                         </div> <!-- /.row -->
430                     [% END # /UNLESS fields hidden %]
431
432                     [%# Following on one line for translatability %]
433                     [% UNLESS hidden.defined('streetnumber') && hidden.defined('address') && hidden.defined('address2') && hidden.defined('city') && hidden.defined('state') && hidden.defined('zipcode') && hidden.defined('country') %]
434                         <div class="row">
435                             <div class="col">
436                                 <fieldset class="rows" id="memberentry_mainaddress">
437                                     <legend id="mainaddress_legend">Main address</legend>
438
439                                     <ol>
440                                         [% IF Koha.Preference('AddressFormat') != 'de' %][% INCLUDE streetnumber %][% END %]
441
442                                         [% UNLESS hidden.defined('address') %]
443                                             <li>
444                                                 [% IF mandatory.defined('address') %]
445                                                     <label for="borrower_address" class="required">Address:</label>
446                                                 [% ELSE %]
447                                                     <label for="borrower_address">Address:</label>
448                                                 [% END %]
449
450                                                 <input type="text" id="borrower_address" name="borrower_address" value="[% borrower.address | html %]" />
451                                                 [% IF mandatory.defined('address') %]<span class="required">Required</span>[% END %]
452                                             </li>
453                                         [% END %]
454
455                                         [% IF Koha.Preference('AddressFormat') == 'de' %][% INCLUDE streetnumber %][% END %]
456
457                                         [% UNLESS hidden.defined('address2') %]
458                                             <li>
459                                                 [% IF mandatory.defined('address2') %]
460                                                     <label for="borrower_address2" class="required">Address 2:</label>
461                                                 [% ELSE %]
462                                                     <label for="borrower_address2">Address 2:</label>
463                                                 [% END %]
464
465                                                 <input type="text" id="borrower_address2" name="borrower_address2" value="[% borrower.address2 | html %]" />
466                                                 [% IF mandatory.defined('address2') %]<span class="required">Required</span>[% END %]
467                                             </li>
468                                         [% END %]
469
470                                         [% UNLESS hidden.defined('city') %]
471                                             <li>
472                                                 [% IF mandatory.defined('city') %]
473                                                     <label for="borrower_city" class="required">City:</label>
474                                                 [% ELSE %]
475                                                     <label for="borrower_city">City:</label>
476                                                 [% END %]
477
478                                                 <input type="text" id="borrower_city" name="borrower_city" value="[% borrower.city | html %]" />
479                                                 [% IF mandatory.defined('city') %]<span class="required">Required</span>[% END %]
480                                             </li>
481                                         [% END %]
482
483                                         [% UNLESS hidden.defined('state') %]
484                                             <li>
485                                                 [% IF mandatory.defined('state') %]
486                                                     <label for="borrower_state" class="required">State:</label>
487                                                 [% ELSE %]
488                                                     <label for="borrower_state">State:</label>
489                                                 [% END %]
490
491                                                 <input type="text" id="borrower_state" name="borrower_state" value="[% borrower.state | html %]" />
492                                                 [% IF mandatory.defined('state') %]<span class="required">Required</span>[% END %]
493                                             </li>
494                                         [% END %]
495
496                                         [% UNLESS hidden.defined('zipcode') %]
497                                             <li>
498                                                 [% IF mandatory.defined('zipcode') %]
499                                                     <label for="borrower_zipcode" class="required">ZIP/Postal code:</label>
500                                                 [% ELSE %]
501                                                     <label for="borrower_zipcode">ZIP/Postal code:</label>
502                                                 [% END %]
503
504                                                 <input type="text" id="borrower_zipcode" name="borrower_zipcode" value="[% borrower.zipcode | html %]" />
505                                                 [% IF mandatory.defined('zipcode') %]<span class="required">Required</span>[% END %]
506                                             </li>
507                                         [% END %]
508
509                                         [% UNLESS hidden.defined('country') %]
510                                             <li>
511                                                 [% IF mandatory.defined('country') %]
512                                                     <label for="borrower_country" class="required">Country:</label>
513                                                 [% ELSE %]
514                                                     <label for="borrower_country">Country:</label>
515                                                 [% END %]
516
517                                                 <input type="text" id="borrower_country" name="borrower_country" value="[% borrower.country | html %]" />
518                                                 [% IF mandatory.defined('country') %]<span class="required">Required</span>[% END %]
519                                             </li>
520                                         [% END %]
521
522                                     </ol>
523                                 </fieldset>
524                             </div> <!-- /.col -->
525                         </div> <!-- /.row -->
526                     [% END %]
527
528                     [%# Following on one line for translatability %]
529                     [% UNLESS hidden.defined('phone') && hidden.defined('phonepro') && hidden.defined('mobile') && hidden.defined('email') && hidden.defined('emailpro') && hidden.defined('fax') %]
530                         <div class="row">
531                             <div class="col">
532                                 <fieldset class="rows" id="memberentry_contact">
533                                     <legend id="contact_legend">Contact information</legend>
534
535                                     <ol>
536                                         [% UNLESS hidden.defined('phone') %]
537                                             <li>
538                                                 [% IF mandatory.defined('phone') %]
539                                                     <label for="borrower_phone" class="required">Primary phone:</label>
540                                                 [% ELSE %]
541                                                     <label for="borrower_phone">Primary phone:</label>
542                                                 [% END %]
543
544                                                 <input type="text" id="borrower_phone" name="borrower_phone" value="[% borrower.phone | html %]" />
545                                                 [% IF mandatory.defined('phone') %]<span class="required">Required</span>[% END %]
546                                             </li>
547                                         [% END %]
548
549                                         [% UNLESS hidden.defined('phonepro') %]
550                                             <li>
551                                                 [% IF mandatory.defined('phonepro') %]
552                                                     <label for="borrower_phonepro" class="required">Secondary phone:</label>
553                                                 [% ELSE %]
554                                                     <label for="borrower_phonepro">Secondary phone:</label>
555                                                 [% END %]
556
557                                                 <input type="text" id="borrower_phonepro" name="borrower_phonepro" value="[% borrower.phonepro | html %]" />
558                                                 [% IF mandatory.defined('phonepro') %]<span class="required">Required</span>[% END %]
559                                             </li>
560                                         [% END %]
561
562                                         [% UNLESS hidden.defined('mobile') %]
563                                             <li>
564                                                 [% IF mandatory.defined('mobile') %]
565                                                     <label for="borrower_mobile" class="required">Other phone:</label>
566                                                 [% ELSE %]
567                                                     <label for="borrower_mobile">Other phone:</label>
568                                                 [% END %]
569
570                                                 <input type="text" id="borrower_mobile" name="borrower_mobile" value="[% borrower.mobile | html %]" />
571                                                 [% IF mandatory.defined('mobile') %]<span class="required">Required</span>[% END %]
572                                             </li>
573                                         [% END %]
574
575                                         [% UNLESS hidden.defined('email') %]
576                                             <li>
577                                                 [% IF mandatory.defined('email') %]
578                                                     <label for="borrower_email" class="required">Primary email:</label>
579                                                 [% ELSE %]
580                                                     <label for="borrower_email">Primary email:</label>
581                                                 [% END %]
582
583                                                 <input type="text" id="borrower_email" name="borrower_email" value="[% borrower.email | html %]" />
584                                                 [% IF mandatory.defined('email') %]<span class="required">Required</span>[% END %]
585                                             </li>
586
587                                             [% IF action != 'edit' and Koha.Preference('PatronSelfRegistrationConfirmEmail') %]
588                                                 <li>
589                                                     [% IF mandatory.defined('email') %]
590                                                         <label for="borrower_repeat_email" class="required">Confirm primary email:</label>
591                                                     [% ELSE %]
592                                                         <label for="borrower_repeat_email">Confirm primary email:</label>
593                                                     [% END %]
594
595                                                     <input type="text" id="borrower_repeat_email" name="borrower_repeat_email" autocomplete=off>
596                                                     [% IF mandatory.defined('email') %]<span class="required">Required</span>[% END %]
597                                                 </li>
598                                             [% END %]
599                                         [% END %]
600
601                                         [% UNLESS hidden.defined('emailpro') %]
602                                             <li>
603                                                 [% IF mandatory.defined('emailpro') %]
604                                                     <label for="borrower_emailpro" class="required">Secondary email:</label>
605                                                 [% ELSE %]
606                                                     <label for="borrower_emailpro">Secondary email:</label>
607                                                 [% END %]
608
609                                                 <input type="text" id="borrower_emailpro" name="borrower_emailpro" value="[% borrower.emailpro | html %]" />
610                                                 [% IF mandatory.defined('emailpro') %]<span class="required">Required</span>[% END %]
611                                             </li>
612                                         [% END %]
613
614                                         [% UNLESS hidden.defined('fax') %]
615                                             <li>
616                                                 [% IF mandatory.defined('fax') %]
617                                                     <label for="borrower_fax" class="required">Fax:</label>
618                                                 [% ELSE %]
619                                                     <label for="borrower_fax">Fax:</label>
620                                                 [% END %]
621
622                                                 <input type="text" id="borrower_fax" name="borrower_fax" value="[% borrower.fax | html %]" />
623                                                 [% IF mandatory.defined('fax') %]<span class="required">Required</span>[% END %]
624                                             </li>
625                                         [% END %]
626                                     </ol>
627                                 </fieldset>
628                             </div> <!-- /.col -->
629                         </div> <!-- /.row -->
630                     [% END %]
631
632                     [%# Following on one line for translatability %]
633                     [% 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') %]
634                         <div class="row">
635                             <div class="col">
636                                 <fieldset class="rows" id="memberentry_alternateaddress">
637                                     <legend id="alternateaddress_legend">Alternate address</legend>
638
639                                     <ol>
640                                         [% UNLESS hidden.defined('B_address') %]
641                                             <li>
642                                                 [% IF mandatory.defined('B_address') %]
643                                                     <label for="borrower_B_address" class="required">Address:</label>
644                                                 [% ELSE %]
645                                                     <label for="borrower_B_address">Address:</label>
646                                                 [% END %]
647
648                                                 <input type="text" id="borrower_B_address" name="borrower_B_address" value="[% borrower.B_address | html %]" />
649                                                 [% IF mandatory.defined('B_address') %]<span class="required">Required</span>[% END %]
650                                             </li>
651                                         [% END %]
652
653                                         [% UNLESS hidden.defined('B_address2') %]
654                                             <li>
655                                                 [% IF mandatory.defined('B_address2') %]
656                                                     <label for="borrower_B_address2" class="required">Address 2:</label>
657                                                 [% ELSE %]
658                                                     <label for="borrower_B_address2">Address 2:</label>
659                                                 [% END %]
660
661                                                 <input type="text" id="borrower_B_address2" name="borrower_B_address2" value="[% borrower.B_address2 | html %]" />
662                                                 [% IF mandatory.defined('B_address2') %]<span class="required">Required</span>[% END %]
663                                             </li>
664                                         [% END %]
665
666                                         [% UNLESS hidden.defined('B_city') %]
667                                             <li>
668                                                 [% IF mandatory.defined('B_city') %]
669                                                     <label for="borrower_B_city" class="required">City:</label>
670                                                 [% ELSE %]
671                                                     <label for="borrower_B_city">City:</label>
672                                                 [% END %]
673
674                                                 <input type="text" id="borrower_B_city" name="borrower_B_city" value="[% borrower.B_city | html %]" />
675                                                 [% IF mandatory.defined('B_city') %]<span class="required">Required</span>[% END %]
676                                             </li>
677                                         [% END %]
678
679                                         [% UNLESS hidden.defined('B_state') %]
680                                             <li>
681                                                 [% IF mandatory.defined('B_state') %]
682                                                     <label for="borrower_B_state" class="required">State:</label>
683                                                 [% ELSE %]
684                                                     <label for="borrower_B_state">State:</label>
685                                                 [% END %]
686
687                                                 <input type="text" id="borrower_B_state" name="borrower_B_state" value="[% borrower.B_state | html %]" />
688                                                 [% IF mandatory.defined('B_state') %]<span class="required">Required</span>[% END %]
689                                             </li>
690                                         [% END %]
691
692                                         [% UNLESS hidden.defined('B_zipcode') %]
693                                             <li>
694                                                 [% IF mandatory.defined('B_zipcode') %]
695                                                     <label for="borrower_B_zipcode" class="required">ZIP/Postal code:</label>
696                                                 [% ELSE %]
697                                                     <label for="borrower_B_zipcode">ZIP/Postal code:</label>
698                                                 [% END %]
699
700                                                 <input type="text" id="borrower_B_zipcode" name="borrower_B_zipcode" value="[% borrower.B_zipcode | html %]" />
701                                                 [% IF mandatory.defined('B_zipcode') %]<span class="required">Required</span>[% END %]
702                                             </li>
703                                         [% END %]
704
705                                         [% UNLESS hidden.defined('B_country') %]
706                                             <li>
707                                                 [% IF mandatory.defined('B_country') %]
708                                                     <label for="borrower_B_country" class="required">Country:</label>
709                                                 [% ELSE %]
710                                                     <label for="borrower_B_country">Country:</label>
711                                                 [% END %]
712
713                                                 <input type="text" id="borrower_B_country" name="borrower_B_country" value="[% borrower.B_country | html %]" />
714                                                 [% IF mandatory.defined('B_country') %]<span class="required">Required</span>[% END %]
715                                             </li>
716                                         [% END %]
717
718                                         [% UNLESS hidden.defined('B_phone') %]
719                                             <li>
720                                                 [% IF mandatory.defined('B_phone') %]
721                                                     <label for="borrower_B_phone" class="required">Phone:</label>
722                                                 [% ELSE %]
723                                                     <label for="borrower_B_phone">Phone:</label>
724                                                 [% END %]
725
726                                                 <input type="text" id="borrower_B_phone" name="borrower_B_phone" value="[% borrower.B_phone | html %]" />
727                                                 [% IF mandatory.defined('B_phone') %]<span class="required">Required</span>[% END %]
728                                             </li>
729                                         [% END %]
730
731                                         [% UNLESS hidden.defined('B_email') %]
732                                             <li>
733                                                 [% IF mandatory.defined('B_email') %]
734                                                     <label for="borrower_B_email" class="required">Email:</label>
735                                                 [% ELSE %]
736                                                     <label for="borrower_B_email">Email:</label>
737                                                 [% END %]
738
739                                                 <input type="text" id="borrower_B_email" name="borrower_B_email" value="[% borrower.B_email | html %]" />
740                                                 [% IF mandatory.defined('B_email') %]<span class="required">Required</span>[% END %]
741                                             </li>
742                                         [% END %]
743
744                                         [% UNLESS hidden.defined('contactnote') %]
745                                             <li>
746                                                 [% IF mandatory.defined('contactnote') %]
747                                                     <label for="borrower_contactnote" class="required">Contact note:</label>
748                                                 [% ELSE %]
749                                                     <label for="borrower_contactnote">Contact note:</label>
750                                                 [% END %]
751
752                                                 <textarea id="borrower_contactnote" name="borrower_contactnote" cols="30" rows="2">[% borrower.contactnote | html %]</textarea>
753                                                 [% IF mandatory.defined('contactnote') %]<span class="required">Required</span>[% END %]
754                                             </li>
755                                         [% END %]
756
757                                     </ol>
758                                 </fieldset>
759                             </div> <!-- /.col -->
760                         </div> <!-- /.row -->
761                     [% END %]
762
763                     [%# Following on one line for translatability %]
764                     [% 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') %]
765                         <div class="row">
766                             <div class="col">
767                                 <fieldset class="rows" id="memberentry_alternatecontact">
768                                     <legend id="alternatecontact_legend">Alternate contact</legend>
769
770                                     <ol>
771                                         [% UNLESS hidden.defined('altcontactsurname') %]
772                                             <li>
773                                                 [% IF mandatory.defined('altcontactsurname') %]
774                                                     <label for="borrower_altcontactsurname" class="required">Surname:</label>
775                                                 [% ELSE %]
776                                                     <label for="borrower_altcontactsurname">Surname:</label>
777                                                 [% END %]
778
779                                                 <input type="text" id="borrower_altcontactsurname" name="borrower_altcontactsurname" value="[% borrower.altcontactsurname | html %]" />
780                                                 [% IF mandatory.defined('altcontactsurname') %]<span class="required">Required</span>[% END %]
781                                             </li>
782                                         [% END %]
783
784                                         [% UNLESS hidden.defined('altcontactfirstname') %]
785                                             <li>
786                                                 [% IF mandatory.defined('altcontactfirstname') %]
787                                                     <label for="borrower_altcontactfirstname" class="required">First name:</label>
788                                                 [% ELSE %]
789                                                     <label for="borrower_altcontactfirstname">First name:</label>
790                                                 [% END %]
791
792                                                 <input type="text" id="borrower_altcontactfirstname" name="borrower_altcontactfirstname" value="[% borrower.altcontactfirstname | html %]" />
793                                                 [% IF mandatory.defined('altcontactfirstname') %]<span class="required">Required</span>[% END %]
794                                             </li>
795                                         [% END %]
796
797                                         [% UNLESS hidden.defined('altcontactaddress1') %]
798                                             <li>
799                                                 [% IF mandatory.defined('altcontactaddress1') %]
800                                                     <label for="borrower_altcontactaddress1" class="required">Address:</label>
801                                                 [% ELSE %]
802                                                     <label for="borrower_altcontactaddress1">Address:</label>
803                                                 [% END %]
804
805                                                 <input type="text" id="borrower_altcontactaddress1" name="borrower_altcontactaddress1" value="[% borrower.altcontactaddress1 | html %]" />
806                                                 [% IF mandatory.defined('altcontactaddress1') %]<span class="required">Required</span>[% END %]
807                                             </li>
808                                         [% END %]
809
810                                         [% UNLESS hidden.defined('altcontactaddress2') %]
811                                             <li>
812                                                 [% IF mandatory.defined('altcontactaddress2') %]
813                                                     <label for="borrower_altcontactaddress2" class="required">Address 2:</label>
814                                                 [% ELSE %]
815                                                     <label for="borrower_altcontactaddress2">Address 2:</label>
816                                                 [% END %]
817
818                                                 <input type="text" id="borrower_altcontactaddress2" name="borrower_altcontactaddress2" value="[% borrower.altcontactaddress2 | html %]" />
819                                                 [% IF mandatory.defined('altcontactaddress2') %]<span class="required">Required</span>[% END %]
820                                             </li>
821                                         [% END %]
822
823                                         [% UNLESS hidden.defined('altcontactaddress3') %]
824                                             <li>
825                                                 [% IF mandatory.defined('altcontactaddress3') %]
826                                                     <label for="borrower_altcontactaddress3" class="required">City:</label>
827                                                 [% ELSE %]
828                                                     <label for="borrower_altcontactaddress3">City:</label>
829                                                 [% END %]
830
831                                                 <input type="text" id="borrower_altcontactaddress3" name="borrower_altcontactaddress3" value="[% borrower.altcontactaddress3 | html %]" />
832                                                 [% IF mandatory.defined('altcontactaddress3') %]<span class="required">Required</span>[% END %]
833                                             </li>
834                                         [% END %]
835
836                                         [% UNLESS hidden.defined('altcontactstate') %]
837                                             <li>
838                                                 [% IF mandatory.defined('altcontactstate') %]
839                                                     <label for="borrower_altcontactstate" class="required">State:</label>
840                                                 [% ELSE %]
841                                                     <label for="borrower_altcontactstate">State:</label>
842                                                 [% END %]
843
844                                                 <input type="text" id="borrower_altcontactstate" name="borrower_altcontactstate" value="[% borrower.altcontactstate | html %]" />
845                                                 [% IF mandatory.defined('altcontactstate') %]<span class="required">Required</span>[% END %]
846                                             </li>
847                                         [% END %]
848
849                                         [% UNLESS hidden.defined('altcontactzipcode') %]
850                                             <li>
851                                                 [% IF mandatory.defined('altcontactzipcode') %]
852                                                     <label for="borrower_altcontactzipcode" class="required">ZIP/Postal code:</label>
853                                                 [% ELSE %]
854                                                     <label for="borrower_altcontactzipcode">ZIP/Postal code:</label>
855                                                 [% END %]
856
857                                                 <input type="text" id="borrower_altcontactzipcode" name="borrower_altcontactzipcode" value="[% borrower.altcontactzipcode | html %]" />
858                                                 [% IF mandatory.defined('altcontactzipcode') %]<span class="required">Required</span>[% END %]
859                                             </li>
860                                         [% END %]
861
862                                         [% UNLESS hidden.defined('altcontactcountry') %]
863                                             <li>
864                                                 [% IF mandatory.defined('altcontactcountry') %]
865                                                     <label for="borrower_altcontactcountry" class="required">Country:</label>
866                                                 [% ELSE %]
867                                                     <label for="borrower_altcontactcountry">Country:</label>
868                                                 [% END %]
869
870                                                 <input type="text" id="borrower_altcontactcountry" name="borrower_altcontactcountry" value="[% borrower.altcontactcountry | html %]" />
871                                                 [% IF mandatory.defined('altcontactcountry') %]<span class="required">Required</span>[% END %]
872                                             </li>
873                                         [% END %]
874
875                                         [% UNLESS hidden.defined('altcontactphone') %]
876                                             <li>
877                                                 [% IF mandatory.defined('altcontactphone') %]
878                                                     <label for="borrower_altcontactphone" class="required">Phone:</label>
879                                                 [% ELSE %]
880                                                     <label for="borrower_altcontactphone">Phone:</label>
881                                                 [% END %]
882
883                                                 <input type="text" id="borrower_altcontactphone" name="borrower_altcontactphone" value="[% borrower.altcontactphone | html %]" />
884                                                 [% IF mandatory.defined('altcontactphone') %]<span class="required">Required</span>[% END %]
885                                             </li>
886                                         [% END %]
887                                     </ol>
888                                 </fieldset>
889                             </div> <!-- /.col -->
890                         </div> <!-- /.row -->
891                     [% END %]
892
893                     [% UNLESS action == 'edit' || hidden.defined('password') %]
894                         <div class="row">
895                             <div class="col">
896                                 <fieldset class="rows" id="memberentry_password">
897                                     <legend id="contact_legend">Password</legend>
898                                     <div class="alert alert-info">
899                                         [% IF patron %]
900                                             [% IF ( patron.category.effective_require_strong_password ) %]
901                                                 <p>Your password must contain at least [% patron.category.effective_min_password_length | html %] characters, including UPPERCASE, lowercase and numbers.</p>
902                                             [% ELSE %]
903                                                 <p>Your password must be at least [% patron.category.effective_min_password_length | html %] characters long.</p>
904                                             [% END %]
905                                         [% ELSE %]
906                                             <p id="password_alert"></p>
907                                         [% END %]
908                                         [% UNLESS mandatory.defined('password') %]
909                                             <p>If you do not enter a password a system generated password will be created.</p>
910                                         [% END %]
911                                     </div>
912
913                                     [% IF mandatory.defined('password') %]
914                                         <ol>
915                                             <li><label for="borrower_password" class="required">Password</label>
916                                                 <input type="password" name="borrower_password" id="password" />
917                                                 <span class="required">Required</span>
918                                             </li>
919                                             <li><label for="borrower_password2" class="required">Confirm password</label>
920                                                 <input type="password" name="borrower_password2" id="password2" />
921                                                 <span class="required">Required</span>
922                                             </li>
923                                         </ol>
924                                     [% ELSE %]
925                                         <ol>
926                                             <li><label for="borrower_password">Password</label>
927                                                 <input type="password" name="borrower_password" id="password" />
928                                             </li>
929                                             <li><label for="borrower_password2">Confirm password</label>
930                                                 <input type="password" name="borrower_password2" id="password2" />
931                                             </li>
932                                         </ol>
933                                     [% END %]
934                                 </fieldset>
935                             </div> <!-- /.col -->
936                         </div> <!-- /.row -->
937                    [% END %]
938
939                     [% IF ( Koha.Preference('ExtendedPatronAttributes') && patron_attribute_classes.size && ! ( action == 'new' && Koha.Preference('PatronSelfRegistrationVerifyByEmail') ) ) %]
940                         <div class="row">
941                             <div class="col">
942                                 [% FOREACH pa_class IN patron_attribute_classes %]
943                                     [% IF pa_class.class %]
944                                         <fieldset id="aai_[% pa_loo.class | html %]" class="rows patron-attributes">
945                                             <legend>[% pa_class.lib | html %]</legend>
946                                     [% ELSE %]
947                                         <fieldset class="rows patron-attributes">
948                                             <legend>Additional information</legend>
949                                     [% END %]
950                                         <ol class="attributes_table">
951                                             [% FOREACH pa IN pa_class.items %]
952                                                 [% FOREACH pa_value IN pa.values %]
953                                                     [% IF loop.first %]<a name="patron-attr-start-[% pa.type.code | html %]"></a>[% END %]
954                                                     [% form_id = 'patron-attr-' _ Math.int( Math.rand(1000000) ) %]
955                                                     <li data-category_code="[% pa.type.category_code | html %]">
956                                                         [% IF pa.type.mandatory && pa.type.opac_editable %]
957                                                             <label for="[% form_id | html %]" class="required">[% pa.type.description | html %]: </label>
958                                                         [% ELSE %]
959                                                             <label for="[% form_id | html %]">[% pa.type.description | html %]: </label>
960                                                         [% END %]
961                                                         [% IF pa.type.opac_editable %]
962                                                             <input type="hidden" name="patron_attribute_code" value="[% pa.type.code | html %]" />
963                                                             [% IF ( pa.type.authorised_value_category ) %]
964                                                                 <select id="[% form_id | html %]" name="patron_attribute_value">
965                                                                     <option value=""></option>
966                                                                     [% FOREACH auth_val IN AuthorisedValues.Get( pa.type.authorised_value_category, 1 ) %]
967                                                                         [% IF ( auth_val.authorised_value == pa_value ) %]
968                                                                             <option value="[% auth_val.authorised_value | html %]" selected="selected">
969                                                                                 [% auth_val.lib | html %]
970                                                                             </option>
971                                                                         [% ELSE %]
972                                                                             <option value="[% auth_val.authorised_value | html %]" >
973                                                                                 [% auth_val.lib | html %]
974                                                                             </option>
975                                                                         [% END %]
976                                                                     [% END %]
977                                                                 </select>
978                                                             [% ELSE %]
979                                                                 <textarea rows="2" cols="30" id="[% form_id | html %]" name="patron_attribute_value">[% pa_value | html %]</textarea>
980                                                             [% END %]
981                                                             [% IF pa.type.mandatory %]
982                                                                 <span class="required">Required</span>
983                                                             [% END %]
984                                                             <a href="#" class="clear-attribute">Clear</a>
985                                                             [% IF ( pa.type.repeatable ) %]
986                                                             <a href="#" class="clone-attribute">New</a>
987                                                             [% END %]
988                                                         [% ELSE %]
989                                                             [% IF ( pa.type.authorised_value_category ) %]
990                                                                 [% AuthorisedValues.GetByCode( pa.type.authorised_value_category, pa_value, 1 ) | html_line_break %]
991                                                             [% ELSE %]
992                                                                 [% pa_value | html_line_break %]
993                                                             [% END %]
994                                                         [% END %]
995                                                     </li>
996                                                 [% END %]
997                                             [% END %]
998                                         </ol>
999                                     </fieldset>
1000                                 [% END %]
1001                             </div> <!-- /.col -->
1002                         </div> <!-- /.row -->
1003                     [% END %]
1004
1005                     [% IF Koha.Preference('GDPR_Policy') && action != 'edit' %]
1006                         <div class="row">
1007                             <div class="col">
1008                                 <fieldset class="rows" id="memberentry_gdpr_consent">
1009                                     <legend>GDPR consent</legend>
1010                                     <ol>
1011                                     <li>
1012                                         <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>
1013                                     </li>
1014                                     </ol>
1015                                 </fieldset>
1016                             </div> <!-- /.col -->
1017                         </div> <!-- /.row -->
1018                    [% END %]
1019
1020                    [% UNLESS action == 'edit' %]
1021                         <div class="row">
1022                             <div class="col">
1023                                 <fieldset class="rows" id="memberentry_captcha">
1024                                     <legend>Verification</legend>
1025                                     <ol>
1026
1027                                         <li>
1028                                             <label for="captcha" class="required">Verification:</label>
1029
1030                                             <input type="text" name="captcha" id="captcha" />
1031                                             <input type="hidden" name="captcha_digest" value="[% captcha_digest | html %]" />
1032
1033                                             <span class="hint">Please type the following characters into the preceding box: <strong>[% captcha | html %]</strong></span>
1034                                         </li>
1035                                     </ol>
1036                                 </fieldset>
1037                             </div> <!-- /.col -->
1038                         </div> <!-- /.row -->
1039                     [% END %]
1040
1041                     <div class="row">
1042                         <div class="col">
1043                             [% IF action == 'edit' %]
1044                                 [% IF OPACPatronDetails %]
1045                                     <fieldset class="action">
1046                                         <input type="hidden" name="action" value="update" />
1047                                         <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
1048                                         <input type="submit" class="btn btn-primary" value="Submit update request" />
1049                                     </fieldset>
1050                                 [% END %]
1051                             [% ELSE %]
1052                                 <fieldset class="action">
1053                                     <input type="hidden" name="action" value="create" />
1054                                     <input type="submit" class="btn btn-primary" value="Submit" />
1055                                 </fieldset>
1056                             [% END %]
1057                         </div> <!-- /.col -->
1058                     </div> <!-- /.row -->
1059
1060                 </form>
1061
1062                     </div><!--/div#update-account -->
1063                 </div>
1064             </div>
1065         </div>
1066     </div>
1067
1068 [% INCLUDE 'opac-bottom.inc' %]
1069 [% BLOCK jsinclude %]
1070     [% Asset.js("lib/jquery/plugins/jquery.validate.min.js") | $raw %]
1071     [% INCLUDE 'calendar.inc' %]
1072
1073     <script>
1074
1075         $(document).ready(function() {
1076             [% IF action == 'edit' && !OPACPatronDetails %]
1077                 $("#memberentry-form :input").attr('readonly', true);
1078                 $("#borrower_branchcode").attr('disabled',true);
1079                 $("#borrower_title").attr('disabled',true);
1080                 $('#memberentry-form :radio').attr('disabled',true);
1081                 $('span.required').remove();
1082                 $('label.required').removeClass('required');
1083             [% END %]
1084
1085             $("#memberentry-form").validate({
1086                 rules: {
1087                     borrower_email: {
1088                         email: true
1089                     },
1090                     borrower_repeat_email: {
1091                         equalTo: '#borrower_email'
1092                     },
1093                     borrower_emailpro: {
1094                         email: true
1095                     },
1096                     borrower_B_email: {
1097                         email: true
1098                     },
1099                     borrower_password: {
1100                         [% IF mandatory.defined('password') %]
1101                         required: true,
1102                         [% END %]
1103                         password_strong: true,
1104                         password_no_spaces: true
1105                     },
1106                     borrower_password2: {
1107                         [% IF mandatory.defined('password') %]
1108                         required: true,
1109                         [% END %]
1110                         password_match: true
1111                     },
1112                     captcha: {
1113                         required: true,
1114                     }
1115                 },
1116                 submitHandler: function(form) {
1117                     if (form.beenSubmitted) {
1118                         return false;
1119                     }
1120                     else {
1121                         form.beenSubmitted = true;
1122                         form.submit();
1123                     }
1124                 },
1125                 errorPlacement: function(error, element) {
1126                     offset = element.offset();
1127                     error.insertAfter(element)
1128                     error.addClass('error');  // add a class to the wrapper
1129                     error.css('position', 'absolute');
1130                     error.css('left', offset.left + element.outerWidth() + 10);
1131                     error.css('top', offset.top);
1132                     error.css('width', 'auto');
1133                 }
1134             });
1135
1136             [% IF patron.guarantor_relationships && !Koha.Preference('OPACPrivacy') %]
1137
1138                 [% IF Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %]
1139                     $('#update_privacy_guarantor_checkouts').click( function() {
1140                         var can_see_checkouts = $('#privacy_guarantor_checkouts').val() == 1;
1141                         $.ajax({
1142                             url: "/api/v1/public/patrons/[% logged_in_user.borrowernumber | uri %]/guarantors/can_see_checkouts",
1143                             type: "PUT",
1144                             data: JSON.stringify({
1145                                 allowed: can_see_checkouts
1146                             }),
1147                             contentType: "application/json",
1148                             success: function () {
1149                                 $('#update_privacy_guarantor_checkouts_message')
1150                                     .fadeIn("slow")
1151                                     .text(_("Your setting has been updated!"))
1152                                     .delay(5000)
1153                                     .fadeOut("slow");
1154                             },
1155                             error: function () {
1156                                 $('#update_privacy_guarantor_checkouts_message')
1157                                     .fadeIn("slow")
1158                                     .text(_("Unable to update your setting!"))
1159                                     .delay(5000)
1160                                     .fadeOut("slow");
1161                             }
1162                         });
1163                     });
1164                 [% END %]
1165
1166                 [% IF Koha.Preference('AllowPatronToSetFinesVisibilityForGuarantor') %]
1167                     $('#update_privacy_guarantor_fines').click( function() {
1168                         var can_see_charges = $('#privacy_guarantor_fines').val() == 1;
1169                         $.ajax({
1170                             url: "/api/v1/public/patrons/[% logged_in_user.borrowernumber | uri %]/guarantors/can_see_charges",
1171                             type: 'PUT',
1172                             data: JSON.stringify({ 
1173                                 allowed: can_see_charges
1174                             }),
1175                             contentType: 'application/json',
1176                             success: function() {
1177                                 $('#update_privacy_guarantor_fines_message')
1178                                     .fadeIn("slow")
1179                                     .text( _("Your setting has been updated!") )
1180                                     .delay( 5000 )
1181                                     .fadeOut("slow");
1182                             },
1183                             error: function() {
1184                                 $('#update_privacy_guarantor_fines_message')
1185                                     .fadeIn("slow")
1186                                     .text( _("Unable to update your setting!") )
1187                                     .delay( 5000 )
1188                                     .fadeOut("slow");
1189                             }
1190                         });
1191                     });
1192                 [% END %]
1193             [% END %]
1194
1195             $(".patron-attributes").on( 'click', '.clear-attribute', function() {
1196                 $(this).parent()
1197                     .find('textarea').attr('value', '').end()
1198                     .find('select').attr('value', '').end();
1199
1200                 return false;
1201             } );
1202
1203             $(".patron-attributes").on( 'click', '.clone-attribute', function() {
1204                 var clone = $(this).parent().clone().insertAfter( $(this).parent() );
1205
1206                 var newId = 50 + parseInt(Math.random() * 100000);
1207                 $('input[type!="hidden"],select,textarea', clone).attr('id', 'patron-attr-' + newId).attr('value', '');
1208                 $("label", clone).attr('for', 'patron-attr-' + newId).attr('value', '');
1209
1210                 return false;
1211             } );
1212         });
1213
1214     $(".cleardate").on("click", function(){
1215         $('#borrower_dateofbirth').val('');
1216         return false;
1217     });
1218
1219     [% IF action != 'edit' and Koha.Preference('PatronSelfRegistrationConfirmEmail') %]
1220         $("#borrower_email").bind("cut copy paste", function(e){
1221             e.preventDefault();
1222             $("#borrower_email").bind("contextmenu", function(e){
1223                 e.preventDefault();
1224             });
1225         });
1226         $("#borrower_repeat_email").bind("cut copy paste", function(e){
1227             e.preventDefault();
1228             $("#borrower_repeat_email").bind("contextmenu", function(e){
1229                 e.preventDefault();
1230             });
1231         });
1232     [% END %]
1233
1234     [% UNLESS patron %]
1235         var PWD_STRONG_MSG = _("Password must contain at least %s characters, including UPPERCASE, lowercase and numbers");
1236         var PWD_WEAK_MSG = _("Password must contain at least %s characters");
1237         var default_password_length = [% defaultCategory.effective_min_password_length | html %];
1238         var default_strong_password = [% defaultCategory.effective_require_strong_password | html %];
1239         $(document).ready(function() {
1240             var setPwdMessage = function() {
1241                 var require_strong = $('select#borrower_categorycode option:selected').length ? $('select#borrower_categorycode option:selected').data('pwdStrong') : default_strong_password;
1242                 var min_lenght = $('select#borrower_categorycode option:selected').length ? $('select#borrower_categorycode option:selected').data('pwdLength') : default_password_length;
1243                 $('#password_alert').html((require_strong?PWD_STRONG_MSG:PWD_WEAK_MSG).format(min_lenght));
1244             };
1245             setPwdMessage();
1246             $('select#borrower_categorycode').change(setPwdMessage);
1247         });
1248     [% END %]
1249     //]]>
1250     </script>
1251     [% 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 %]
1252
1253 [% END %]