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