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