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