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