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