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