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