Merge branch 'bug_9647' 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 ( 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       [% CGIbranch %]
998           [% IF ( mandatorybranchcode ) %]<span class="required">Required</span>[% END %]
999     </li>
1000         [% END %]
1001     <li>
1002         <label for="categorycode">Category: </label>
1003         <select id="categorycode" name="categorycode" onchange="update_category_code(this);">
1004         [% FOREACH typeloo IN typeloop %]
1005             [% FOREACH categoryloo IN typeloo.categoryloop %]
1006                 [% IF ( loop.first ) %]
1007                     [% IF ( typeloo.typename_C ) %]<optgroup label="Child"        value="C">[% END %]
1008                     [% IF ( typeloo.typename_A ) %]<optgroup label="Adult"        value="A">[% END %]
1009                     [% IF ( typeloo.typename_S ) %]<optgroup label="Staff"        value="S">[% END %]
1010                     [% IF ( typeloo.typename_I ) %]<optgroup label="Organization" value="I">[% END %]
1011                     [% IF ( typeloo.typename_P ) %]<optgroup label="Professional" value="P">[% END %]
1012                     [% IF ( typeloo.typename_X ) %]<optgroup label="Statistical"  value="X">[% END %]
1013                 [% END %]
1014                 [% IF ( categoryloo.categorycodeselected ) %]
1015                     <option value="[% categoryloo.categorycode %]" selected="selected" data-typename="[% typeloo.typename %]">[% categoryloo.categoryname %]</option>
1016                 [% ELSE %]
1017                     <option value="[% categoryloo.categorycode %]" data-typename="[% typeloo.typename %]">[% categoryloo.categoryname %]</option>
1018                 [% END %]
1019                 [% IF ( loop.last ) %]
1020                     </optgroup>
1021                 [% END %]
1022             [% END %]
1023        [% END %]
1024        </select>
1025     </li>
1026         [% UNLESS nosort1 %]
1027     <li>
1028       [% IF ( mandatorysort1 ) %]
1029         <label for="sort1" class="required">
1030       [% ELSE %]
1031         <label for="sort1">
1032       [% END %]
1033       Sort 1: </label>
1034       [% IF ( CGIsort1 ) %] 
1035         [% CGIsort1 %]
1036       [% ELSE %]
1037         <input  type="text" id="sort1" name="sort1" size="20"  value="[% sort1 %]" />
1038           [% IF ( mandatorysort1 ) %]<span class="required">Required</span>[% END %]
1039       [% END %]   
1040     </li>
1041         [% END %]
1042         [% UNLESS nosort2 %]
1043     <li>
1044     [% IF ( mandatorysort2 ) %]
1045     <label for="sort2" class="required">
1046     [% ELSE %]
1047     <label for="sort2">
1048     [% END %]
1049     Sort 2: </label>
1050     [% IF ( CGIsort2 ) %] 
1051       [% CGIsort2 %]
1052     [% ELSE %]
1053       [% IF ( opduplicate ) %]
1054                 <input  type="text" id="sort2" name="sort2" size="20"  value="[% sort2 %]" onclick="this.value=''" />
1055       [% ELSE %]
1056                 <input  type="text" id="sort2" name="sort2" size="20"  value="[% sort2 %]" />
1057       [% END %]
1058           [% IF ( mandatorysort2 ) %]<span class="required">Required</span>[% END %]
1059     [% END %] 
1060     </li>
1061         [% END %]
1062         </ol>
1063   </fieldset>
1064     [% UNLESS nodateenrolled &&  noopacnote && noborrowernotes %]
1065         <fieldset class="rows" id="memberentry_subscription">
1066         <legend id="library_setup_lgd">Library set-up</legend><ol>
1067         [% UNLESS nodateenrolled %]
1068                 <li>
1069                         [% IF ( mandatorydateenrolled ) %]
1070             <label for="from" class="required">
1071                         [% ELSE %]
1072             <label for="from">
1073                         [% END %]
1074                         Registration date: </label>
1075                         [% IF ( metric ) %]
1076                 <input type="text" id="from" name="dateenrolled"  maxlength="10" size="10" onchange="CheckDate(document.form.dateenrolled);check_manip_date('verify');" value="[% dateenrolled %]" class="datepickerfrom" />
1077                         [% ELSE %]
1078                 <input type="text" id="from" name="dateenrolled"  maxlength="10" size="10" value="[% dateenrolled %]" class="datepickerfrom" />
1079                         [% END %]
1080                 [% IF ( mandatorydateenrolled ) %]<span class="required">Required</span>[% END %]
1081                 [% IF ( ERROR_dateenrolled ) %]<span class="required">(Error)</span>[% END %]
1082                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
1083                 </li>
1084         [% END %]
1085         [% UNLESS nodateexpiry %]
1086                 <li>
1087         [% ELSE %]
1088                 <li style="display:none">
1089         [% END %]
1090                         [% IF ( mandatorydateexpiry ) %]
1091             <label for="to" class="required">
1092                         [% ELSE %]
1093             <label for="to">
1094                         [% END %]
1095                         Expiry date (leave blank for auto calc) </label>
1096                         [% IF ( metric ) %]
1097                                 [% UNLESS ( opadd ) %]
1098                     <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');" value="[% dateexpiry %]" class="datepickerto" />
1099                                 [% ELSE %]
1100                     <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');" class="datepickerto" />
1101                                 [% END %]
1102                         [% ELSE %]
1103                                 [% UNLESS ( opadd ) %]
1104                 <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" value="[% dateexpiry %]" class="datepickerto" />
1105                                 [% ELSE %]
1106                 <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" class="datepickerto" />
1107                                 [% END %]
1108                         [% END %]
1109                 [% IF ( mandatorydateexpiry ) %]<span class="required">Required</span>[% END %]
1110                 [% IF ( ERROR_dateexpiry ) %]<span class="required">(Error)</span>[% END %]
1111                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
1112                 </li>
1113         [% UNLESS noopacnote %]
1114                 <li>
1115                         [% IF ( mandatoryopacnote ) %]
1116                                 <label for="opacnote" class="required">
1117                         [% ELSE %]
1118                                 <label for="opacnote">
1119                         [% END %]       
1120                         OPAC note: </label>
1121                         <textarea id="opacnote" name="opacnote" cols="55" rows="5">[% opacnote %]</textarea>
1122                         <div class="hint">This message appears on this patron's user page in the OPAC</div>
1123           [% IF ( mandatoryopacnote ) %]<span class="required">Required</span>[% END %]
1124                 </li>
1125         [% END %]
1126         [% UNLESS noborrowernotes %]
1127                 <li>
1128                         [% IF ( mandatoryborrowernotes ) %]     
1129                                 <label for="borrowernotes" class="required">
1130                         [% ELSE %]
1131                                 <label for="borrowernotes">
1132                         [% END %]
1133                         Circulation note: </label>
1134                         <textarea id="borrowernotes" name="borrowernotes" cols="55" rows="5">[% borrowernotes %]</textarea>
1135                         <div class="hint">This message displays when checking out to this patron</div>
1136           [% IF ( mandatoryborrowernotes ) %]<span class="required">Required</span>[% END %]
1137                 </li>
1138         [% END %]
1139                 </ol>
1140         </fieldset>
1141     [% END # hide fieldset %]
1142
1143     [% UNLESS nouserid && nopassword %]
1144         <fieldset class="rows" id="memberentry_userid">
1145         <legend id="opac_staff_login_lgd">OPAC/Staff login</legend><ol>
1146         [% UNLESS nouserid %]
1147                 <li>
1148                         [% IF ( mandatoryuserid ) %]
1149                         <label for="userid" class="required">
1150                         [% ELSE %]
1151                         <label for="userid">
1152                         [% END %]
1153                         Username: </label>
1154
1155 [% IF ( NoUpdateLogin ) %]
1156         [% IF ( opduplicate ) %]
1157                 <input type="text" id="userid" name="userid" size="20" disabled="disabled" />
1158         [% ELSE %]
1159                 <input type="text" id="userid" name="userid" size="20" disabled="disabled" value="[% userid %]" />
1160         [% END %]
1161 [% ELSE %]
1162         [% IF ( opduplicate ) %]
1163                 <input type="text" id="userid" name="userid" size="20" value="" />
1164         [% ELSE %]
1165                 <input type="text" id="userid" name="userid" size="20" value="[% userid %]" />
1166         [% END %]
1167 [% END %]
1168
1169           [% IF ( mandatoryuserid ) %]<span class="required">Required</span>[% END %]
1170                 </li>
1171         [%END %]
1172         [% UNLESS nopassword %]
1173                 <li>
1174                         [% IF ( mandatorypassword ) %]
1175                         <label for="password" class="required">
1176                         [% ELSE %]
1177                         <label for="password">
1178                         [% END %]
1179                         Password: </label>
1180                         [% IF ( opadd ) %]
1181                         [% IF ( NoUpdateLogin ) %]
1182                                 [% IF ( opduplicate ) %]
1183                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" />
1184                                 [% ELSE %]
1185                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" value="[% password %]" />
1186                                 [% END %]
1187 [% ELSE %]
1188                                 [% IF ( opduplicate ) %]
1189                                         <input type="password" id="password" name="password" size="20" />
1190                                 [% ELSE %]
1191                                         <input type="password" id="password" name="password" size="20" value="[% password %]" />
1192                                 [% END %]
1193 [% END %]
1194                         [% ELSE %]
1195                         [% IF ( password ) %]
1196                                 [% IF ( NoUpdateLogin ) %]
1197                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" value="****" />
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="****" />
1203                                         [% END %]
1204                                 [% END %]
1205                         [% ELSE %]
1206                                 [% IF ( NoUpdateLogin ) %]
1207                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" value="" />
1208                                 [% ELSE %]
1209                                         <input type="password" id="password" name="password" size="20" value="" />
1210                                 [% END %]
1211                         [% END %]
1212                         [% END %]
1213           [% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %][% IF ( ERROR_short_password ) %]<span class="required">Password is too short</span>[% END %]
1214 [% IF ( minPasswordLength ) %]<div class="hint">Minimum password length: [% minPasswordLength %]</div>[% END %]
1215                 </li>
1216                 <li>
1217                         [% IF ( mandatorypassword ) %]
1218                         <label for="password2" class="required">
1219                         [% ELSE %]
1220                         <label for="password2">
1221                         [% END %]
1222                         Confirm password: </label>
1223                         [% IF ( opadd ) %]
1224                         [% IF ( NoUpdateLogin ) %]
1225                                 [% IF ( opduplicate ) %]
1226                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" />
1227                                 [% ELSE %]
1228                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" value="[% password %]" />
1229                                 [% END %]
1230 [% ELSE %]
1231                                 [% IF ( opduplicate ) %]
1232                                         <input type="password" id="password2" name="password2" size="20" />
1233                                 [% ELSE %]
1234                                         <input type="password" id="password2" name="password2" size="20" value="[% password %]" />
1235                                 [% END %]
1236 [% END %]
1237                         [% ELSE %]
1238                         [% IF ( password ) %]
1239                                 [% IF ( NoUpdateLogin ) %]
1240                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" value="****" />
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="****" />
1246                                         [% END %]
1247                                 [% END %]
1248                         [% ELSE %]
1249                                 [% IF ( NoUpdateLogin ) %]
1250                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" value="" />
1251                                 [% ELSE %]
1252                                         <input type="password" id="password2" name="password2" size="20" value="" />
1253                                 [% END %]
1254                         [% END %]
1255                         [% END %]
1256           [% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %][% IF ( ERROR_password_mismatch ) %]<span class="required">Passwords do not match</span>[% END %]
1257                 </li>
1258                 </ol>
1259                 </fieldset>
1260         [% END # hide fieldset %][% END %]
1261                 <!--this zones are not necessary in modif mode -->
1262                 [% UNLESS ( opadd ) %]
1263                 <fieldset class="rows">
1264             <legend>Patron account flags</legend>
1265                         <ol class="radio">
1266                         [% FOREACH flagloo IN flagloop %]
1267                                 <li><label class="radio" for="yes[% flagloo.name %]">
1268                 [% IF ( flagloo.key == 'gonenoaddress' ) %]Gone no address:[% END %]
1269                                 [% IF ( flagloo.key == 'debarred' ) %]Restricted:[% END %]
1270                 [% IF ( flagloo.key == 'lost' ) %]Lost card:[% END %]
1271                 </label>
1272                                 <label for="yes[% flagloo.name %]">Yes </label>
1273                                 [% IF ( flagloo.yes ) %]
1274                                 <input type="radio" id="yes[% flagloo.name %]" name="[% flagloo.name %]" value="1" checked="checked" />
1275                                 [% ELSE %]
1276                                 <input type="radio" id="yes[% flagloo.name %]" name="[% flagloo.name %]" value="1" />
1277                                 [% END %]
1278                                 <label for="no[% flagloo.name %]">No </label>
1279                                 [% IF ( flagloo.no ) %]
1280                                 <input type="radio" id="no[% flagloo.name %]" name="[% flagloo.name %]" value="0" checked="checked"/>
1281                                 [% ELSE %]
1282                                 <input type="radio" id="no[% flagloo.name %]" name="[% flagloo.name %]" value="0" />
1283                                 [% END %]
1284
1285             </li>
1286                         [% END %]
1287                         <li>
1288                                 <label for="yesdebarred" class="radio">Restricted: </label>
1289                                 [% IF ( debarred ) %]
1290                                 <label for="yesdebarred">Yes </label>
1291                                 <input type="radio" id="yesdebarred" name="debarred" value="1" checked="checked"/>
1292                 <label for="nodebarred">No </label>
1293                 <input type="radio" id="nodebarred" name="debarred" value="0"/>
1294                                 [% ELSE %]
1295                                 <label for="yesdebarred">Yes </label>
1296                                 <input type="radio" id="yesdebarred" name="debarred" value="1" />
1297                 <label for="nodebarred">No </label>
1298                 <input type="radio" id="nodebarred" name="debarred" value="0" checked="checked"/>
1299                                 [% END %]
1300
1301                 <span id="debarreduntil"><label for="datedebarred" class="inline">Until:</label>
1302                                 [% IF opduplicate %]
1303                                     <input type="text" name="datedebarred" id="datedebarred" class="debarred datepicker" value="[% datedebarred %]" onclick="this.value=''" />
1304                                 [% ELSE %]
1305                                     <input type="text" name="datedebarred" id="datedebarred" class="debarred datepicker" value="[% datedebarred %]" />
1306                                 [% END %]
1307                 <span class="hint">(optional)</span> </span>
1308                 </li>
1309                 <li>
1310                         <label for="debarredcomment" class="radio">Comment:</label>
1311                                [% IF ( opduplicate ) %] 
1312                                    <textarea id="debarredcomment" name="debarredcomment" cols="55" rows="3" onclick="this.value=''">[% debarredcomment %]</textarea>
1313                                [% ELSE %]
1314                                    <textarea id="debarredcomment" name="debarredcomment" cols="55" rows="3">[% debarredcomment %]</textarea>
1315                                [% END %]
1316                 </li>
1317
1318                         </ol>
1319                         </fieldset>
1320     
1321                 [% END %]
1322
1323 [% END %]
1324
1325 [% IF ( step_4 ) %][% IF ( ExtendedPatronAttributes ) %][% UNLESS ( no_patron_attribute_types ) %]
1326   <fieldset class="rows" id="memberentry_patron_attributes">
1327     <input type="hidden" name="setting_extended_patron_attributes" value="1" />
1328     <legend>Additional attributes and identifiers</legend>
1329     [% FOREACH pa_loo IN patron_attributes %]
1330         [% IF pa_loo.class %]
1331             <fieldset id="aai_[% pa_loo.class %]">
1332             <legend>[% pa_loo.lib %]</legend>
1333         [% END %]
1334         <ol class="attributes_table">
1335             [% FOREACH patron_attribute IN pa_loo.items %]
1336                 <li data-category_code="[% patron_attribute.category_code %]">
1337                     <label for="[% patron_attribute.form_id %]">[% patron_attribute.description %]: </label>
1338                         <input type="hidden" id="[% patron_attribute.form_id %]_code" name="[% patron_attribute.form_id %]_code" value="[% patron_attribute.code |html %]" />
1339                         [% IF ( patron_attribute.use_dropdown ) %]
1340                             <select id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]">
1341                                 <option value="" />
1342                                 [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
1343                                     [% IF ( auth_val_loo.selected ) %]
1344                                         <option value="[% auth_val_loo.authorised_value %]" selected="selected">
1345                                             [% auth_val_loo.lib %]
1346                                         </option>
1347                                     [% ELSE %]
1348                                         <option value="[% auth_val_loo.authorised_value %]" >
1349                                             [% auth_val_loo.lib %]
1350                                         </option>
1351                                     [% END %]
1352                                 [% END %]
1353                             </select>
1354                         [% ELSE %]
1355                             [% IF ( opduplicate ) %]
1356                             <textarea rows="2" cols="30" id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]" onclick="this.value=''" >[% patron_attribute.value %]</textarea>
1357                             [% ELSE %]
1358                             <textarea rows="2" cols="30" id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]">[% patron_attribute.value %]</textarea>
1359                             [% END %]
1360                         [% END %]
1361                         [% IF ( patron_attribute.password_allowed ) %]
1362                             (<label class="yesno" for="[% patron_attribute.form_id %]_password">Password:</label> <input type="password" maxlength="64" value="[% patron_attribute.password %]"
1363                                    id="[% patron_attribute.form_id %]_password" name="[% patron_attribute.form_id %]_password" />)
1364                         [% END %]
1365                         <a href="#" class="clear-field" onclick="clear_entry(this); return false;">Clear</a>
1366                         [% IF ( patron_attribute.repeatable ) %]
1367                         <a href="#" class="clone-field" onclick="clone_entry(this); return false;">New</a>
1368                         [% END %]
1369                 </li>
1370             [% END %]
1371         </ol>
1372         [% IF pa_loo.class %]</fieldset>[% END %]
1373     [% END %]
1374   </fieldset>
1375 [% END %][% END %][% END %]
1376
1377 [% IF ( step_5 ) %][% IF ( EnhancedMessagingPreferences ) %]
1378   <fieldset class="rows" id="memberentry_messaging_prefs">
1379     [% IF ( opadd ) %]
1380     <!-- handle changing prefs if creating new patron and changing
1381          the patron category
1382     -->
1383     <script type="text/javascript">//<![CDATA[
1384        $(document).ready(function(){
1385             var message_prefs_dirty = false;
1386             $('#memberentry_messaging_prefs > *').change(function() {
1387                 message_prefs_dirty = true;
1388             });
1389             $('#categorycode').change(function() {
1390                 var categorycode = $(this).val();
1391                 if (message_prefs_dirty) {
1392                     if (!confirm('Change messaging preferences to default for this category?')) {
1393                         return;
1394                     }
1395                 }
1396                 $.getJSON('/cgi-bin/koha/members/default_messageprefs.pl?categorycode=' + categorycode,
1397                     function(data) {
1398                         $.each(data.messaging_preferences, function(i, item) {
1399                             var attrid = item.message_attribute_id;
1400                             var transports = ['email', 'rss', 'sms'];
1401                             $.each(transports, function(j, transport) {
1402                                 if (item['transports_' + transport] == 1) {
1403                                     $('#' + transport + attrid).attr('checked', 'checked');
1404                                 } else {
1405                                     $('#' + transport + attrid).removeAttr('checked');
1406                                 }
1407                             });
1408                             if (item.digest && item.digest != ' ') {
1409                                 $('#digest' + attrid).attr('checked', item.digest);
1410                             } else {
1411                                 $('#digest' + attrid).removeAttr('checked');
1412                             }
1413                             if (item.takes_days == '1') {
1414                                 $('[name=' + attrid + '-DAYS]').val('' + item.days_in_advance);
1415                             }
1416                         });
1417                         message_prefs_dirty = false;
1418                     }
1419                 );
1420             });
1421         });
1422     //]]>
1423     </script>
1424     [% END %]
1425     <input type="hidden" name="setting_messaging_prefs" value="1" />
1426     <legend id="patron_messaging_prefs_lgd">Patron messaging preferences</legend>
1427     [% IF type_only %]
1428         <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>
1429     [% END %]
1430     [% INCLUDE 'messaging-preference-form.inc' %]
1431     [% IF ( SMSSendDriver ) %]
1432         <p><label for="SMSnumber">SMS number:</label>
1433           [% IF ( opduplicate ) %]
1434             <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]" onclick="this.value=''" />
1435           [% ELSE %]
1436             <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]" />
1437         [% END %]
1438         </p>
1439     [% END %]
1440   </fieldset>
1441 [% END %] [% END %]
1442
1443 [% UNLESS ( check_member ) %]
1444     <fieldset class="action">
1445         <input type="submit" name="save" onclick="return check_form_borrowers();" value="Save" />
1446       [% IF ( opadd ) %]
1447        <a class="cancel" href="/cgi-bin/koha/members/member.pl">Cancel</a>
1448            [% ELSE %]
1449           <a class="cancel" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Cancel</a>
1450            [% END %]
1451     </fieldset>
1452 [% END %]
1453 </form>
1454   
1455 </div>
1456 </div>
1457
1458 [% UNLESS ( opadd ) %]<div class="yui-b">
1459 [% INCLUDE 'members-menu.inc' %]
1460 </div>[% END %]
1461 [% END %]
1462 </div>
1463 [% INCLUDE 'intranet-bottom.inc' %]
1464