Bug 15373: Changing Zip to ZIP on OPAC and Intranet
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-memberentry.tt
1 [% USE Koha %]
2 [% USE KohaDates %]
3 [% SET userupdateview = 1 %]
4
5 [% INCLUDE 'doc-head-open.inc' %]
6     <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; [% IF action == 'edit' %]Update your personal details[% ELSE %]Register a new account[% END %]</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% BLOCK cssinclude %][% END %]
9 </head>
10
11 [% IF action == 'edit' %]
12 [% INCLUDE 'bodytag.inc' bodyid='opac-patron-update' %]
13 [% ELSE %]
14 <body id="opac-patron-registration" class="opac">
15 [% END %]
16 [% INCLUDE 'masthead.inc' %]
17
18 <div class="main">
19     <ul class="breadcrumb">
20         <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
21         [% IF action == 'edit' %]
22             <li><a href="/cgi-bin/koha/opac-user.pl">[% borrower.firstname %] [% borrower.surname %]</a> <span class="divider">&rsaquo;</span></li>
23             <li><a href="#">Your personal details</a></li>
24         [% ELSE %]
25             <li><a href="#">Register a new account</a></li>
26         [% END %]
27     </ul>
28
29     <div class="container-fluid">
30         <div class="row-fluid">
31             <div class="span2">
32                 <div id="navigation">
33                     [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
34                 </div>
35             </div>
36             <div class="span10">
37                 [% IF action == 'edit' %]
38                     <div id="update-account">
39                 [% ELSE %]
40                     <div id="add-account">
41                 [% END %]
42
43                 [% IF action == 'edit' %]
44                     [% UNLESS OPACPatronDetails %]
45                         <div class="alert alert-info">To make changes to your record please contact the library.</div>
46                     [% END %]
47                     [% IF nochanges %]
48                         <div class="alert alert-error">No changes were made.</div>
49                     [% END %]
50                 [% END %]
51
52                 [% IF empty_mandatory_fields %]
53                     <div class="alert">You have not filled out all required fields. Please fill in all missing fields and resubmit.</div>
54                 [% END %]
55
56                 [%  IF invalid_form_fields %]
57                     <div class="alert alert-error"><strong>The following fields contain invalid information:</strong>
58                         <ul>
59                             [% FOREACH field IN invalid_form_fields %]
60                                 [% IF field == "email" %]<li>Contact information: <a href="#borrower_email">primary email address</a></li>[% END %]
61                                 [% IF field == "emailpro" %]<li>Contact information: <a href="#borrower_emailpro">secondary email address</a></li>[% END %]
62                                 [% IF field == "B_email" %]<li>Alternate address information: <a href="#borrower_B_email">email address</a></li>[% END %]
63                             [% END %]
64                         </ul>
65                         Please correct the errors and resubmit.
66                     </div>
67                 [% END %]
68
69                 [% IF failed_captcha %]
70                     <div class="alert">You typed in the wrong characters in the box before submitting. Please try again.</div>
71                 [% END %]
72
73                 <form method="post" action="/cgi-bin/koha/opac-memberentry.pl" id="memberentry-form">
74
75                 [% UNLESS hidden.defined('branchcode') %]
76                     <fieldset class="rows" id="memberentry_library">
77
78                         <legend id="library_legend">Library</legend>
79                             <ol>
80                                 [% UNLESS hidden.defined('cardnumber') %]
81                                 <li>
82                                     <label>Card number:</label>
83                                     [% borrower.cardnumber %]
84                                 </li>
85                                 [% END %]
86
87                                 [% UNLESS hidden.defined('dateexpiry') %]
88                                 <li>
89                                     <label>Expiration date:</label>
90                                     [% borrower.dateexpiry | $KohaDates  %]
91                                 </li>
92                                 [% END %]
93
94                                 [% UNLESS hidden.defined('branchcode') %]
95                                     <li>
96                                         [% IF mandatory.defined('branchcode') %]
97                                             <label for="borrower_branchcode" class="required">
98                                         [% ELSE %]
99                                             <label for="borrower_branchcode">
100                                         [% END %]
101                                         Home library:</label>
102
103                                         <select id="borrower_branchcode" name="borrower_branchcode">
104                                             [% FOREACH b IN branches %]
105                                                 [% IF b.value == borrower.branchcode %]
106                                                     <option value="[% b.value %]" selected="selected">[% b.branchname %]</option>
107                                                 [% ELSE %]
108                                                     <option value="[% b.value %]">[% b.branchname %]</option>
109                                                 [% END %]
110                                             [% END %]
111                                         </select>
112                                     </li>
113                                 [% END %]
114                             </ol>
115                         </fieldset>
116                 [% END # / defined 'branchcode' %]
117
118                 [% UNLESS
119                     hidden.defined('title') && hidden.defined('surname') && hidden.defined('firstname') &&
120                     hidden.defined('dateofbirth') && hidden.defined('initials') && hidden.defined('othernames') &&
121                     hidden.defined('sex')
122                 %]
123                     <div class="row-fluid">
124                         [% IF ( display_patron_image ) %]
125                             <div class="span8">
126                         [% ELSE %]
127                             <div class="span12">
128                         [% END %]
129                             <fieldset class="rows" id="memberentry_identity">
130                                 <legend id="identity_legend">Identity</legend>
131
132                                 <ol>
133                                     [% UNLESS hidden.defined('title') || !member_titles %]
134                                         <li>
135                                             [% IF mandatory.defined('title') %]
136                                                 <label for="borrower_title" class="required">
137                                             [% ELSE %]
138                                                 <label for="borrower_title">
139                                             [% END %]
140                                             Salutation:</label>
141
142                                             <select id="borrower_title" name="borrower_title">
143                                                 [% FOREACH mt IN member_titles %]
144                                                     [% IF mt == borrower.title %]
145                                                         <option value="[% mt %]" selected="selected">[% mt %]</option>
146                                                     [% ELSE %]
147                                                         <option value="[% mt %]">[% mt %]</option>
148                                                     [% END %]
149                                                 [% END %]
150                                             </select>
151                                         </li>
152                                     [% END %]
153
154                                     [% UNLESS hidden.defined('surname') %]
155                                         <li>
156                                             [% IF mandatory.defined('surname') %]
157                                                 <label for="borrower_surname" class="required">
158                                             [% ELSE %]
159                                                 <label for="borrower_surname">
160                                             [% END %]
161                                             Surname:</label>
162
163                                             <input type="text" id="borrower_surname" name="borrower_surname" value="[% borrower.surname %]" />
164                                             [% IF mandatory.defined('surname') %]<span class="required">Required</span>[% END %]
165                                         </li>
166                                     [% END %]
167
168                                     [% UNLESS hidden.defined('firstname') %]
169                                         <li>
170                                             [% IF mandatory.defined('firstname') %]
171                                                 <label for="borrower_firstname" class="required">
172                                             [% ELSE %]
173                                                 <label for="borrower_firstname">
174                                             [% END %]
175                                             First name:</label>
176
177                                             <input type="text" id="borrower_firstname" name="borrower_firstname" value="[% borrower.firstname %]" />
178                                             [% IF mandatory.defined('firstname') %]<span class="required">Required</span>[% END %]
179                                         </li>
180                                     [% END %]
181
182                                     [% UNLESS hidden.defined('dateofbirth') %]
183                                         <li>
184                                             [% IF mandatory.defined('dateofbirth') %]
185                                                 <label for="borrower_dateofbirth" class="required">
186                                             [% ELSE %]
187                                                 <label for="borrower_dateofbirth">
188                                             [% END %]
189                                             Date of birth:</label>
190
191                                             <input type="text" id="borrower_dateofbirth" name="borrower_dateofbirth" value="[% borrower.dateofbirth | $KohaDates %]" size="10" />
192
193                                             [% UNLESS action == 'edit' && !OPACPatronDetails %]
194                                                 [% UNLESS ( mandatory.defined('dateofbirth') ) %]
195                                                     <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('borrower_dateofbirth').value='';return false;">Clear date</a>
196                                                 [% END %]
197                                             [% END %]
198
199                                             [% IF mandatory.defined('dateofbirth') %]<span class="required">Required</span>[% END %]
200                                         </li>
201                                     [% END %]
202
203                                     [% UNLESS hidden.defined('initials') %]
204                                         <li>
205                                             [% IF mandatory.defined('initials') %]
206                                                 <label for="borrower_initials" class="required">
207                                             [% ELSE %]
208                                                 <label for="borrower_initials">
209                                             [% END %]
210                                             Initials:</label>
211
212                                             <input type="text" id="borrower_initials" name="borrower_initials" value="[% borrower.initials %]" />
213                                             [% IF mandatory.defined('initials') %]<span class="required">Required</span>[% END %]
214                                         </li>
215                                     [% END %]
216
217                                     [% UNLESS hidden.defined('othernames') %]
218                                         <li>
219                                             [% IF mandatory.defined('othernames') %]
220                                                 <label for="borrower_othernames" class="required">
221                                             [% ELSE %]
222                                                 <label for="borrower_othernames">
223                                             [% END %]
224                                             Other names:</label>
225
226                                             <input type="text" id="borrower_othernames" name="borrower_othernames" value="[% borrower.othernames %]" />
227                                             [% IF mandatory.defined('othernames') %]<span class="required">Required</span>[% END %]
228                                         </li>
229                                     [% END %]
230
231                                     [% UNLESS hidden.defined('sex') %]
232                                         <li class="lradio">
233                                             <label for="sex-female" class="radio inline">Female:</label>
234                                             [% IF borrower.sex == 'F' %]
235                                                 <input type="radio" name="borrower_sex" id="sex-female" value="F" checked="checked" />
236                                             [% ELSE %]
237                                                 <input type="radio" name="borrower_sex" id="sex-female" value="F" />
238                                             [% END %]
239
240                                             <label for="sex-male" class="radio inline">Male:</label>
241                                             [% IF borrower.sex == 'M' %]
242                                                 <input type="radio" name="borrower_sex" id="sex-male" value="M" checked="checked" />
243                                             [% ELSE %]
244                                                 <input type="radio" name="borrower_sex" id="sex-male" value="M" />
245                                             [% END %]
246
247                                             <label for="sex-none" class="radio inline">None specified: </label>
248                                             [% IF borrower.sex == '' %]
249                                                 <input type="radio" name="borrower_sex" id="sex-none" value="" checked="checked" />
250                                             [% ELSE %]
251                                                 <input type="radio" name="borrower_sex" id="sex-none" value="" />
252                                             [% END %]
253
254                                             [% IF mandatory.defined('sex') %]<span class="required">Required</span>[% END %]
255                                         </li>
256                                     [% END %]
257                                 </ol>
258                             </fieldset>
259                            </div>
260                         [% IF ( display_patron_image ) %]
261                             <div class="span4">
262                                 <p class="patronimage">
263                                    <img src="/cgi-bin/koha/opac-patron-image.pl" alt="" />
264                                 </p>
265                             </div>
266                         [% END %]
267                     </div>
268                 [% END # /UNLESS fields hidden %]
269
270                 [% UNLESS
271                     hidden.defined('streetnumber') && hidden.defined('address') && hidden.defined('address2') &&
272                     hidden.defined('city') && hidden.defined('state') && hidden.defined('zipcode') &&
273                     hidden.defined('country')
274                 %]
275                     <fieldset class="rows" id="memberentry_mainaddress">
276                         <legend id="mainaddress_legend">Main address</legend>
277
278                         <ol>
279                             [% UNLESS hidden.defined('streetnumber') %]
280                                 <li>
281                                     [% IF mandatory.defined('streetnumber') %]
282                                         <label for="borrower_streetnumber" class="required">
283                                     [% ELSE %]
284                                         <label for="borrower_streetnumber">
285                                     [% END %]
286                                     Street number:</label>
287
288                                     <input type="text" id="borrower_streetnumber" name="borrower_streetnumber" value="[% borrower.streetnumber %]" />
289                                     [% IF mandatory.defined('streetnumber') %]<span class="required">Required</span>[% END %]
290                                 </li>
291                             [% END %]
292
293                             [% UNLESS hidden.defined('address') %]
294                                 <li>
295                                     [% IF mandatory.defined('address') %]
296                                         <label for="borrower_address" class="required">
297                                     [% ELSE %]
298                                         <label for="borrower_address">
299                                     [% END %]
300                                     Address:</label>
301
302                                     <input type="text" id="borrower_address" name="borrower_address" value="[% borrower.address %]" />
303                                     [% IF mandatory.defined('address') %]<span class="required">Required</span>[% END %]
304                                 </li>
305                             [% END %]
306
307                             [% UNLESS hidden.defined('address2') %]
308                                 <li>
309                                     [% IF mandatory.defined('address2') %]
310                                         <label for="borrower_address2" class="required">
311                                     [% ELSE %]
312                                         <label for="borrower_address2">
313                                     [% END %]
314                                     Address 2:</label>
315
316                                     <input type="text" id="borrower_address2" name="borrower_address2" value="[% borrower.address2 %]" />
317                                     [% IF mandatory.defined('address2') %]<span class="required">Required</span>[% END %]
318                                 </li>
319                             [% END %]
320
321                             [% UNLESS hidden.defined('city') %]
322                                 <li>
323                                     [% IF mandatory.defined('city') %]
324                                         <label for="borrower_city" class="required">
325                                     [% ELSE %]
326                                         <label for="borrower_city">
327                                     [% END %]
328                                     City:</label>
329
330                                     <input type="text" id="borrower_city" name="borrower_city" value="[% borrower.city %]" />
331                                     [% IF mandatory.defined('city') %]<span class="required">Required</span>[% END %]
332                                 </li>
333                             [% END %]
334
335                             [% UNLESS hidden.defined('state') %]
336                                 <li>
337                                     [% IF mandatory.defined('state') %]
338                                         <label for="borrower_state" class="required">
339                                     [% ELSE %]
340                                         <label for="borrower_state">
341                                     [% END %]
342                                     State:</label>
343
344                                     <input type="text" id="borrower_state" name="borrower_state" value="[% borrower.state %]" />
345                                     [% IF mandatory.defined('state') %]<span class="required">Required</span>[% END %]
346                                 </li>
347                             [% END %]
348
349                             [% UNLESS hidden.defined('zipcode') %]
350                                 <li>
351                                     [% IF mandatory.defined('zipcode') %]
352                                         <label for="borrower_zipcode" class="required">
353                                     [% ELSE %]
354                                         <label for="borrower_zipcode">
355                                     [% END %]
356                                     ZIP/Postal code:</label>
357
358                                     <input type="text" id="borrower_zipcode" name="borrower_zipcode" value="[% borrower.zipcode %]" />
359                                     [% IF mandatory.defined('zipcode') %]<span class="required">Required</span>[% END %]
360                                 </li>
361                             [% END %]
362
363                             [% UNLESS hidden.defined('country') %]
364                                 <li>
365                                     [% IF mandatory.defined('country') %]
366                                         <label for="borrower_country" class="required">
367                                     [% ELSE %]
368                                         <label for="borrower_country">
369                                     [% END %]
370                                     Country:</label>
371
372                                     <input type="text" id="borrower_country" name="borrower_country" value="[% borrower.country %]" />
373                                     [% IF mandatory.defined('country') %]<span class="required">Required</span>[% END %]
374                                 </li>
375                             [% END %]
376
377                         </ol>
378                     </fieldset>
379                 [% END %]
380
381                 [% UNLESS
382                     hidden.defined('phone') && hidden.defined('phonepro') && hidden.defined('mobile') &&
383                     hidden.defined('email') && hidden.defined('emailpro') && hidden.defined('fax')
384                 %]
385                     <fieldset class="rows" id="memberentry_contact">
386                         <legend id="contact_legend">Contact information</legend>
387
388                         <ol>
389                             [% UNLESS hidden.defined('phone') %]
390                                 <li>
391                                     [% IF mandatory.defined('phone') %]
392                                         <label for="borrower_phone" class="required">
393                                     [% ELSE %]
394                                         <label for="borrower_phone">
395                                     [% END %]
396                                     Primary phone:</label>
397
398                                     <input type="text" id="borrower_phone" name="borrower_phone" value="[% borrower.phone %]" />
399                                     [% IF mandatory.defined('phone') %]<span class="required">Required</span>[% END %]
400                                 </li>
401                             [% END %]
402
403                             [% UNLESS hidden.defined('phonepro') %]
404                                 <li>
405                                     [% IF mandatory.defined('phonepro') %]
406                                         <label for="borrower_phonepro" class="required">
407                                     [% ELSE %]
408                                         <label for="borrower_phonepro">
409                                     [% END %]
410                                     Secondary phone:</label>
411
412                                     <input type="text" id="borrower_phonepro" name="borrower_phonepro" value="[% borrower.phonepro %]" />
413                                     [% IF mandatory.defined('phonepro') %]<span class="required">Required</span>[% END %]
414                                 </li>
415                             [% END %]
416
417                             [% UNLESS hidden.defined('mobile') %]
418                                 <li>
419                                     [% IF mandatory.defined('mobile') %]
420                                         <label for="borrower_mobile" class="required">
421                                     [% ELSE %]
422                                         <label for="borrower_mobile">
423                                     [% END %]
424                                     Other phone:</label>
425
426                                     <input type="text" id="borrower_mobile" name="borrower_mobile" value="[% borrower.mobile %]" />
427                                     [% IF mandatory.defined('mobile') %]<span class="required">Required</span>[% END %]
428                                 </li>
429                             [% END %]
430
431                             [% UNLESS hidden.defined('email') %]
432                                 <li>
433                                     [% IF mandatory.defined('email') %]
434                                         <label for="borrower_email" class="required">
435                                     [% ELSE %]
436                                         <label for="borrower_email">
437                                     [% END %]
438                                     Primary email:</label>
439
440                                     <input type="text" id="borrower_email" name="borrower_email" value="[% borrower.email %]" />
441                                     [% IF mandatory.defined('email') %]<span class="required">Required</span>[% END %]
442                                 </li>
443                             [% END %]
444
445                             [% UNLESS hidden.defined('emailpro') %]
446                                 <li>
447                                     [% IF mandatory.defined('emailpro') %]
448                                         <label for="borrower_emailpro" class="required">
449                                     [% ELSE %]
450                                         <label for="borrower_emailpro">
451                                     [% END %]
452                                     Secondary email:</label>
453
454                                     <input type="text" id="borrower_emailpro" name="borrower_emailpro" value="[% borrower.emailpro %]" />
455                                     [% IF mandatory.defined('emailpro') %]<span class="required">Required</span>[% END %]
456                                 </li>
457                             [% END %]
458
459                             [% UNLESS hidden.defined('fax') %]
460                                 <li>
461                                     [% IF mandatory.defined('fax') %]
462                                         <label for="borrower_fax" class="required">
463                                     [% ELSE %]
464                                         <label for="borrower_fax">
465                                     [% END %]
466                                     Fax:</label>
467
468                                     <input type="text" id="borrower_fax" name="borrower_fax" value="[% borrower.fax %]" />
469                                     [% IF mandatory.defined('fax') %]<span class="required">Required</span>[% END %]
470                                 </li>
471                             [% END %]
472                         </ol>
473                     </fieldset>
474                 [% END %]
475
476                 [% UNLESS
477                     hidden.defined('B_address') && hidden.defined('B_address2') && hidden.defined('B_city') &&
478                     hidden.defined('B_state') && hidden.defined('B_zipcode') && hidden.defined('B_country') &&
479                     hidden.defined('B_phone') && hidden.defined('B_email') && hidden.defined('contactnote')
480                 %]
481                     <fieldset class="rows" id="memberentry_alternateaddress">
482                         <legend id="alternateaddress_legend">Alternate address</legend>
483
484                         <ol>
485                             [% UNLESS hidden.defined('B_address') %]
486                                 <li>
487                                     [% IF mandatory.defined('B_address') %]
488                                         <label for="borrower_B_address" class="required">
489                                     [% ELSE %]
490                                         <label for="borrower_B_address">
491                                     [% END %]
492                                     Address:</label>
493
494                                     <input type="text" id="borrower_B_address" name="borrower_B_address" value="[% borrower.B_address %]" />
495                                     [% IF mandatory.defined('B_address') %]<span class="required">Required</span>[% END %]
496                                 </li>
497                             [% END %]
498
499                             [% UNLESS hidden.defined('B_address2') %]
500                                 <li>
501                                     [% IF mandatory.defined('B_address2') %]
502                                         <label for="borrower_B_address2" class="required">
503                                     [% ELSE %]
504                                         <label for="borrower_B_address2">
505                                     [% END %]
506                                     Address 2:</label>
507
508                                     <input type="text" id="borrower_B_address2" name="borrower_B_address2" value="[% borrower.B_address2 %]" />
509                                     [% IF mandatory.defined('B_address2') %]<span class="required">Required</span>[% END %]
510                                 </li>
511                             [% END %]
512
513                             [% UNLESS hidden.defined('B_city') %]
514                                 <li>
515                                     [% IF mandatory.defined('B_city') %]
516                                         <label for="borrower_B_city" class="required">
517                                     [% ELSE %]
518                                         <label for="borrower_B_city">
519                                     [% END %]
520                                     City:</label>
521
522                                     <input type="text" id="borrower_B_city" name="borrower_B_city" value="[% borrower.B_city %]" />
523                                     [% IF mandatory.defined('B_city') %]<span class="required">Required</span>[% END %]
524                                 </li>
525                             [% END %]
526
527                             [% UNLESS hidden.defined('B_state') %]
528                                 <li>
529                                     [% IF mandatory.defined('B_state') %]
530                                         <label for="borrower_B_state" class="required">
531                                     [% ELSE %]
532                                         <label for="borrower_B_state">
533                                     [% END %]
534                                     State:</label>
535
536                                     <input type="text" id="borrower_B_state" name="borrower_B_state" value="[% borrower.B_state %]" />
537                                     [% IF mandatory.defined('B_state') %]<span class="required">Required</span>[% END %]
538                                 </li>
539                             [% END %]
540
541                             [% UNLESS hidden.defined('B_zipcode') %]
542                                 <li>
543                                     [% IF mandatory.defined('B_zipcode') %]
544                                         <label for="borrower_B_zipcode" class="required">
545                                     [% ELSE %]
546                                         <label for="borrower_B_zipcode">
547                                     [% END %]
548                                     ZIP/Postal code:</label>
549
550                                     <input type="text" id="borrower_B_zipcode" name="borrower_B_zipcode" value="[% borrower.B_zipcode %]" />
551                                     [% IF mandatory.defined('B_zipcode') %]<span class="required">Required</span>[% END %]
552                                 </li>
553                             [% END %]
554
555                             [% UNLESS hidden.defined('B_country') %]
556                                 <li>
557                                     [% IF mandatory.defined('B_country') %]
558                                         <label for="borrower_B_country" class="required">
559                                     [% ELSE %]
560                                         <label for="borrower_B_country">
561                                     [% END %]
562                                     Country:</label>
563
564                                     <input type="text" id="borrower_B_country" name="borrower_B_country" value="[% borrower.B_country %]" />
565                                     [% IF mandatory.defined('B_country') %]<span class="required">Required</span>[% END %]
566                                 </li>
567                             [% END %]
568
569                             [% UNLESS hidden.defined('B_phone') %]
570                                 <li>
571                                     [% IF mandatory.defined('B_phone') %]
572                                         <label for="borrower_B_phone" class="required">
573                                     [% ELSE %]
574                                         <label for="borrower_B_phone">
575                                     [% END %]
576                                     Phone:</label>
577
578                                     <input type="text" id="borrower_B_phone" name="borrower_B_phone" value="[% borrower.B_phone %]" />
579                                     [% IF mandatory.defined('B_phone') %]<span class="required">Required</span>[% END %]
580                                 </li>
581                             [% END %]
582
583                             [% UNLESS hidden.defined('B_email') %]
584                                 <li>
585                                     [% IF mandatory.defined('B_email') %]
586                                         <label for="borrower_B_email" class="required">
587                                     [% ELSE %]
588                                         <label for="borrower_B_email">
589                                     [% END %]
590                                     Email:</label>
591
592                                     <input type="text" id="borrower_B_email" name="borrower_B_email" value="[% borrower.B_email %]" />
593                                     [% IF mandatory.defined('B_email') %]<span class="required">Required</span>[% END %]
594                                 </li>
595                             [% END %]
596
597                             [% UNLESS hidden.defined('contactnote') %]
598                                 <li>
599                                     [% IF mandatory.defined('contactnote') %]
600                                         <label for="borrower_contactnote" class="required">
601                                     [% ELSE %]
602                                         <label for="borrower_contactnote">
603                                     [% END %]
604                                     Contact note:</label>
605
606                                     <textarea id="borrower_contactnote" name="borrower_contactnote" cols="30" rows="2">[% borrower.contactnote %]</textarea>
607                                     [% IF mandatory.defined('contactnote') %]<span class="required">Required</span>[% END %]
608                                 </li>
609                             [% END %]
610
611                         </ol>
612                     </fieldset>
613                 [% END %]
614
615                 [% UNLESS
616                     hidden.defined('altcontactsurname') && hidden.defined('altcontactfirstname') && hidden.defined('altcontactaddress1') &&
617                     hidden.defined('altcontactaddress2') && hidden.defined('altcontactaddress3') && hidden.defined('altcontactstate') &&
618                     hidden.defined('altcontactzipcode') && hidden.defined('altcontactcountry') && hidden.defined('altcontactphone')
619                 %]
620                     <fieldset class="rows" id="memberentry_alternatecontact">
621                         <legend id="alternatecontact_legend">Alternate contact</legend>
622
623                         <ol>
624                             [% UNLESS hidden.defined('altcontactsurname') %]
625                                 <li>
626                                     [% IF mandatory.defined('altcontactsurname') %]
627                                         <label for="borrower_altcontactsurname" class="required">
628                                     [% ELSE %]
629                                         <label for="borrower_altcontactsurname">
630                                     [% END %]
631                                     Surname:</label>
632
633                                     <input type="text" id="borrower_altcontactsurname" name="borrower_altcontactsurname" value="[% borrower.altcontactsurname %]" />
634                                     [% IF mandatory.defined('altcontactsurname') %]<span class="required">Required</span>[% END %]
635                                 </li>
636                             [% END %]
637
638                             [% UNLESS hidden.defined('altcontactfirstname') %]
639                                 <li>
640                                     [% IF mandatory.defined('altcontactfirstname') %]
641                                         <label for="borrower_altcontactfirstname" class="required">
642                                     [% ELSE %]
643                                         <label for="borrower_altcontactfirstname">
644                                     [% END %]
645                                     First name:</label>
646
647                                     <input type="text" id="borrower_altcontactfirstname" name="borrower_altcontactfirstname" value="[% borrower.altcontactfirstname %]" />
648                                     [% IF mandatory.defined('altcontactfirstname') %]<span class="required">Required</span>[% END %]
649                                 </li>
650                             [% END %]
651
652                             [% UNLESS hidden.defined('altcontactaddress1') %]
653                                 <li>
654                                     [% IF mandatory.defined('altcontactaddress1') %]
655                                         <label for="borrower_altcontactaddress1" class="required">
656                                     [% ELSE %]
657                                         <label for="borrower_altcontactaddress1">
658                                     [% END %]
659                                     Address:</label>
660
661                                     <input type="text" id="borrower_altcontactaddress1" name="borrower_altcontactaddress1" value="[% borrower.altcontactaddress1 %]" />
662                                     [% IF mandatory.defined('altcontactaddress1') %]<span class="required">Required</span>[% END %]
663                                 </li>
664                             [% END %]
665
666                             [% UNLESS hidden.defined('altcontactaddress2') %]
667                                 <li>
668                                     [% IF mandatory.defined('altcontactaddress2') %]
669                                         <label for="borrower_altcontactaddress2" class="required">
670                                     [% ELSE %]
671                                         <label for="borrower_altcontactaddress2">
672                                     [% END %]
673                                     Address 2:</label>
674
675                                     <input type="text" id="borrower_altcontactaddress2" name="borrower_altcontactaddress2" value="[% borrower.altcontactaddress2 %]" />
676                                     [% IF mandatory.defined('altcontactaddress2') %]<span class="required">Required</span>[% END %]
677                                 </li>
678                             [% END %]
679
680                             [% UNLESS hidden.defined('altcontactaddress3') %]
681                                 <li>
682                                     [% IF mandatory.defined('altcontactaddress3') %]
683                                         <label for="borrower_altcontactaddress3" class="required">
684                                     [% ELSE %]
685                                         <label for="borrower_altcontactaddress3">
686                                     [% END %]
687                                     City:</label>
688
689                                     <input type="text" id="borrower_altcontactaddress3" name="borrower_altcontactaddress3" value="[% borrower.altcontactaddress3 %]" />
690                                     [% IF mandatory.defined('altcontactaddress3') %]<span class="required">Required</span>[% END %]
691                                 </li>
692                             [% END %]
693
694                             [% UNLESS hidden.defined('altcontactstate') %]
695                                 <li>
696                                     [% IF mandatory.defined('altcontactstate') %]
697                                         <label for="borrower_altcontactstate" class="required">
698                                     [% ELSE %]
699                                         <label for="borrower_altcontactstate">
700                                     [% END %]
701                                     State:</label>
702
703                                     <input type="text" id="borrower_altcontactstate" name="borrower_altcontactstate" value="[% borrower.altcontactstate %]" />
704                                     [% IF mandatory.defined('altcontactstate') %]<span class="required">Required</span>[% END %]
705                                 </li>
706                             [% END %]
707
708                             [% UNLESS hidden.defined('altcontactzipcode') %]
709                                 <li>
710                                     [% IF mandatory.defined('altcontactzipcode') %]
711                                         <label for="borrower_altcontactzipcode" class="required">
712                                     [% ELSE %]
713                                         <label for="borrower_altcontactzipcode">
714                                     [% END %]
715                                     ZIP/Postal code:</label>
716
717                                     <input type="text" id="borrower_altcontactzipcode" name="borrower_altcontactzipcode" value="[% borrower.altcontactzipcode %]" />
718                                     [% IF mandatory.defined('altcontactzipcode') %]<span class="required">Required</span>[% END %]
719                                 </li>
720                             [% END %]
721
722                             [% UNLESS hidden.defined('altcontactcountry') %]
723                                 <li>
724                                     [% IF mandatory.defined('altcontactcountry') %]
725                                         <label for="borrower_altcontactcountry" class="required">
726                                     [% ELSE %]
727                                         <label for="borrower_altcontactcountry">
728                                     [% END %]
729                                     Country:</label>
730
731                                     <input type="text" id="borrower_altcontactcountry" name="borrower_altcontactcountry" value="[% borrower.altcontactcountry %]" />
732                                     [% IF mandatory.defined('altcontactcountry') %]<span class="required">Required</span>[% END %]
733                                 </li>
734                             [% END %]
735
736                             [% UNLESS hidden.defined('altcontactphone') %]
737                                 <li>
738                                     [% IF mandatory.defined('altcontactphone') %]
739                                         <label for="borrower_altcontactphone" class="required">
740                                     [% ELSE %]
741                                         <label for="borrower_altcontactphone">
742                                     [% END %]
743                                     Phone:</label>
744
745                                     <input type="text" id="borrower_altcontactphone" name="borrower_altcontactphone" value="[% borrower.altcontactphone %]" />
746                                     [% IF mandatory.defined('altcontactphone') %]<span class="required">Required</span>[% END %]
747                                 </li>
748                             [% END %]
749                         </ol>
750                     </fieldset>
751                 [% END %]
752
753                 [% UNLESS action == 'edit' %]
754                     <fieldset class="rows" id="memberentry_captcha">
755                         <ol>
756                             <li>
757                                 <label for="captcha" class="required">Verification:</label>
758
759                                 <input type="text" name="captcha" id="captcha" />
760                                 <input type="hidden" name="captcha_digest" value="[% captcha_digest %]" />
761
762                                 <span class="hint">Please type the following characters into the preceding box: <strong>[% captcha %]</strong></span>
763                                 <span class="hint">Note: The preceding box is case-sensitive. Ensure that the entered characters are in all-caps.</span>
764                             </li>
765                         </ol>
766                     </fieldset>
767                 [% END %]
768
769                 [% IF ( borrower.ExtendedPatronAttributes ) %]
770                     <fieldset class="rows">
771                         <legend>Additional information</legend>
772                         <ol>
773                             [% FOREACH patron_attribute IN borrower.patron_attributes %]
774                                 <li>
775                                     <label>[% patron_attribute.description %]:</label>
776                                     [% IF ( patron_attribute.value_description ) %]
777                                         [% patron_attribute.value_description %]
778                                     [% ELSE %]
779                                         [% patron_attribute.value |html_line_break %]
780                                     [% END %]
781                                 </li>
782                             [% END %]
783                         </ol>
784                     </fieldset>
785                 [% END %]
786
787                 [% IF action == 'edit' %]
788                     [% IF OPACPatronDetails %]
789                         <fieldset class="action">
790                             <input type="hidden" name="action" value="update" />
791                             <input type="submit" class="btn" value="Submit update request" />
792                         </fieldset>
793                     [% END %]
794                 [% ELSE %]
795                     <fieldset class="action">
796                         <input type="hidden" name="action" value="create" />
797                         <input type="submit" class="btn" value="Submit" />
798                     </fieldset>
799                 [% END %]
800
801                 </form>
802
803                     </div><!--/div id="update-account" -->
804                 </div>
805             </div>
806         </div>
807     </div>
808
809 [% INCLUDE 'opac-bottom.inc' %]
810 [% BLOCK jsinclude %]
811     <script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.validate.min.js"></script>
812     <script type="text/javascript">
813         //<![CDATA[
814         $(document).ready(function() {
815             [% IF action == 'edit' && !OPACPatronDetails %]
816                 $("#memberentry-form :input").attr('readonly', true);
817                 $("#borrower_branchcode").attr('disabled',true);
818                 $("#borrower_title").attr('disabled',true);
819                 $('#memberentry-form :radio').attr('disabled',true);
820                 $('span.required').remove();
821                 $('label.required').removeClass('required');
822             [% ELSE %]
823                 $( "#borrower_dateofbirth" ).datepicker({ yearRange: "c-120:c" });
824             [% END %]
825             $("#memberentry-form").validate({
826                 rules: {
827                     borrower_email: {
828                         email: true
829                     },
830                     borrower_emailpro: {
831                         email: true
832                     },
833                     borrower_B_email: {
834                         email: true
835                     }
836                 },
837                 submitHandler: function(form) {
838                     if (form.beenSubmitted) {
839                         return false;
840                     }
841                     else {
842                         form.beenSubmitted = true;
843                         form.submit();
844                     }
845                 },
846                 errorPlacement: function(error, element) {
847                     offset = element.offset();
848                     error.insertAfter(element)
849                     error.addClass('error');  // add a class to the wrapper
850                     error.css('position', 'absolute');
851                     error.css('left', offset.left + element.outerWidth() + 10);
852                     error.css('top', offset.top);
853                     error.css('width', 'auto');
854                 }
855             });
856         });
857     //]]>
858     </script>
859 [% INCLUDE 'calendar.inc' %]
860 [% END %]