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