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