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