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