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