Merge remote-tracking branch 'origin/new/bug_8062'
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / memberentrygen.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Patrons &rsaquo; 
3 [% IF ( opadd ) %]Add[% ELSIF ( opduplicate ) %]Duplicate[% ELSE %] Modify[% END %] [% IF ( categoryname ) %] [% categoryname %] patron[% ELSE %][% IF ( I ) %] Organization patron[% END %][% IF ( A ) %] Adult patron[% END %][% IF ( C ) %] Child patron[% END %][% IF ( P ) %] Professional patron[% END %][% IF ( S ) %] Staff patron[% END %][% END %][% UNLESS ( opadd ) %] [% surname %], [% firstname %][% END %]</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 [% INCLUDE 'calendar.inc' %]
6 <script type="text/JavaScript">
7 //<![CDATA[
8     $(document).ready(function() {
9                 $("fieldset.rows input").keydown(function(e){ return checkEnter(e); });
10         $("#guarantordelete").click(function() {
11             $("#contact-details").hide().find('a').remove();
12             $("#guarantorid, #contactname, #contactfirstname").each(function () { this.value = "" });
13             $("#contactname, #contactfirstname")
14                 .each(function () { this.type = 'text' })
15                 .parent().find('span').remove();
16             $("#guarantorsearch").val("Set to Patron");
17         });
18         $("#select_city").change(function(){
19             var myRegEx=new RegExp(/(.*)\|(.*)\|(.*)\|(.*)/);
20             document.form.select_city.value.match(myRegEx);
21             document.form.zipcode.value=RegExp.$1;
22             document.form.city.value=RegExp.$2;
23             document.form.state.value=RegExp.$3;
24             document.form.country.value=RegExp.$4;
25         });
26
27         [% IF categorycode %]
28             update_category_code( "[% categorycode %]" );
29         [% ELSE %]
30             if ( $("#categorycode").length > 0 ){
31                 var category_code = $("#categorycode").find("option:selected").val();
32                 update_category_code( category_code );
33             }
34         [% END %]
35         $("#dateofbirth").datepicker({ maxDate: "-1D" });
36     });
37
38     function clear_entry(node) {
39         var original = node.parentNode.parentNode;
40         $("input[type=text]", original).attr('value', '');
41         $("select", original).attr('value', '');
42     }
43
44     function clone_entry(node) {
45         var original = node.parentNode.parentNode;
46         var clone = original.cloneNode(true);
47         var newId = 50 + parseInt(Math.random() * 100000);
48         $("input", clone).attr('id', function() {
49             return this.id.replace(/patron_attr_\d+/, 'patron_attr_' + newId);
50         });
51         $("input", clone).attr('name', function() {
52             return this.name.replace(/patron_attr_\d+/, 'patron_attr_' + newId);
53         });
54         $("select", clone).attr('id', function() {
55             return this.id.replace(/patron_attr_\d+/, 'patron_attr_' + newId);
56         });
57         $("select", clone).attr('name', function() {
58             return this.name.replace(/patron_attr_\d+/, 'patron_attr_' + newId);
59         });
60         $("input#patron_attr_" + newId, clone).attr('value','');
61         $("select#patron_attr_" + newId, clone).attr('value','');
62         original.parentNode.insertBefore(clone, original.nextSibling);
63     }
64
65     function update_category_code(category_code) {
66         if ( $(category_code).is("select") ) {
67             category_code = $("#categorycode").find("option:selected").val();
68         }
69         var mytables = $(".attributes_table>tbody");
70
71         mytables.find("tr").each(function(){
72             $(this).hide()
73         });
74
75         mytables.find("tr[data-category_code="+category_code+"]").each(function(){
76             $(this).show();
77         });
78         mytables.find("tr[data-category_code='']").each(function(){
79             $(this).show();
80         });
81
82     }
83
84                 var MSG_SEPARATOR = _("Separator must be / in field ");
85         var MSG_INCORRECT_DAY = _("Invalid day entered in field ");
86         var MSG_INCORRECT_MONTH = _("Invalid month entered in field ");
87         var MSG_INCORRECT_YEAR = _("Invalid year entered in field ");
88         var MSG_DUPLICATE_PATRON = _("Warning: Duplicate patron");
89         var MSG_DUPLICATE_ORGANIZATION = _("Warning: Duplicate organization");
90         var MSG_LATE_EXPIRY = _("Warning: Expiration date falls before enrollment date");
91         var MSG_MISSING_MANDATORY = _("The following fields are mandatory:");
92         var MSG_DUPLICATE_SUSPICION = _("Please confirm whether this is a duplicate patron");
93         var MSG_PASSWORD_MISMATCH = _("The passwords entered do not match");
94 //]]>
95 </script>
96 <script type="text/javascript" src="[% themelang %]/js/members.js"></script>
97 </head>
98 <body id="pat_memberentrygen" class="pat">
99 [% INCLUDE 'header.inc' %]
100 [% INCLUDE 'patron-search.inc' %]
101
102 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; 
103 [% IF ( opadd ) %]
104                 Add[% IF ( categoryname ) %] [% categoryname %] patron[% ELSE %][% IF ( I ) %] Organization patron[% END %][% IF ( A ) %] Adult patron[% END %][% IF ( C ) %] Child patron[% END %][% IF ( P ) %] Professional patron[% END %][% IF ( S ) %] Staff patron[% END %][% END %]
105 [% surname %] [% firstname %]
106 [% ELSE %] 
107 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% firstname %] [% surname %]</a> &rsaquo; <strong>[% IF ( opduplicate ) %]Duplicate[% ELSE %]Modify[% END %][% IF ( categoryname ) %] [% categoryname %] patron[% ELSE %][% IF ( I ) %] Organization patron[% END %][% IF ( A ) %] Adult patron[% END %][% IF ( C ) %] Child patron[% END %][% IF ( P ) %] Professional patron[% END %][% IF ( S ) %] Staff patron[% END %][% END %]
108 </strong>[% END %]</div>
109 [% IF ( opadd ) %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %]
110    
111    <div id="bd">
112         <div id="yui-main">
113         <div class="yui-b">
114
115     [% IF error_alert %]
116         [% IF ( error_alert == "no_email" ) %]
117             <div class="error">This member has no email</div>
118         [% ELSE %]
119             <div class="error">[% error_alert %]</div>
120         [% END %]
121     [% END %]
122     [% IF info_alert %]
123         <div class="dialog message">Email has been sent.</div>
124     [% END %]
125
126         [% IF ( no_add ) %]<div class="dialog alert"><h3>Cannot add patron</h3>
127                 [% IF ( no_branches ) %]<p>There are <strong>no libraries defined</strong>. [% IF ( CAN_user_parameters ) %]Please <a href="/cgi-bin/koha/admin/branches.pl">add a library</a>.[% ELSE %]An administrator must define at least one library.[% END %]</p>[% END %]
128                 [% IF ( no_categories ) %]<p>There are <strong>no patron categories defined</strong>. [% IF ( CAN_user_parameters ) %]Please <a href="/cgi-bin/koha/admin/categorie.pl">add a patron category</a>.[% ELSE %]An administrator must define at least one patron category.</p>[% END %][% END %]</div>[% END %]
129
130         [% UNLESS ( no_add ) %]
131         [% IF ( opadd ) %]
132         <h1>
133                 Add[% IF ( categoryname ) %] [% categoryname %] patron[% ELSE %][% IF ( I ) %] Organization patron[% END %][% IF ( A ) %] Adult patron[% END %][% IF ( C ) %] Child patron[% END %][% IF ( P ) %] Professional patron[% END %][% IF ( S ) %] Staff patron[% END %][% END %] [% firstname %] [% surname %] 
134         </h1>
135         [% ELSE %]
136         <h1>
137                 [% IF ( opduplicate ) %]Duplicate[% ELSE %]Modify[% END %][% IF ( categoryname ) %] [% categoryname %] patron[% ELSE %][% IF ( I ) %] Organization patron[% END %][% IF ( A ) %] Adult patron[% END %][% IF ( C ) %] Child patron[% END %][% IF ( P ) %] Professional patron[% END %][% IF ( S ) %] Staff patron[% END %][% END %]
138 [% firstname %] [% surname %] 
139         </h1>
140         [% END %]
141   
142         [% IF ( check_member ) %]
143                         <div class="dialog alert">
144                                 <h3>Duplicate patron record?</h3>
145                                 <p><a class="popup" href="javascript:Dopop('moremember.pl?print=brief&amp;borrowernumber=[% check_member %]');" >View existing record</a></p>
146                                 <form action="/cgi-bin/koha/members/memberentry.pl" method="get"><input type="hidden" name="op" value="modify" /><input type="hidden" name="borrowernumber" value="[% check_member %]" /><input type="hidden" name="category_type" value="[% check_categorytype %]" /><input class="edit" type="submit" value="It is a duplicate. Edit existing record" /></form>
147
148                 <form name="form_double" action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off">
149                                 <input type="hidden" name="nodouble" value="1" />
150                                 <input class="new" type="submit" value="Not a duplicate. Save as new record" />
151                         </div>
152         [% END %]
153
154         [% IF ( debug ) %]
155                 <div id="debug">
156                                 <div>Debug is on (level [% debug %])</div>
157                 </div>
158         [% END %]
159         [% IF ( nok ) %]
160                 <div class="dialog alert">
161                         <p>The following fields are wrong. Please fix them.</p>
162                         <ul>
163                         [% IF ( ERROR_login_exist ) %]
164                                 <li id="ERROR_login_exist">Username/password already exists.</li>
165                         [% END %]
166                         [% IF ( ERROR_cardnumber ) %]
167                                 <li id="ERROR_cardnumber">Cardnumber already in use.</li>
168                         [% END %]
169                         [% IF ( ERROR_age_limitations ) %]
170                                 <li id="ERROR_age_limitations">Patron's age is incorrect for their category.  
171                     Ages allowed are [% age_low %]-[% age_high %].</li>
172                         [% END %]
173                         [% IF ( ERROR_branch ) %]
174                                 <li id="ERROR_branch">Library is invalid.</li>
175                         [% END %]   
176                         [% IF ( ERROR_dateofbirth ) %]
177                                 <li id="ERROR_dateofbirth">Date of birth is invalid.</li>
178                         [% END %]
179                         [% IF ( ERROR_dateenrolled ) %]
180                                 <li id="ERROR_dateenrolled">Date of enrollment is invalid.</li>
181                         [% END %]
182                         [% IF ( ERROR_dateexpiry ) %]
183                                 <li id="ERROR_dateexpiry">Date of expiration is invalid.</li>
184                         [% END %]
185                         [% IF ( ERROR_short_password ) %]
186                                 <li id="ERROR_short_password">Password must be at least [% minPasswordLength %] characters long.</li>
187                         [% END %]
188                         [% IF ( ERROR_password_mismatch ) %]
189                                 <li id="ERROR_password_mismatch">Passwords do not match.</li>
190                         [% END %]
191             [% IF ( ERROR_extended_unique_id_failed ) %]
192                 <li id="ERROR_extended_unique_id_failed">The attribute value 
193                     [% ERROR_extended_unique_id_failed %] is already is use by another patron record.</li>
194                         [% END %]
195                         </ul>
196                 </div>
197         [% END %]
198
199
200 [% UNLESS ( check_member ) %]<form name="form" id="entryform"  action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off">
201 <input type="hidden" name="nodouble"  value="[% nodouble %]" /> [% END %]
202 <!--    field always hidden in different form (1,2,3) -->
203 <input type="hidden" name="BorrowerMandatoryField" value="[% BorrowerMandatoryField %]" />
204 <input type="hidden" name="category_type" value="[% category_type %]" />
205 <input type="hidden" name="updtype" value="[% updtype %]" />
206 <input type="hidden" name="select_roadtype" value="[% select_roadtype %]" />
207 <input type="hidden" name="destination" value="[% destination %]" />
208 <input type="hidden" name="check_member" value="[% check_member %]" />
209 <input type="hidden" name="borrowernumber" value="[% IF ( opduplicate ) %][% ELSE %][% borrowernumber %][% END %]" />
210 <input type="hidden" name="nodouble"  value="[% IF ( opduplicate ) %][% ELSE %][% nodouble %][% END %]" />
211 [% IF ( step ) %]<input type="hidden" name="step"  value="[% step %]" />[% END %]
212 [% IF ( opadd ) %]<input type="hidden" name="op" value="insert" />
213 [% ELSIF ( opduplicate ) %]
214 <input type="hidden" name="op" value="insert" />
215 [% ELSE %]
216 <input type="hidden" name="op" value="save" />
217 [% IF step == 4 || step == 5 || step == 6 || step == 2 || step == 1 %]
218 [%# Only put the cardnumber if we arent showing it in the form later %]
219 [% IF cardnumber %]
220 <input type="hidden" name="cardnumber" value="[% cardnumber %]" />
221 [% END %]
222 [% END %]
223 [% END %]
224
225 [% IF ( step_1 ) %]
226 [%UNLESS notitle && nosurname && nofirstname && nodateofbirth && noinitials && noothernames &&nosex %]
227         <fieldset class="rows" id="memberentry_identity">
228                 <legend id="identity_lgd">[% IF ( I ) %]Organization [% ELSE %]Patron [% END %]identity</legend>
229                 <ol>
230                 [% UNLESS ( I ) %]
231         [% UNLESS notitle %]
232                 [% IF ( title_cgipopup ) %]
233             <li>
234             [% IF ( mandatorytitle ) %]
235                 <label for="btitle" class="required">
236             [% ELSE %]
237                 <label for="btitle">
238             [% END %]
239             Salutation: </label>
240             [% borrotitlepopup %]
241             [% IF ( mandatorytitle ) %]<span class="required">Required</span>[% END %]
242             </li>
243                 [% END %]
244         [% END %]
245                 [% END %]
246         [% UNLESS nosurname %]
247                 <li>
248                 [% IF ( mandatorysurname ) %]
249                 <label for="surname" class="required">
250                 [% ELSE %]
251                 <label for="surname">
252                 [% END %]
253                 Surname: </label>
254                 [% IF ( uppercasesurnames ) %]
255                         [% IF ( opduplicate ) %]
256                                 <input style="text-transform:uppercase;" type="text" id="surname" name="surname" size="20"  value="[% surname %]" onclick="this.value=''" />
257                         [% ELSE %]
258                                 <input style="text-transform:uppercase;" type="text" id="surname" name="surname" size="20"  value="[% surname %]" />
259                         [% END %]
260                 [% ELSE %]
261                         [% IF ( opduplicate ) %]
262                                 <input type="text" id="surname" name="surname" size="20"  value="[% surname %]" onclick="this.value=''" />
263                         [% ELSE %]
264                                 <input type="text" id="surname" name="surname" size="20"  value="[% surname %]" />
265                         [% END %]
266                 [% END %]
267                 [% IF ( mandatorysurname ) %]<span class="required">Required</span>[% END %]
268                 </li>
269         [% END %]
270                 [% UNLESS ( I ) %]
271         [% UNLESS nofirstname %]
272             <li>
273                 [% IF ( mandatoryfirstname ) %]
274                 <label for="firstname" class="required">
275                 [% ELSE %]
276                 <label for="firstname">
277                 [% END %]
278                 First name: </label>
279                 <input type="text" id="firstname" name="firstname" size="20"  value="[% IF ( opduplicate ) %][% ELSE %][% firstname %][% END %]" />
280                 [% IF ( mandatoryfirstname ) %]<span class="required">Required</span>[% END %]
281             </li>
282         [% END %]
283         [% UNLESS nodateofbirth %]
284             <li>
285                 [% IF ( mandatorydateofbirth ) %]
286                 <label for="dateofbirth" class="required">
287                 [% ELSE %]
288                 <label for="dateofbirth">
289                 [% END %]
290                 Date of birth: </label>
291                                 
292         [% IF ( metric ) %]                     
293                 <input type="text" id="dateofbirth" name="dateofbirth" size="20" onchange="CheckDate(document.form.dateofbirth);" value="[% IF ( opduplicate ) %][% ELSE %][% dateofbirth %][% END %]" />
294 [% ELSE %]
295                 <input type="text" id="dateofbirth" name="dateofbirth" size="20" value="[% IF ( opduplicate ) %][% ELSE %][% dateofbirth %][% END %]" />
296 [% END %]
297
298         [% IF ( mandatorydateofbirth ) %]<span class="required">Required</span>[% END %]
299         [% IF ( ERROR_dateofbirth ) %]<span class="required">(Error)</span>[% END %]
300                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
301             </li>
302         [% END %]
303         [% UNLESS noinitials %]
304             <li>
305                 [% IF ( mandatoryinitials ) %]
306                     <label for="initials" class="required">
307                 [% ELSE %]
308                     <label for="initials">
309                 [% END %]
310                 Initials: </label>
311                 [% IF ( opduplicate ) %]
312                                         <input type="text" id="initials" name="initials" size="20"  value="[% initials %]" onclick="this.value=''" />
313                 [% ELSE %]
314                                         <input type="text" id="initials" name="initials" size="20"  value="[% initials %]" />
315                 [% END %]
316                 [% IF ( mandatoryinitials ) %]<span class="required">Required</span>[% END %]
317             </li>
318         [% END %]
319         [% END %]
320         [% UNLESS noothernames %]
321                 <li>
322                         [% IF ( mandatoryothernames ) %]
323                         <label for="othernames" class="required">
324                         [% ELSE %]
325                         <label for="othernames">
326                         [% END %]
327                         Other name: </label>
328                         [% IF ( opduplicate ) %]
329                                 <input type="text" id="othernames" name="othernames" size="20"  value="[% othernames %]" onclick="this.value=''" />
330                         [% ELSE %]
331                                 <input type="text" id="othernames" name="othernames" size="20"  value="[% othernames %]" />
332                         [% END %]
333 [% IF ( mandatoryothernames ) %]<span class="required">Required</span>[% END %]
334                 [% IF ( I ) %]<input type="hidden" name="sex" value="N" />[% END %]
335                 </li>
336         [% END %]
337     [% UNLESS ( I ) %]
338         [% UNLESS nosex %]
339                 <li class="radio">
340                 
341                 [% IF ( female ) %]
342                                 <label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F" checked="checked"  />
343 [% ELSE %]
344                                 <label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F" />
345 [% END %]
346                 [% IF ( male ) %]
347                 <label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" checked="checked" />
348 [% ELSE %]
349                                 <label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" />
350 [% END %]
351 [% IF ( none ) %]
352                                 <label for="sex-none">N/A </label><input type="radio" name="sex" id="sex-none" value=""  checked="checked"  />
353 [% ELSE %]
354                                 <label for="sex-none">N/A </label><input type="radio" name="sex" id="sex-none" value="" />
355 [% END %]
356         </li>
357         [% END %]
358     [% END %]
359                 </ol>
360         </fieldset>
361 [% END # hide fieldset %]
362
363 [% IF ( showguarantor ) %]<input type="hidden" id="guarantorid" name="guarantorid"   value="[% guarantorid %]" />
364     <fieldset class="rows">
365         <legend>Guarantor information</legend>
366         <ol>
367 [% IF ( P ) %]
368                 [% IF ( guarantorid ) %]
369                 <li id="contact-details">
370                 [% ELSE %]
371                 <li id="contact-details" style="display: none">
372                 [% END %]
373                     <span class="label">Organization #:</span> [% IF ( guarantorid ) %] <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantorid %]" target="blank">[% guarantorid %]</a>[% END %]
374                 </li>
375                 <li>
376                     <label for="contactname">Organization name: </label>
377                     [% IF ( guarantorid ) %]
378                     <span>[% contactname %]</span>
379                     <input name="contactname" id="contactname" type="hidden" size="20" value="[% contactname %]" />
380                     [% ELSE %]
381                             [% IF ( opduplicate ) %]
382                                                 <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" onclick="this.value=''" />
383                             [% ELSE %]
384                                                 <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" />
385                             [% END %]
386                     [% END %]
387                 </li>
388 [% ELSE %]
389  [% IF ( C ) %]
390  [% IF ( guarantorid ) %]
391  <li id="contact-details">
392  [% ELSE %]
393  <li id="contact-details" style="display: none">
394  [% END %]
395      <span class="label">Patron #:</span> [% IF ( guarantorid ) %] <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantorid %]" target="blank">[% guarantorid %]</a>[% END %]
396  </li>
397         [% UNLESS nocontactname %]
398  <li>
399      <label for="contactname">Surname: </label>
400      [% IF ( guarantorid ) %]
401      <span>[% contactname %]</span>
402      <input name="contactname" id="contactname" type="hidden" size="20" value="[% contactname %]" />
403      [% ELSE %]
404                 [% IF ( opduplicate ) %]
405                         <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" onclick="this.value=''" />
406                 [% ELSE %]
407                         <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" />
408                 [% END %]
409      [% END %]
410  </li>
411         [% END %]
412         [% UNLESS nocontactfirstname %]
413  <li>
414      <label for="contactfirstname">First name: </label>
415      [% IF ( guarantorid ) %]
416      <span>[% contactfirstname %]</span>
417      <input name="contactfirstname" id="contactfirstname" type="hidden" size="20" value="[% contactfirstname %]" />
418      [% ELSE %]
419              [% IF ( opduplicate ) %]
420                                 <input name="contactfirstname" id="contactfirstname" type="text" size="20" value="[% contactfirstname %]" onclick="this.value=''" />
421              [% ELSE %]
422                                 <input name="contactfirstname" id="contactfirstname" type="text" size="20" value="[% contactfirstname %]" />
423              [% END %]
424      [% END %]
425  </li>
426         [% END %]
427  [% IF ( relshiploop ) %]
428  <li>
429      <label for="relationship">Relationship: </label>
430      <select name="relationship" id="relationship" >
431          [% FOREACH relshiploo IN relshiploop %]
432          [% IF ( relshiploo.selected ) %]
433          <option value="[% relshiploo.relationship %]" selected="selected" >[% relshiploo.relationship %]</option>
434          [% ELSE %]
435          <option value="[% relshiploo.relationship %]">[% relshiploo.relationship %]</option>
436          [% END %]
437          [% END %]
438      </select>
439  </li>
440  [% END %]
441  [% END %]
442 [% END %]
443         <li>
444             <span class="label">&nbsp;</span>
445             [% IF ( guarantorid ) %]
446             <input id="guarantorsearch" type="button" value="Change" onclick="Dopopguarantor('guarantor_search.pl?category_type=[% category_type %]');" />
447             [% ELSE %]
448             <input id="guarantorsearch" type="button" value="Set to patron" onclick="Dopopguarantor('guarantor_search.pl?category_type=[% category_type %]');" />
449             [% END %]
450             <input id="guarantordelete" type="button" value="Delete" />
451         </li>
452         </ol>
453     </fieldset>
454
455 [% END %]
456 [% UNLESS noaddress && noaddress2 && nocity && nostate && nozipcode && nocountry %]
457 <fieldset class="rows">
458     <legend id="main_address_lgd">Main address</legend><ol>
459         [% UNLESS nostreetnumber %]
460     <li>
461       [% IF ( mandatorystreetnumber ) %]
462       <label for="streetnumber" class="required">
463       [% ELSE %]
464       <label for="streetnumber">
465       [% END %]
466       Street number: </label>
467       [% IF ( opduplicate ) %]
468                 <input type="text" id="streetnumber" name="streetnumber" size="5" value="[% streetnumber %]" onclick="this.value=''" />
469       [% ELSE %]
470                 <input type="text" id="streetnumber" name="streetnumber" size="5" value="[% streetnumber %]" />
471       [% END %]
472 [% IF ( mandatorystreetnumber ) %]<span class="required">Required</span>[% END %]
473     </li>
474         [% END %]
475         [% UNLESS nostreettype %]
476     [% IF ( road_cgipopup ) %]
477       <li>
478       [% IF ( mandatorystreettype ) %]
479       <label for="streettype" class="required">
480       [% ELSE %]
481       <label for="streettype">
482       [% END %]
483       Street type: </label>
484       [% roadpopup %]
485           [% IF ( mandatorystreettype ) %]<span class="required">Required</span>[% END %]
486       </li>
487     [% END %] 
488         [% END %]
489         [% UNLESS noaddress %]
490     <li>
491       [% IF ( mandatoryaddress ) %]
492       <label for="address" class="required">
493       [% ELSE %]
494       <label for="address">
495       [% END %]
496       Address: </label>
497       [% IF ( opduplicate ) %]
498                         <input type="text" id="address" name="address" size="35" value="[% address %]" onclick="this.value=''" />
499       [% ELSE %]
500                         <input type="text" id="address" name="address" size="35" value="[% address %]" />
501       [% END %]
502           [% IF ( mandatoryaddress ) %]<span class="required">Required</span>[% END %]
503     </li>
504         [% END %]
505         [% UNLESS noaddress2 %]
506     <li>
507       [% IF ( mandatoryaddress2 ) %]
508       <label for="address2" class="required">
509       [% ELSE %]
510       <label for="address2">
511       [% END %]
512       Address 2: </label>
513       [% IF ( opduplicate ) %]
514                         <input type="text" id="address2" name="address2" size="35" value="[% address2 %]" onclick="this.value=''" />
515       [% ELSE %]
516                         <input type="text" id="address2" name="address2" size="35" value="[% address2 %]" />
517       [% END %]
518           [% IF ( mandatoryaddress2 ) %]<span class="required">Required</span>[% END %]
519     </li>  
520         [% END %]
521         [% UNLESS nocity %]
522     <li>
523       [% IF ( mandatorycity ) %]
524         <label for="city" class="required">
525       [% ELSE %]
526         <label for="city">
527       [% END %]
528       City: </label>
529         [% IF ( opduplicate ) %]
530                         <input type="text" id="city" name="city" size="20" value="[% city %]" onclick="this.value=''" />
531         [% ELSE %]
532                         <input type="text" id="city" name="city" size="20" value="[% city %]" />
533         [% END %]
534         [% IF ( city_cgipopup ) %]or <strong>choose</strong>
535         <select id="select_city" name="select_city">
536         [% FOREACH city_loo IN city_loop %]
537             [% IF ( city_loo.selected ) %]
538             <option value="[% city_loo.city_zipcode %]|[% city_loo.city_name %]|[% city_loo.city_state %]|[% city_loo.city_country %]" selected="selected">
539             [% ELSE %]
540             <option value="[% city_loo.city_zipcode %]|[% city_loo.city_name %]|[% city_loo.city_state %]|[% city_loo.city_country %]">
541             [% END %]
542                 [% city_loo.city_name %] [% city_loo.city_state %] [% city_loo.city_zipcode %]
543             </option>
544         [% END %]
545         </select>
546         [% END %]
547           [% IF ( mandatorycity ) %]<span class="required">Required</span>[% END %]
548     </li>
549         [% END %]
550         [% UNLESS nostate %]
551     <li> 
552       [% IF ( mandatorystate ) %]
553         <label for="state" class="required">
554       [% ELSE %]
555         <label for="state">
556       [% END %]
557       State: </label>
558       <input type="text" name="state" id="state" size="20" value="[% state %]" />
559           [% IF ( mandatorystate ) %]<span class="required">Required</span>[% END %]
560     </li>
561         [% END %]
562         [% UNLESS nozipcode %]
563     <li> 
564       [% IF ( mandatoryzipcode ) %]
565         <label for="zipcode" class="required">
566       [% ELSE %]
567         <label for="zipcode">
568       [% END %]
569       Zip/Postal code: </label>
570       [% IF ( opduplicate ) %]
571                         <input type="text" name="zipcode" id="zipcode" size="10" value="[% zipcode %]" onclick="this.value=''" />
572       [% ELSE %]
573                         <input type="text" name="zipcode" id="zipcode" size="10" value="[% zipcode %]" />
574       [% END %]
575           [% IF ( mandatoryzipcode ) %]<span class="required">Required</span>[% END %]
576     </li>
577         [% END %]
578         [% UNLESS nocountry %]
579     <li> 
580       [% IF ( mandatorycountry ) %]
581         <label for="country" class="required">
582       [% ELSE %]
583         <label for="country">
584       [% END %]
585       Country: </label>
586       [% IF ( opduplicate ) %]
587                         <input type="text" name="country" id="country" size="20" value="[% country %]" onclick="this.value=''" />
588       [% ELSE %]
589                         <input type="text" name="country" id="country" size="20" value="[% country %]" />
590       [% END %]
591           [% IF ( mandatorycountry ) %]<span class="required">Required</span>[% END %]
592     </li>    
593         [% END %]
594         </ol>
595     </fieldset>
596 [% END # nostreet && nocity etc group%]
597
598 [% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %]
599   <fieldset class="rows" id="memberentry_contact">
600     <legend id="contact_lgd">Contact</legend><ol>
601         [% UNLESS nophone %]
602       <li>
603       [% IF ( mandatoryphone ) %] 
604       <label for="phone" class="required">
605       [% ELSE %]
606       <label for="phone">
607       [% END %]
608       Primary phone: </label>
609       [% IF ( opduplicate ) %]
610                         <input type="text" id="phone" name="phone" value="[% phone %]" onclick="this.value=''" />
611       [% ELSE %]
612                         <input type="text" id="phone" name="phone" value="[% phone %]" />
613       [% END %]
614           [% IF ( mandatoryphone ) %]<span class="required">Required</span>[% END %]<div class="hint">Shows on transit slips</div>
615
616     </li>
617         [% END %]
618         [% UNLESS nophonepro %]
619     <li>
620       [% IF ( mandatoryphonepro ) %]
621       <label for="phonepro" class="required">
622       [% ELSE %]
623       <label for="phonepro">
624       [% END %]
625       Secondary phone: </label>
626       [% IF ( opduplicate ) %]
627                         <input type="text" id="phonepro" name="phonepro" value="[% phonepro %]" onclick="this.value=''" />
628       [% ELSE %]
629                         <input type="text" id="phonepro" name="phonepro" value="[% phonepro %]" />
630       [% END %]
631           [% IF ( mandatoryphonepro ) %]<span class="required">Required</span>[% END %]
632     </li>
633         [% END %]
634         [% UNLESS nomobile %]
635     <li>
636       [% IF ( mandatorymobile ) %]
637       <label for="mobile" class="required">
638       [% ELSE %]
639       <label for="mobile">
640       [% END %]
641       Other phone: </label>
642       [% IF ( opduplicate ) %]
643                 <input type="text" id="mobile" name="mobile" value="[% mobile %]" onclick="this.value=''" />
644       [% ELSE %]
645                 <input type="text" id="mobile" name="mobile" value="[% mobile %]" />
646       [% END %]
647           [% IF ( mandatorymobile ) %]<span class="required">Required</span>[% END %]
648     </li>
649         [% END %]
650         [% UNLESS noemail %]
651     <li>
652       [% IF ( mandatoryemail ) %]
653       <label for="email" class="required">
654       [% ELSE %]
655       <label for="email">
656       [% END %]
657       Primary email: </label>
658       [% IF ( opduplicate ) %]
659                 <input type="text" id="email" name="email" size="45" value="[% email %]" onclick="this.value=''" />
660       [% ELSE %]
661                 <input type="text" id="email" name="email" size="45" value="[% email %]" />
662       [% END %]
663           [% IF ( mandatoryemail ) %]<span class="required">Required</span>[% END %]<div class="hint">Shows on transit slips</div>
664
665     </li>
666         [% END %]
667         [% UNLESS noemailpro %]
668     <li>
669       [% IF ( mandatoryemailpro ) %] 
670       <label for="emailpro" class="required">
671       [% ELSE %]
672       <label for="emailpro">
673       [% END %]
674       Secondary email: </label>
675       [% IF ( opduplicate ) %]
676                 <input type="text" id="emailpro" name="emailpro" size="45" value="[% emailpro %]" onclick="this.value=''" />
677       [% ELSE %]
678                 <input type="text" id="emailpro" name="emailpro" size="45" value="[% emailpro %]" />
679       [% END %]
680           [% IF ( mandatoryemailpro ) %]<span class="required">Required</span>[% END %]
681     </li>
682         [% END %]
683         [% UNLESS nofax %]
684     <li>
685       [% IF ( mandatoryfax ) %]
686       <label for="fax" class="required">
687       [% ELSE %]
688       <label for="fax">
689       [% END %]
690       Fax: </label>
691       [% IF ( opduplicate ) %]
692                 <input type="text" id="fax" name="fax" value="[% fax %]" onclick="this.value=''" />
693       [% ELSE %]
694                 <input type="text" id="fax" name="fax" value="[% fax %]" />
695       [% END %]
696           [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %]
697     </li>
698         [% END %]
699         </ol>
700   </fieldset>
701 [%END # hide fieldset %]
702
703 <!-- ************************ STEP_1 *********************** -->
704 [% END %]
705 [% IF ( step_6 ) %]
706
707     [% UNLESS noB_address && noB_address2 && noB_city && noB_zipcode && noB_state && noB_country &&nocontactnote && noB_phone && noB_email %]
708                 <fieldset class="rows" id="memberentry_address">
709                 <legend id="alt_address_lgd">Alternate address</legend><ol>
710         [% UNLESS noB_address %]
711                         <li>
712                                 [% IF ( mandatoryB_address ) %]
713                                         <label for="B_address" class="required">
714                                 [% ELSE %]
715                                         <label for="B_address">
716                                 [% END %]
717                                 Address: </label>
718                                 [% IF ( opduplicate ) %]
719                                         <input type="text" id="B_address" name="B_address" size="40" value="[% B_address %]" onclick="this.value=''" />
720                                 [% ELSE %]
721                                         <input type="text" id="B_address" name="B_address" size="40" value="[% B_address %]" />
722                                 [% END %]
723           [% IF ( mandatoryB_address ) %]<span class="required">Required</span>[% END %]
724                         </li>
725         [% END %]
726         [% UNLESS noB_address2 %]
727                         <li>
728                                 [% IF ( mandatoryB_address2 ) %]
729                                         <label for="B_address2" class="required">
730                                 [% ELSE %]
731                                         <label for="B_address2">
732                                 [% END %]
733                                 Address 2: </label>
734                                 [% IF ( opduplicate ) %]
735                                         <input type="text" id="B_address2" name="B_address2" size="40" value="[% B_address2 %]" onclick="this.value=''" />
736                                 [% ELSE %]
737                                         <input type="text" id="B_address2" name="B_address2" size="40" value="[% B_address2 %]" />
738                                 [% END %]
739           [% IF ( mandatoryB_address2 ) %]<span class="required">Required</span>[% END %]
740                         </li>
741         [% END %]
742         [% UNLESS noB_city %]
743                         <li>
744                                 [% IF ( mandatoryB_city ) %]
745                                         <label for="B_city" class="required" >
746                                 [% ELSE %]
747                                         <label for="B_city">
748                                 [% END %]
749                                 City: </label>
750                                 <input type="text" id="B_city" name="B_city" size="20" value="[% B_city %]" />
751           [% IF ( mandatoryB_city ) %]<span class="required">Required</span>[% END %]
752                         </li>
753         [% END %]
754         [% UNLESS noB_state %]
755                         <li>
756                                 [% IF ( mandatoryB_state ) %]
757                                         <label for="B_state" class="required" >
758                                 [% ELSE %]
759                                         <label for="B_state">
760                                 [% END %]
761                                 State: </label>
762                                 <input type="text" id="B_state" name="B_state" size="20" value="[% B_state %]" />
763           [% IF ( mandatoryB_state ) %]<span class="required">Required</span>[% END %]
764                         </li>
765         [% END %]
766         [% UNLESS noB_zipcode %]
767                         <li>
768                                 [% IF ( mandatoryB_zipcode ) %]
769                                         <label for="B_zipcode" class="required">
770                                 [% ELSE %]
771                                         <label for="B_zipcode">
772                                 [% END %]
773                                 Zip/Postal code: </label>
774                                 [% IF ( opduplicate ) %]
775                                         <input type="text" id="B_zipcode" name="B_zipcode" maxlength="10" size="10" value="[% B_zipcode %]" onclick="this.value=''" />
776                                 [% ELSE %]
777                                         <input type="text" id="B_zipcode" name="B_zipcode" maxlength="10" size="10" value="[% B_zipcode %]" />
778                                 [% END %]
779           [% IF ( mandatoryB_zipcode ) %]<span class="required">Required</span>[% END %]
780                         </li>
781         [% END %]
782         [% UNLESS noB_country %]
783                         <li>
784                                 [% IF ( mandatoryB_country ) %]
785                                         <label for="B_country" class="required">
786                                 [% ELSE %]
787                                         <label for="B_country">
788                                 [% END %]
789                                 Country: </label>
790                                 [% IF ( opduplicate ) %]
791                                         <input type="text" id="B_country" name="B_country" size="20" value="[% B_country %]" onclick="this.value=''" />
792                                 [% ELSE %]
793                                         <input type="text" id="B_country" name="B_country" size="20" value="[% B_country %]" />
794                                 [% END %]
795           [% IF ( mandatoryB_country ) %]<span class="required">Required</span>[% END %]
796                         </li>
797         [% END %]
798         [% UNLESS noB_phone %]
799             <li>
800                 [% IF ( mandatoryB_phone ) %]
801                 <label for="B_phone" class="required">
802                 [% ELSE %]
803                 <label for="B_phone">
804                 [% END %]
805                 Phone: </label>
806                 [% IF ( opduplicate ) %]
807                                         <input type="text" id="B_phone" name="B_phone" value="[% B_phone %]" onclick="this.value=''" />
808                 [% ELSE %]
809                                         <input type="text" id="B_phone" name="B_phone" value="[% B_phone %]" />
810                 [% END %]
811                 [% IF ( mandatoryB_phone ) %]<span class="required">Required</span>[% END %]
812             </li>
813         [% END %]
814         [% UNLESS noB_email %]
815                         <li> 
816         [% IF ( mandatoryB_email ) %]
817           <label for="B_email" class="required">
818         [% ELSE %]
819           <label for="B_email">
820         [% END %]
821         Email: </label>
822         [% IF ( opduplicate ) %]
823                         <input type="text" id="B_email" name="B_email" size="45" value="[% B_email %]" onclick="this.value=''" />
824         [% ELSE %]
825                         <input type="text" id="B_email" name="B_email" size="45" value="[% B_email %]" />
826                 [% END %]
827                 [% IF ( mandatoryB_email ) %]<span class="required">Required</span>[% END %] </li>
828         [% END %]
829         [% UNLESS nocontactnote %]
830             <li>
831                 [% IF ( mandatorycontactnote ) %]
832                 <label for="contactnote" class="required">
833                 [% ELSE %]
834                 <label for="contactnote">
835                 [% END %]
836                 Contact note: </label>
837                 <textarea id="contactnote" name="contactnote" cols="40" rows="2">[% contactnote %]</textarea>
838         [% IF ( mandatorycontactnote ) %]<span class="required">Required</span>[% END %]
839             </li>
840         [% END %]
841                         </ol>
842                 </fieldset>
843     [% END # UNLESS noB_address && noB_city && noB_state && noB_phone && noB_email %]
844 [% END %]
845 [% IF ( step_2 ) %]
846     [% UNLESS noaltcontactsurname && noaltcontactfirstname && noaltcontactaddress1 && noaltcontactaddress2 && noaltcontactaddress3 && noaltcontactstate && noaltcontactzipcode && noaltcontactcountry && noaltcontactphone %]
847                 <fieldset class="rows" id="memberentry_altaddress">       
848             <legend id="alt_contact_lgd">Alternate contact</legend><ol>
849         [% UNLESS noaltcontactsurname %]
850                         <li>
851                             [% IF ( mandatoryaltcontactsurname ) %]
852                                 <label for="altcontactsurname" class="required">
853                                 [% ELSE %]
854                                 <label for="altcontactsurname">
855                                 [% END %]
856                                 Surname:</label>
857                                 [% IF ( opduplicate ) %]
858                                         <input type="text" name="altcontactsurname" id="altcontactsurname" value="[% altcontactsurname %]" onclick="this.value=''" />
859                                 [% ELSE %]
860                                         <input type="text" name="altcontactsurname" id="altcontactsurname" value="[% altcontactsurname %]" />
861                                 [% END %]
862                                 [% IF ( mandatoryaltcontactsurname ) %]<span class="required">Required</span>[% END %]
863                         </li>
864         [% END %]
865         [% UNLESS noaltcontactfirstname %]
866                         <li>
867                             [% IF ( mandatoryaltcontactfirstname ) %]
868                                 <label for="altcontactfirstname" class="required">
869                                 [% ELSE %]
870                                 <label for="altcontactfirstname">
871                                 [% END %]
872                                 First name:</label>
873                                 [% IF ( opduplicate ) %]
874                                         <input type="text" name="altcontactfirstname" id="altcontactfirstname" value="[% altcontactfirstname %]" onclick="this.value=''" />
875                                 [% ELSE %]
876                                         <input type="text" name="altcontactfirstname" id="altcontactfirstname" value="[% altcontactfirstname %]" />
877                                 [% END %]
878                                 [% IF ( mandatoryaltcontactfirstname ) %]<span class="required">Required</span>[% END %]
879                         </li>
880         [% END %]
881         [% UNLESS noaltcontactaddress1 %]
882                         <li>
883                             [% IF ( mandatoryaltcontactaddress1 ) %]
884                                 <label for="altcontactaddress1" class="required">
885                                 [% ELSE %]
886                                 <label for="altcontactaddress1">
887                                 [% END %]
888                                 Address:</label>
889                                 [% IF ( opduplicate ) %]
890                                         <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% altcontactaddress1 %]" onclick="this.value=''" size="40" />
891                                 [% ELSE %]
892                                         <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% altcontactaddress1 %]" size="40" />
893                                 [% END %]
894                                 [% IF ( mandatoryaltcontactaddress1 ) %]<span class="required">Required</span>[% END %]
895                         </li>
896         [% END %]
897         [% UNLESS noaltcontactaddress2 %]
898                         <li>
899                             [% IF ( mandatoryaltcontactaddress2 ) %]
900                                 <label for="altcontactaddress2" class="required">
901                                 [% ELSE %]
902                                 <label for="altcontactaddress2">
903                                 [% END %]
904                                 Address 2:</label>
905                                 [% IF ( opduplicate ) %]
906                                         <input type="text" name="altcontactaddress2" id="altcontactaddress2" value="[% altcontactaddress2 %]" onclick="this.value=''" size="40" />
907                                 [% ELSE %]
908                                         <input type="text" name="altcontactaddress2" id="altcontactaddress2" value="[% altcontactaddress2 %]" size="40" />
909                                 [% END %]
910                                 [% IF ( mandatoryaltcontactaddress2 ) %]<span class="required">Required</span>[% END %]
911                         </li>
912         [% END %]
913         [% UNLESS noaltcontactaddress3 %]
914                         <li>
915                             [% IF ( mandatoryaltcontactaddress3 ) %]
916                                 <label for="altcontactaddress3" class="required">
917                                 [% ELSE %]
918                                 <label for="altcontactaddress3">
919                                 [% END %]
920                                 City:</label>
921                                 <input type="text" name="altcontactaddress3" id="altcontactaddress3" value="[% altcontactaddress3 %]" size="20" />
922                                 [% IF ( mandatoryaltcontactaddress3 ) %]<span class="required">Required</span>[% END %]
923                         </li>
924         [% END %]
925         [% UNLESS noaltcontactstate %]
926                         <li>
927                             [% IF ( mandatoryaltcontactstate ) %]
928                                 <label for="altcontactstate" class="required">
929                                 [% ELSE %]
930                                 <label for="altcontactstate">
931                                 [% END %]
932                                 State:</label>
933                                 <input type="text" name="altcontactstate" id="altcontactstate" value="[% altcontactstate %]" size="20" />
934                                 [% IF ( mandatoryaltcontactstate ) %]<span class="required">Required</span>[% END %]
935                         </li>
936         [% END %]
937         [% UNLESS noaltcontactzipcode %]
938                         <li>
939                             [% IF ( mandatoryaltcontactzipcode ) %]
940                                 <label for="altcontactzipcode" class="required">
941                                 [% ELSE %]
942                                 <label for="altcontactzipcode">
943                                 [% END %]
944                                 Zip/Postal code:</label>
945                                 [% IF ( opduplicate ) %]
946                                         <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% altcontactzipcode %]" onclick="this.value=''" size="5" />
947                                 [% ELSE %]
948                                         <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% altcontactzipcode %]" size="5" />
949                                 [% END %]
950                                 [% IF ( mandatoryaltcontactzipcode ) %]<span class="required">Required</span>[% END %]
951                         </li>
952         [% END %]
953         [% UNLESS noaltcontactcountry %]
954                         <li>
955                             [% IF ( mandatoryaltcontactcountry ) %]
956                                 <label for="altcontactcountry" class="required">
957                                 [% ELSE %]
958                                 <label for="altcontactcountry">
959                                 [% END %]
960                                 Country:</label>
961                                 [% IF ( opduplicate ) %]
962                                         <input type="text" name="altcontactcountry" id="altcontactcountry" value="[% altcontactcountry %]" onclick="this.value=''" size="20" />
963                                 [% ELSE %]
964                                         <input type="text" name="altcontactcountry" id="altcontactcountry" value="[% altcontactcountry %]" size="20" />
965                                 [% END %]
966                                 [% IF ( mandatoryaltcontactcountry ) %]<span class="required">Required</span>[% END %]
967                         </li>                   
968         [% END %]
969         [% UNLESS noaltcontactphone %]
970                         <li>
971                             [% IF ( mandatoryaltcontactphone ) %]
972                                 <label for="altcontactphone" class="required">
973                                 [% ELSE %]
974                                 <label for="altcontactphone">
975                                 [% END %]
976                                 Phone:</label>
977                                 [% IF ( opduplicate ) %]
978                                         <input type="text" name="altcontactphone" id="altcontactphone" value="[% altcontactphone %]" onclick="this.value=''" />
979                                 [% ELSE %]
980                                         <input type="text" name="altcontactphone" id="altcontactphone" value="[% altcontactphone %]" />
981                                 [% END %]
982                                 [% IF ( mandatoryaltcontactphone ) %]<span class="required">Required</span>[% END %]
983                         </li>
984         [% END %]
985             </ol>
986         </fieldset>
987     [% END # UNLESS noaltcontactsurname && noaltcontactfirstname etc %]
988
989 [% END %]
990 [% IF ( step_3 ) %]
991
992   <fieldset class="rows" id="memberentry_library_management">
993     <legend id="library_management_lgd">Library management</legend><ol>
994         [% UNLESS nocardnumber %]
995    <li> [% IF ( mandatorycardnumber ) %]
996       <label for="cardnumber" class="required">
997     [% ELSE %]
998       <label for="cardnumber">
999     [% END %] 
1000     Card number: </label>
1001     [% IF ( opduplicate ) %]
1002                 <input type="text" id="cardnumber" name="cardnumber" size="20" />
1003     [% ELSE %]
1004                 <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" />
1005     [% END %]
1006           [% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]</li>
1007         [% END %]
1008         [% UNLESS nobranchcode %]
1009     <li>
1010       [% IF ( mandatorybranchcode ) %]
1011         <label for="branchcode" class="required">
1012       [% ELSE %]
1013         <label for="branchcode">
1014       [% END %]
1015       Library: </label>
1016       [% CGIbranch %]
1017           [% IF ( mandatorybranchcode ) %]<span class="required">Required</span>[% END %]
1018     </li>
1019         [% END %]
1020     <li>
1021         <label for="categorycode">Category: </label>
1022         <select id="categorycode" name="categorycode" onchange="update_category_code(this);">
1023         [% FOREACH typeloo IN typeloop %]
1024             [% FOREACH categoryloo IN typeloo.categoryloop %]
1025                 [% IF ( loop.first ) %]
1026                     [% IF ( typeloo.typename_C ) %]<optgroup label="Child"        value="C">[% END %]
1027                     [% IF ( typeloo.typename_A ) %]<optgroup label="Adult"        value="A">[% END %]
1028                     [% IF ( typeloo.typename_S ) %]<optgroup label="Staff"        value="S">[% END %]
1029                     [% IF ( typeloo.typename_I ) %]<optgroup label="Organization" value="I">[% END %]
1030                     [% IF ( typeloo.typename_P ) %]<optgroup label="Professional" value="P">[% END %]
1031                     [% IF ( typeloo.typename_X ) %]<optgroup label="Statistical"  value="X">[% END %]
1032                 [% END %]
1033                 [% IF ( categoryloo.categorycodeselected ) %]
1034                     <option value="[% categoryloo.categorycode %]" selected="selected" data-typename="[% typeloo.typename %]">[% categoryloo.categoryname %]</option>
1035                 [% ELSE %]
1036                     <option value="[% categoryloo.categorycode %]" data-typename="[% typeloo.typename %]">[% categoryloo.categoryname %]</option>
1037                 [% END %]
1038                 [% IF ( loop.last ) %]
1039                     </optgroup>
1040                 [% END %]
1041             [% END %]
1042        [% END %]
1043        </select>
1044     </li>
1045         [% UNLESS nosort1 %]
1046     <li>
1047       [% IF ( mandatorysort1 ) %]
1048         <label for="sort1" class="required">
1049       [% ELSE %]
1050         <label for="sort1">
1051       [% END %]
1052       Sort 1: </label>
1053       [% IF ( CGIsort1 ) %] 
1054         [% CGIsort1 %]
1055       [% ELSE %]
1056         <input  type="text" id="sort1" name="sort1" size="20"  value="[% sort1 %]" />
1057           [% IF ( mandatorysort1 ) %]<span class="required">Required</span>[% END %]
1058       [% END %]   
1059     </li>
1060         [% END %]
1061         [% UNLESS nosort2 %]
1062     <li>
1063     [% IF ( mandatorysort2 ) %]
1064     <label for="sort2" class="required">
1065     [% ELSE %]
1066     <label for="sort2">
1067     [% END %]
1068     Sort 2: </label>
1069     [% IF ( CGIsort2 ) %] 
1070       [% CGIsort2 %]
1071     [% ELSE %]
1072       [% IF ( opduplicate ) %]
1073                 <input  type="text" id="sort2" name="sort2" size="20"  value="[% sort2 %]" onclick="this.value=''" />
1074       [% ELSE %]
1075                 <input  type="text" id="sort2" name="sort2" size="20"  value="[% sort2 %]" />
1076       [% END %]
1077           [% IF ( mandatorysort2 ) %]<span class="required">Required</span>[% END %]
1078     [% END %] 
1079     </li>
1080         [% END %]
1081         </ol>
1082   </fieldset>
1083     [% UNLESS nodateenrolled && nodateexpiry &&  noopacnote && noborrowernotes %]
1084         <fieldset class="rows" id="memberentry_subscription">
1085         <legend id="library_setup_lgd">Library set-up</legend><ol>
1086         [% UNLESS nodateenrolled %]
1087                 <li>
1088                         [% IF ( mandatorydateenrolled ) %]
1089             <label for="from" class="required">
1090                         [% ELSE %]
1091             <label for="from">
1092                         [% END %]
1093                         Registration date: </label>
1094                         [% IF ( metric ) %]
1095                 <input type="text" id="from" name="dateenrolled"  maxlength="10" size="10" onchange="CheckDate(document.form.dateenrolled);check_manip_date('verify');" value="[% dateenrolled %]" class="datepickerfrom" />
1096                         [% ELSE %]
1097                 <input type="text" id="from" name="dateenrolled"  maxlength="10" size="10" value="[% dateenrolled %]" class="datepickerfrom" />
1098                         [% END %]
1099                 [% IF ( mandatorydateenrolled ) %]<span class="required">Required</span>[% END %]
1100                 [% IF ( ERROR_dateenrolled ) %]<span class="required">(Error)</span>[% END %]
1101                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
1102                 </li>
1103         [% END %]
1104         [% UNLESS nodateexpiry %]
1105                 <li>
1106                         [% IF ( mandatorydateexpiry ) %]
1107             <label for="to" class="required">
1108                         [% ELSE %]
1109             <label for="to">
1110                         [% END %]
1111                         Expiry date (leave blank for auto calc) </label>
1112                         [% IF ( metric ) %]
1113                                 [% UNLESS ( opadd ) %]
1114                     <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');" value="[% dateexpiry %]" class="datepickerto" />
1115                                 [% ELSE %]
1116                     <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');" class="datepickerto" />
1117                                 [% END %]
1118                         [% ELSE %]
1119                                 [% UNLESS ( opadd ) %]
1120                 <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" value="[% dateexpiry %]" class="datepickerto" />
1121                                 [% ELSE %]
1122                 <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" class="datepickerto" />
1123                                 [% END %]
1124                         [% END %]
1125                 [% IF ( mandatorydateexpiry ) %]<span class="required">Required</span>[% END %]
1126                 [% IF ( ERROR_dateexpiry ) %]<span class="required">(Error)</span>[% END %]
1127                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
1128                 </li>
1129         [% END %]
1130         [% UNLESS noopacnote %]
1131                 <li>
1132                         [% IF ( mandatoryopacnote ) %]
1133                                 <label for="opacnote" class="required">
1134                         [% ELSE %]
1135                                 <label for="opacnote">
1136                         [% END %]       
1137                         OPAC note: </label>
1138                         <textarea id="opacnote" name="opacnote" cols="55" rows="5">[% opacnote %]</textarea>
1139                         <div class="hint">This message appears on this patron's user page in the OPAC</div>
1140           [% IF ( mandatoryopacnote ) %]<span class="required">Required</span>[% END %]
1141                 </li>
1142         [% END %]
1143         [% UNLESS noborrowernotes %]
1144                 <li>
1145                         [% IF ( mandatoryborrowernotes ) %]     
1146                                 <label for="borrowernotes" class="required">
1147                         [% ELSE %]
1148                                 <label for="borrowernotes">
1149                         [% END %]
1150                         Circulation note: </label>
1151                         <textarea id="borrowernotes" name="borrowernotes" cols="55" rows="5">[% borrowernotes %]</textarea>
1152                         <div class="hint">This message displays when checking out to this patron</div>
1153           [% IF ( mandatoryborrowernotes ) %]<span class="required">Required</span>[% END %]
1154                 </li>
1155         [% END %]
1156                 </ol>
1157         </fieldset>
1158     [% END # hide fieldset %]
1159
1160     [% UNLESS nouserid && nopassword %]
1161         <fieldset class="rows" id="memberentry_userid">
1162         <legend id="opac_staff_login_lgd">OPAC/Staff login</legend><ol>
1163         [% UNLESS nouserid %]
1164                 <li>
1165                         [% IF ( mandatoryuserid ) %]
1166                         <label for="userid" class="required">
1167                         [% ELSE %]
1168                         <label for="userid">
1169                         [% END %]
1170                         Username: </label>
1171
1172 [% IF ( NoUpdateLogin ) %]
1173         [% IF ( opduplicate ) %]
1174                 <input type="text" id="userid" name="userid" size="20" disabled="disabled" />
1175         [% ELSE %]
1176                 <input type="text" id="userid" name="userid" size="20" disabled="disabled" value="[% userid %]" />
1177         [% END %]
1178 [% ELSE %]
1179         [% IF ( opduplicate ) %]
1180                 <input type="text" id="userid" name="userid" size="20" value="" />
1181         [% ELSE %]
1182                 <input type="text" id="userid" name="userid" size="20" value="[% userid %]" />
1183         [% END %]
1184 [% END %]
1185
1186           [% IF ( mandatoryuserid ) %]<span class="required">Required</span>[% END %]
1187                 </li>
1188         [%END %]
1189         [% UNLESS nopassword %]
1190                 <li>
1191                         [% IF ( mandatorypassword ) %]
1192                         <label for="password" class="required">
1193                         [% ELSE %]
1194                         <label for="password">
1195                         [% END %]
1196                         Password: </label>
1197                         [% IF ( opadd ) %]
1198                         [% IF ( NoUpdateLogin ) %]
1199                                 [% IF ( opduplicate ) %]
1200                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" />
1201                                 [% ELSE %]
1202                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" value="[% password %]" />
1203                                 [% END %]
1204 [% ELSE %]
1205                                 [% IF ( opduplicate ) %]
1206                                         <input type="password" id="password" name="password" size="20" />
1207                                 [% ELSE %]
1208                                         <input type="password" id="password" name="password" size="20" value="[% password %]" />
1209                                 [% END %]
1210 [% END %]
1211                         [% ELSE %]
1212                         [% IF ( password ) %]
1213                                 [% IF ( NoUpdateLogin ) %]
1214                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" value="****" />
1215                                 [% ELSE %]
1216                                         [% IF ( opduplicate ) %]
1217                                                 <input type="password" id="password" name="password" size="20" />
1218                                         [% ELSE %]
1219                                                 <input type="password" id="password" name="password" size="20" value="****" />
1220                                         [% END %]
1221                                 [% END %]
1222                         [% ELSE %]
1223                                 [% IF ( NoUpdateLogin ) %]
1224                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" value="" />
1225                                 [% ELSE %]
1226                                         <input type="password" id="password" name="password" size="20" value="" />
1227                                 [% END %]
1228                         [% END %]
1229                         [% END %]
1230           [% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %][% IF ( ERROR_short_password ) %]<span class="required">Password is too short</span>[% END %]
1231 [% IF ( minPasswordLength ) %]<div class="hint">Minimum password length: [% minPasswordLength %]</div>[% END %]
1232                 </li>
1233                 <li>
1234                         [% IF ( mandatorypassword ) %]
1235                         <label for="password2" class="required">
1236                         [% ELSE %]
1237                         <label for="password2">
1238                         [% END %]
1239                         Confirm password: </label>
1240                         [% IF ( opadd ) %]
1241                         [% IF ( NoUpdateLogin ) %]
1242                                 [% IF ( opduplicate ) %]
1243                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" />
1244                                 [% ELSE %]
1245                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" value="[% password %]" />
1246                                 [% END %]
1247 [% ELSE %]
1248                                 [% IF ( opduplicate ) %]
1249                                         <input type="password" id="password2" name="password2" size="20" />
1250                                 [% ELSE %]
1251                                         <input type="password" id="password2" name="password2" size="20" value="[% password %]" />
1252                                 [% END %]
1253 [% END %]
1254                         [% ELSE %]
1255                         [% IF ( password ) %]
1256                                 [% IF ( NoUpdateLogin ) %]
1257                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" value="****" />
1258                                 [% ELSE %]
1259                                         [% IF ( opduplicate ) %]
1260                                                 <input type="password" id="password2" name="password2" size="20" />
1261                                         [% ELSE %]
1262                                                 <input type="password" id="password2" name="password2" size="20" value="****" />
1263                                         [% END %]
1264                                 [% END %]
1265                         [% ELSE %]
1266                                 [% IF ( NoUpdateLogin ) %]
1267                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" value="" />
1268                                 [% ELSE %]
1269                                         <input type="password" id="password2" name="password2" size="20" value="" />
1270                                 [% END %]
1271                         [% END %]
1272                         [% END %]
1273           [% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %][% IF ( ERROR_password_mismatch ) %]<span class="required">Passwords do not match</span>[% END %]
1274                 </li>
1275                 </ol>
1276                 </fieldset>
1277         [% END # hide fieldset %][% END %]
1278                 <!--this zones are not necessary in modif mode -->
1279                 [% UNLESS ( opadd ) %]
1280                 <fieldset class="rows">
1281             <legend>Patron account flags</legend>
1282                         <ol class="radio">
1283                         [% FOREACH flagloo IN flagloop %]
1284                                 <li><label class="radio" for="yes[% flagloo.name %]">
1285                 [% IF ( flagloo.key == 'gonenoaddress' ) %]Gone no address:[% END %]
1286                                 [% IF ( flagloo.key == 'debarred' ) %]Restricted:[% END %]
1287                 [% IF ( flagloo.key == 'lost' ) %]Lost card:[% END %]
1288                 </label>
1289                                 <label for="yes[% flagloo.name %]">Yes </label>
1290                                 [% IF ( flagloo.yes ) %]
1291                                 <input type="radio" id="yes[% flagloo.name %]" name="[% flagloo.name %]" value="1" checked="checked" />
1292                                 [% ELSE %]
1293                                 <input type="radio" id="yes[% flagloo.name %]" name="[% flagloo.name %]" value="1" />
1294                                 [% END %]
1295                                 <label for="no[% flagloo.name %]">No </label>
1296                                 [% IF ( flagloo.no ) %]
1297                                 <input type="radio" id="no[% flagloo.name %]" name="[% flagloo.name %]" value="0" checked="checked"/>
1298                                 [% ELSE %]
1299                                 <input type="radio" id="no[% flagloo.name %]" name="[% flagloo.name %]" value="0" />
1300                                 [% END %]
1301
1302             </li>
1303                         [% END %]
1304                         <li>
1305                                 <label for="yesdebarred" class="radio">Restricted: </label>
1306                                 [% IF ( debarred ) %]
1307                                 <label for="yesdebarred">Yes </label>
1308                                 <input type="radio" id="yesdebarred" name="debarred" value="1" checked="checked"/>
1309                 <label for="nodebarred">No </label>
1310                 <input type="radio" id="nodebarred" name="debarred" value="0"/>
1311                                 [% ELSE %]
1312                                 <label for="yesdebarred">Yes </label>
1313                                 <input type="radio" id="yesdebarred" name="debarred" value="1" />
1314                 <label for="nodebarred">No </label>
1315                 <input type="radio" id="nodebarred" name="debarred" value="0" checked="checked"/>
1316                                 [% END %]
1317
1318                 <span id="debarreduntil"><label for="datedebarred" class="inline">Until:</label>
1319                                 [% IF opduplicate %]
1320                                     <input type="text" name="datedebarred" id="datedebarred" class="debarred datepicker" value="[% datedebarred %]" onclick="this.value=''" />
1321                                 [% ELSE %]
1322                                     <input type="text" name="datedebarred" id="datedebarred" class="debarred datepicker" value="[% datedebarred %]" />
1323                                 [% END %]
1324                 <span class="hint">(optional)</span> </span>
1325                 </li>
1326                 <li>
1327                         <label for="debarredcomment" class="radio">Comment:</label>
1328                                [% IF ( opduplicate ) %] 
1329                                    <textarea id="debarredcomment" name="debarredcomment" cols="55" rows="3" onclick="this.value=''">[% debarredcomment %]</textarea>
1330                                [% ELSE %]
1331                                    <textarea id="debarredcomment" name="debarredcomment" cols="55" rows="3">[% debarredcomment %]</textarea>
1332                                [% END %]
1333                 </li>
1334
1335                         </ol>
1336                         </fieldset>
1337     
1338                 [% END %]
1339
1340 [% END %]
1341
1342 [% IF ( step_4 ) %][% IF ( ExtendedPatronAttributes ) %][% UNLESS ( no_patron_attribute_types ) %]
1343   <fieldset class="rows" id="memberentry_patron_attributes">
1344     <input type="hidden" name="setting_extended_patron_attributes" value="1" />
1345     <legend>Additional attributes and identifiers</legend>
1346     [% FOREACH pa_loo IN patron_attributes %]
1347         [% IF pa_loo.class %]
1348             <table id="aai_[% pa_loo.class %]" class="attributes_table">
1349             <caption>[% pa_loo.lib %]</caption>
1350         [% ELSE %]
1351             <table id="aai" class="attributes_table">
1352         [% END %]
1353         <thead>
1354             <tr>
1355                 <th>Type</th>
1356                 <th colspan="2">Value</th>
1357             </tr>
1358         </thead>
1359         <tbody>
1360             [% FOREACH patron_attribute IN pa_loo.items %]
1361                 <tr data-category_code="[% patron_attribute.category_code %]">
1362                     <td>
1363                         [% patron_attribute.code %] ([% patron_attribute.description %])
1364                     </td>
1365                     <td>
1366                         <input type="hidden" id="[% patron_attribute.form_id %]_code" name="[% patron_attribute.form_id %]_code" value="[% patron_attribute.code |html %]" />
1367                         [% IF ( patron_attribute.use_dropdown ) %]
1368                             <select id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]">
1369                                 <option value="" />
1370                                 [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
1371                                     [% IF ( auth_val_loo.selected ) %]
1372                                         <option value="[% auth_val_loo.authorised_value %]" selected="selected">
1373                                             [% auth_val_loo.lib %]
1374                                         </option>
1375                                     [% ELSE %]
1376                                         <option value="[% auth_val_loo.authorised_value %]" >
1377                                             [% auth_val_loo.lib %]
1378                                         </option>
1379                                     [% END %]
1380                                 [% END %]
1381                             </select>
1382                         [% ELSE %]
1383                             [% IF ( opduplicate ) %]
1384                             <input type="text" maxlength="64" value="[% patron_attribute.value %]"
1385                                    id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]" onclick="this.value=''" />
1386                             [% ELSE %]
1387                             <input type="text" maxlength="64" value="[% patron_attribute.value %]"
1388                                    id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]" />
1389                             [% END %]
1390                         [% END %]
1391                         [% IF ( patron_attribute.password_allowed ) %]
1392                             (Password: <input type="password" maxlength="64" value="[% patron_attribute.password %]"
1393                                    id="[% patron_attribute.form_id %]_password" name="[% patron_attribute.form_id %]_password" />)
1394                         [% END %]
1395                     </td>
1396                     <td>
1397                         <a href="#" onclick="clear_entry(this); return false;">Clear</a>
1398                         [% IF ( patron_attribute.repeatable ) %]
1399                         <a href="#" onclick="clone_entry(this); return false;">New</a>
1400                         [% END %]
1401                     </td>
1402                 </tr>
1403             [% END %]
1404         </tbody>
1405         </table>
1406     [% END %]
1407   </fieldset>
1408 [% END %][% END %][% END %]
1409
1410 [% IF ( step_5 ) %][% IF ( EnhancedMessagingPreferences ) %]
1411   <fieldset class="rows" id="memberentry_messaging_prefs">
1412     [% IF ( opadd ) %]
1413     <!-- handle changing prefs if creating new patron and changing
1414          the patron category
1415     -->
1416     <script language="javascript" type="text/javascript">//<![CDATA[
1417        $(document).ready(function(){
1418             var message_prefs_dirty = false;
1419             $('#memberentry_messaging_prefs > *').change(function() {
1420                 message_prefs_dirty = true;
1421             });
1422             $('#categorycode').change(function() {
1423                 var categorycode = $(this).val();
1424                 if (message_prefs_dirty) {
1425                     if (!confirm('Change messaging preferences to default for this category?')) {
1426                         return;
1427                     }
1428                 }
1429                 $.getJSON('/cgi-bin/koha/members/default_messageprefs.pl?categorycode=' + categorycode,
1430                     function(data) {
1431                         $.each(data.messaging_preferences, function(i, item) {
1432                             var attrid = item.message_attribute_id;
1433                             var transports = ['email', 'rss', 'sms'];
1434                             $.each(transports, function(j, transport) {
1435                                 if (item['transport-' + transport] != ' ') {
1436                                     $('#' + transport + attrid).attr('checked', item['transport-' + transport]);
1437                                 } else {
1438                                     $('#' + transport + attrid).removeAttr('checked');
1439                                 }
1440                             });
1441                             if (item.digest && item.digest != ' ') {
1442                                 $('#digest' + attrid).attr('checked', item.digest);
1443                             } else {
1444                                 $('#digest' + attrid).removeAttr('checked');
1445                             }
1446                             if (item.takes_days == '1') {
1447                                 $('[name=' + attrid + '-DAYS]').val('' + item.days_in_advance);
1448                             }
1449                         });
1450                         message_prefs_dirty = false;
1451                     }
1452                 );
1453             });
1454         });
1455     //]]>
1456     </script>
1457     [% END %]
1458     <input type="hidden" name="setting_messaging_prefs" value="1" />
1459     <legend id="patron_messaging_prefs_lgd">Patron messaging preferences</legend>
1460     [% IF type_only %]
1461         <p>If no preferences are selected, the default preferences for the category chosen will be applied on save, otherwise your selection here is saved</p>
1462     [% END %]
1463     [% INCLUDE 'messaging-preference-form.inc' %]
1464     [% IF ( SMSSendDriver ) %]
1465         <p><label for="SMSnumber">SMS number:</label>
1466           [% IF ( opduplicate ) %]
1467             <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]" onclick="this.value=''" />
1468           [% ELSE %]
1469             <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]" />
1470         [% END %]
1471         </p>
1472     [% END %]
1473   </fieldset>
1474 [% END %] [% END %]
1475
1476     <fieldset class="action">
1477         <input type="submit" name="save" onclick="return check_form_borrowers();" value="Save" />
1478       [% IF ( opadd ) %]
1479        <a class="cancel" href="/cgi-bin/koha/members/member.pl">Cancel</a>
1480            [% ELSE %]
1481           <a class="cancel" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Cancel</a>
1482            [% END %]
1483     </fieldset>
1484 </form>
1485   
1486 </div>
1487 </div>
1488
1489 [% UNLESS ( opadd ) %]<div class="yui-b">
1490 [% INCLUDE 'members-menu.inc' %]
1491 </div>[% END %]
1492 [% END %]
1493 </div>
1494 [% INCLUDE 'intranet-bottom.inc' %]
1495