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