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