Bug 6328 fine in days does not work
[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         <fieldset class="rows" id="memberentry_identity">
182                 <legend>[% IF ( I ) %]Organization [% ELSE %]Patron [% END %]identity</legend>
183                 <ol>
184                 [% UNLESS ( I ) %]
185                 [% IF ( title_cgipopup ) %]
186             <li>
187             [% IF ( mandatorytitle ) %]
188                 <label for="btitle" class="required">
189             [% ELSE %]
190                 <label for="btitle">
191             [% END %]
192             Salutation: </label>
193             [% borrotitlepopup %]
194             [% IF ( mandatorytitle ) %]<span class="required">Required</span>[% END %]
195             </li>
196                 [% END %]
197         [% END %]
198                 <li>
199                 [% IF ( mandatorysurname ) %]
200                 <label for="surname" class="required">
201                 [% ELSE %]
202                 <label for="surname">
203                 [% END %]
204                 Surname: </label>
205                 [% IF ( uppercasesurnames ) %]
206                         [% IF ( opduplicate ) %]
207                                 <input style="text-transform:uppercase;" type="text" id="surname" name="surname" size="20"  value="[% surname %]" onclick="this.value=''" />
208                         [% ELSE %]
209                                 <input style="text-transform:uppercase;" type="text" id="surname" name="surname" size="20"  value="[% surname %]" />
210                         [% END %]
211                 [% ELSE %]
212                         [% IF ( opduplicate ) %]
213                                 <input type="text" id="surname" name="surname" size="20"  value="[% surname %]" onclick="this.value=''" />
214                         [% ELSE %]
215                                 <input type="text" id="surname" name="surname" size="20"  value="[% surname %]" />
216                         [% END %]
217                 [% END %]
218                 [% IF ( mandatorysurname ) %]<span class="required">Required</span>[% END %]
219                 </li>
220                 [% UNLESS ( I ) %]
221             <li>
222                 [% IF ( mandatoryfirstname ) %]
223                 <label for="firstname" class="required">
224                 [% ELSE %]
225                 <label for="firstname">
226                 [% END %]
227                 First name: </label>
228                 <input type="text" id="firstname" name="firstname" size="20"  value="[% IF ( opduplicate ) %][% ELSE %][% firstname %][% END %]" />
229                 [% IF ( mandatoryfirstname ) %]<span class="required">Required</span>[% END %]
230             </li>
231             <li>
232                 [% IF ( mandatorydateofbirth ) %]
233                 <label for="dateofbirth" class="required">
234                 [% ELSE %]
235                 <label for="dateofbirth">
236                 [% END %]
237                 Date of birth: </label>
238                                 
239         [% IF ( metric ) %]                     
240                 <input type="text" id="dateofbirth" name="dateofbirth" size="20" onchange="CheckDate(document.form.dateofbirth);" value="[% IF ( opduplicate ) %][% ELSE %][% dateofbirth %][% END %]" />
241 [% ELSE %]
242                 <input type="text" id="dateofbirth" name="dateofbirth" size="20" value="[% IF ( opduplicate ) %][% ELSE %][% dateofbirth %][% END %]" />
243 [% END %]
244
245                 <img src="[% themelang %]/lib/calendar/cal.gif" id="dateofbirth_button" alt="Show Calendar" />
246         <script language="JavaScript" type="text/javascript">
247             Calendar.setup(
248             {
249                 inputField : "dateofbirth",
250                 ifFormat : "[% DHTMLcalendar_dateformat %]",
251                 button : "dateofbirth_button"
252             }
253             );
254         </script>
255         [% IF ( mandatorydateofbirth ) %]<span class="required">Required</span>[% END %]
256         [% IF ( ERROR_dateofbirth ) %]<span class="required">(Error)</span>[% END %]
257                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
258             </li>
259             <li>
260                 [% IF ( mandatoryinitials ) %]
261                     <label for="initials" class="required">
262                 [% ELSE %]
263                     <label for="initials">
264                 [% END %]
265                 Initials: </label>
266                 [% IF ( opduplicate ) %]
267                                         <input type="text" id="initials" name="initials" size="20"  value="[% initials %]" onclick="this.value=''" />
268                 [% ELSE %]
269                                         <input type="text" id="initials" name="initials" size="20"  value="[% initials %]" />
270                 [% END %]
271                 [% IF ( mandatoryinitials ) %]<span class="required">Required</span>[% END %]
272             </li>
273         [% END %]
274                 <li>
275                         [% IF ( mandatoryothernames ) %]
276                         <label for="othernames" class="required">
277                         [% ELSE %]
278                         <label for="othernames">
279                         [% END %]
280                         Other name: </label>
281                         [% IF ( opduplicate ) %]
282                                 <input type="text" id="othernames" name="othernames" size="20"  value="[% othernames %]" onclick="this.value=''" />
283                         [% ELSE %]
284                                 <input type="text" id="othernames" name="othernames" size="20"  value="[% othernames %]" />
285                         [% END %]
286 [% IF ( mandatoryothernames ) %]<span class="required">Required</span>[% END %]
287                 [% IF ( I ) %]<input type="hidden" name="sex" value="N" />[% END %]
288                 </li>
289     [% UNLESS ( I ) %]
290                 <li class="radio">
291                 
292                 [% IF ( female ) %]
293                                 <label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F" checked="checked"  />
294 [% ELSE %]
295                                 <label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F" />
296 [% END %]
297                 [% IF ( male ) %]
298                 <label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" checked="checked" />
299 [% ELSE %]
300                                 <label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" />
301 [% END %]
302 [% IF ( none ) %]
303                                 <label for="sex-none">N/A </label><input type="radio" name="sex" id="sex-none" value=""  checked="checked"  />
304 [% ELSE %]
305                                 <label for="sex-none">N/A </label><input type="radio" name="sex" id="sex-none" value="" />
306 [% END %]
307         </li>
308     [% END %]
309                 </ol>
310         </fieldset>
311         
312 [% IF ( showguarantor ) %]<input type="hidden" id="guarantorid" name="guarantorid"   value="[% guarantorid %]" />
313     <fieldset class="rows">
314         <legend>Guarantor Information</legend>
315         <ol>
316 [% IF ( P ) %]
317                 [% IF ( guarantorid ) %]
318                 <li id="contact-details">
319                 [% ELSE %]
320                 <li id="contact-details" style="display: none">
321                 [% END %]
322                     <span class="label">Organization #:</span> [% IF ( guarantorid ) %] <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantorid %]" target="blank">[% guarantorid %]</a>[% END %]
323                 </li>
324                 <li>
325                     <label for="contactname">Organization name: </label>
326                     [% IF ( guarantorid ) %]
327                     <span>[% contactname %]</span>
328                     <input name="contactname" id="contactname" type="hidden" size="20" value="[% contactname %]" />
329                     [% ELSE %]
330                             [% IF ( opduplicate ) %]
331                                                 <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" onclick="this.value=''" />
332                             [% ELSE %]
333                                                 <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" />
334                             [% END %]
335                     [% END %]
336                 </li>
337 [% ELSE %]
338  [% IF ( C ) %]
339  [% IF ( guarantorid ) %]
340  <li id="contact-details">
341  [% ELSE %]
342  <li id="contact-details" style="display: none">
343  [% END %]
344      <span class="label">Patron #:</span> [% IF ( guarantorid ) %] <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantorid %]" target="blank">[% guarantorid %]</a>[% END %]
345  </li>
346  <li>
347      <label for="contactname">Surname: </label>
348      [% IF ( guarantorid ) %]
349      <span>[% contactname %]</span>
350      <input name="contactname" id="contactname" type="hidden" size="20" value="[% contactname %]" />
351      [% ELSE %]
352                 [% IF ( opduplicate ) %]
353                         <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" onclick="this.value=''" />
354                 [% ELSE %]
355                         <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" />
356                 [% END %]
357      [% END %]
358  </li>
359  <li>
360      <label for="contactfirstname">First name: </label>
361      [% IF ( guarantorid ) %]
362      <span>[% contactfirstname %]</span>
363      <input name="contactfirstname" id="contactfirstname" type="hidden" size="20" value="[% contactfirstname %]" />
364      [% ELSE %]
365              [% IF ( opduplicate ) %]
366                                 <input name="contactfirstname" id="contactfirstname" type="text" size="20" value="[% contactfirstname %]" onclick="this.value=''" />
367              [% ELSE %]
368                                 <input name="contactfirstname" id="contactfirstname" type="text" size="20" value="[% contactfirstname %]" />
369              [% END %]
370      [% END %]
371  </li>
372  [% IF ( relshiploop ) %]
373  <li>
374      <label for="relationship">Relationship: </label>
375      <select name="relationship" id="relationship" >
376          [% FOREACH relshiploo IN relshiploop %]
377          [% IF ( relshiploo.selected ) %]
378          <option value="[% relshiploo.relationship %]" selected="selected" >[% relshiploo.relationship %]</option>
379          [% ELSE %]
380          <option value="[% relshiploo.relationship %]">[% relshiploo.relationship %]</option>
381          [% END %]
382          [% END %]
383      </select>
384  </li>
385  [% END %]
386  [% END %]
387 [% END %]
388         <li>
389             <span class="label">&nbsp;</span>
390             [% IF ( guarantorid ) %]
391             <input id="guarantorsearch" type="button" value="Change" onclick="Dopopguarantor('guarantor_search.pl?category_type=[% category_type %]');" />
392             [% ELSE %]
393             <input id="guarantorsearch" type="button" value="Set to Patron" onclick="Dopopguarantor('guarantor_search.pl?category_type=[% category_type %]');" />
394             [% END %]
395             <input id="guarantordelete" type="button" value="Delete" />
396         </li>
397         </ol>
398     </fieldset>
399
400 [% END %]
401 <fieldset class="rows">
402     <legend>Main address</legend><ol>
403     <li>
404       [% IF ( mandatorystreetnumber ) %]
405       <label for="streetnumber" class="required">
406       [% ELSE %]
407       <label for="streetnumber">
408       [% END %]
409       Street number: </label>
410       [% IF ( opduplicate ) %]
411                 <input type="text" id="streetnumber" name="streetnumber" size="5" value="[% streetnumber %]" onclick="this.value=''" />
412       [% ELSE %]
413                 <input type="text" id="streetnumber" name="streetnumber" size="5" value="[% streetnumber %]" />
414       [% END %]
415 [% IF ( mandatorystreetnumber ) %]<span class="required">Required</span>[% END %]
416     </li>
417     [% IF ( road_cgipopup ) %]
418       <li>
419       [% IF ( mandatorystreettype ) %]
420       <label for="streettype" class="required">
421       [% ELSE %]
422       <label for="streettype">
423       [% END %]
424       Street type: </label>
425       [% roadpopup %]
426           [% IF ( mandatorystreettype ) %]<span class="required">Required</span>[% END %]
427       </li>
428     [% END %] 
429     <li>
430       [% IF ( mandatoryaddress ) %]
431       <label for="address" class="required">
432       [% ELSE %]
433       <label for="address">
434       [% END %]
435       Address: </label>
436       [% IF ( opduplicate ) %]
437                         <input type="text" id="address" name="address" size="35" value="[% address %]" onclick="this.value=''" />
438       [% ELSE %]
439                         <input type="text" id="address" name="address" size="35" value="[% address %]" />
440       [% END %]
441           [% IF ( mandatoryaddress ) %]<span class="required">Required</span>[% END %]
442     </li>
443     <li>
444       [% IF ( mandatoryaddress2 ) %]
445       <label for="address2" class="required">
446       [% ELSE %]
447       <label for="address2">
448       [% END %]
449       Address 2: </label>
450       [% IF ( opduplicate ) %]
451                         <input type="text" id="address2" name="address2" size="35" value="[% address2 %]" onclick="this.value=''" />
452       [% ELSE %]
453                         <input type="text" id="address2" name="address2" size="35" value="[% address2 %]" />
454       [% END %]
455           [% IF ( mandatoryaddress2 ) %]<span class="required">Required</span>[% END %]
456     </li>  
457     <li>
458       [% IF ( mandatorycity ) %]
459         <label for="city" class="required">
460       [% ELSE %]
461         <label for="city">
462       [% END %]
463       City: </label>
464         [% IF ( opduplicate ) %]
465                         <input type="text" id="city" name="city" size="20" value="[% city %]" onclick="this.value=''" />
466         [% ELSE %]
467                         <input type="text" id="city" name="city" size="20" value="[% city %]" />
468         [% END %]
469         [% IF ( city_cgipopup ) %]or <strong>choose</strong>
470         <select id="select_city" name="select_city">
471         [% FOREACH city_loo IN city_loop %]
472             [% IF ( city_loo.selected ) %]
473             <option value="[% city_loo.city_zipcode %]|[% city_loo.city_name %]|[% city_loo.city_state %]|[% city_loo.city_country %]" selected="selected">
474             [% ELSE %]
475             <option value="[% city_loo.city_zipcode %]|[% city_loo.city_name %]|[% city_loo.city_state %]|[% city_loo.city_country %]">
476             [% END %]
477                 [% city_loo.city_name %] [% city_loo.city_state %] [% city_loo.city_zipcode %]
478             </option>
479         [% END %]
480         </select>
481         [% END %]
482           [% IF ( mandatorycity ) %]<span class="required">Required</span>[% END %]
483     </li>
484     <li> 
485       [% IF ( mandatorystate ) %]
486         <label for="state" class="required">
487       [% ELSE %]
488         <label for="state">
489       [% END %]
490       State: </label>
491       <input type="text" name="state" id="state" size="20" value="[% state %]" />
492           [% IF ( mandatorystate ) %]<span class="required">Required</span>[% END %]
493     </li>
494     <li> 
495       [% IF ( mandatoryzipcode ) %]
496         <label for="zipcode" class="required">
497       [% ELSE %]
498         <label for="zipcode">
499       [% END %]
500       Zip/Postal code: </label>
501       [% IF ( opduplicate ) %]
502                         <input type="text" name="zipcode" id="zipcode" size="10" value="[% zipcode %]" onclick="this.value=''" />
503       [% ELSE %]
504                         <input type="text" name="zipcode" id="zipcode" size="10" value="[% zipcode %]" />
505       [% END %]
506           [% IF ( mandatoryzipcode ) %]<span class="required">Required</span>[% END %]
507     </li>
508     
509     <li> 
510       [% IF ( mandatorycountry ) %]
511         <label for="country" class="required">
512       [% ELSE %]
513         <label for="country">
514       [% END %]
515       Country: </label>
516       [% IF ( opduplicate ) %]
517                         <input type="text" name="country" id="country" size="20" value="[% country %]" onclick="this.value=''" />
518       [% ELSE %]
519                         <input type="text" name="country" id="country" size="20" value="[% country %]" />
520       [% END %]
521           [% IF ( mandatorycountry ) %]<span class="required">Required</span>[% END %]
522     </li>    
523   
524         </ol>
525     </fieldset>
526   <fieldset class="rows" id="memberentry_contact">
527     <legend>Contact</legend><ol>
528       <li>
529       [% IF ( mandatoryphone ) %] 
530       <label for="phone" class="required">
531       [% ELSE %]
532       <label for="phone">
533       [% END %]
534       Primary Phone: </label>
535       [% IF ( opduplicate ) %]
536                         <input type="text" id="phone" name="phone" value="[% phone %]" onclick="this.value=''" />
537       [% ELSE %]
538                         <input type="text" id="phone" name="phone" value="[% phone %]" />
539       [% END %]
540           [% IF ( mandatoryphone ) %]<span class="required">Required</span>[% END %]<div class="hint">Shows on transit slips</div>
541
542     </li>
543     <li>
544       [% IF ( mandatoryphonepro ) %]
545       <label for="phonepro" class="required">
546       [% ELSE %]
547       <label for="phonepro">
548       [% END %]
549       Secondary Phone: </label>
550       [% IF ( opduplicate ) %]
551                         <input type="text" id="phonepro" name="phonepro" value="[% phonepro %]" onclick="this.value=''" />
552       [% ELSE %]
553                         <input type="text" id="phonepro" name="phonepro" value="[% phonepro %]" />
554       [% END %]
555           [% IF ( mandatoryphonepro ) %]<span class="required">Required</span>[% END %]
556     </li>
557     <li>
558       [% IF ( mandatorymobile ) %]
559       <label for="mobile" class="required">
560       [% ELSE %]
561       <label for="mobile">
562       [% END %]
563       Other Phone: </label>
564       [% IF ( opduplicate ) %]
565                 <input type="text" id="mobile" name="mobile" value="[% mobile %]" onclick="this.value=''" />
566       [% ELSE %]
567                 <input type="text" id="mobile" name="mobile" value="[% mobile %]" />
568       [% END %]
569           [% IF ( mandatorymobile ) %]<span class="required">Required</span>[% END %]
570     </li>
571     <li>
572       [% IF ( mandatoryemail ) %]
573       <label for="email" class="required">
574       [% ELSE %]
575       <label for="email">
576       [% END %]
577       Primary Email: </label>
578       [% IF ( opduplicate ) %]
579                 <input type="text" id="email" name="email" size="45" value="[% email %]" onclick="this.value=''" />
580       [% ELSE %]
581                 <input type="text" id="email" name="email" size="45" value="[% email %]" />
582       [% END %]
583           [% IF ( mandatoryemail ) %]<span class="required">Required</span>[% END %]<div class="hint">Shows on transit slips</div>
584
585     </li>
586     <li>
587       [% IF ( mandatoryemailpro ) %] 
588       <label for="emailpro" class="required">
589       [% ELSE %]
590       <label for="emailpro">
591       [% END %]
592       Secondary Email: </label>
593       [% IF ( opduplicate ) %]
594                 <input type="text" id="emailpro" name="emailpro" size="45" value="[% emailpro %]" onclick="this.value=''" />
595       [% ELSE %]
596                 <input type="text" id="emailpro" name="emailpro" size="45" value="[% emailpro %]" />
597       [% END %]
598           [% IF ( mandatoryemailpro ) %]<span class="required">Required</span>[% END %]
599     </li>
600     <li>
601       [% IF ( mandatoryfax ) %]
602       <label for="fax" class="required">
603       [% ELSE %]
604       <label for="fax">
605       [% END %]
606       Fax: </label>
607       [% IF ( opduplicate ) %]
608                 <input type="text" id="fax" name="fax" value="[% fax %]" onclick="this.value=''" />
609       [% ELSE %]
610                 <input type="text" id="fax" name="fax" value="[% fax %]" />
611       [% END %]
612           [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %]
613     </li>
614         </ol>
615   </fieldset>
616
617
618 <!-- ************************ STEP_1 *********************** -->
619 [% END %]
620 [% IF ( step_6 ) %]
621
622                 <fieldset class="rows" id="memberentry_address">
623                 <legend>Alternate address</legend><ol>
624                         <li>
625                                 [% IF ( mandatoryB_address ) %]
626                                         <label for="B_address" class="required">
627                                 [% ELSE %]
628                                         <label for="B_address">
629                                 [% END %]
630                                 Address: </label>
631                                 [% IF ( opduplicate ) %]
632                                         <input type="text" id="B_address" name="B_address" size="40" value="[% B_address %]" onclick="this.value=''" />
633                                 [% ELSE %]
634                                         <input type="text" id="B_address" name="B_address" size="40" value="[% B_address %]" />
635                                 [% END %]
636           [% IF ( mandatoryB_address ) %]<span class="required">Required</span>[% END %]
637                         </li>
638                         <li>
639                                 [% IF ( mandatoryB_address2 ) %]
640                                         <label for="B_address2" class="required">
641                                 [% ELSE %]
642                                         <label for="B_address2">
643                                 [% END %]
644                                 Address 2: </label>
645                                 [% IF ( opduplicate ) %]
646                                         <input type="text" id="B_address2" name="B_address2" size="40" value="[% B_address2 %]" onclick="this.value=''" />
647                                 [% ELSE %]
648                                         <input type="text" id="B_address2" name="B_address2" size="40" value="[% B_address2 %]" />
649                                 [% END %]
650           [% IF ( mandatoryB_address2 ) %]<span class="required">Required</span>[% END %]
651                         </li>
652                         <li>
653                                 [% IF ( mandatoryB_city ) %]
654                                         <label for="B_city" class="required" >
655                                 [% ELSE %]
656                                         <label for="B_city">
657                                 [% END %]
658                                 City: </label>
659                                 <input type="text" id="B_city" name="B_city" size="20" value="[% B_city %]" />
660           [% IF ( mandatoryB_city ) %]<span class="required">Required</span>[% END %]
661                         </li>
662                         <li>
663                                 [% IF ( mandatoryB_state ) %]
664                                         <label for="B_state" class="required" >
665                                 [% ELSE %]
666                                         <label for="B_state">
667                                 [% END %]
668                                 State: </label>
669                                 <input type="text" id="B_state" name="B_state" size="20" value="[% B_state %]" />
670           [% IF ( mandatoryB_state ) %]<span class="required">Required</span>[% END %]
671                         </li>
672                         <li>
673                                 [% IF ( mandatoryB_zipcode ) %]
674                                         <label for="B_zipcode" class="required">
675                                 [% ELSE %]
676                                         <label for="B_zipcode">
677                                 [% END %]
678                                 Zip/Postal code: </label>
679                                 [% IF ( opduplicate ) %]
680                                         <input type="text" id="B_zipcode" name="B_zipcode" maxlength="10" size="10" value="[% B_zipcode %]" onclick="this.value=''" />
681                                 [% ELSE %]
682                                         <input type="text" id="B_zipcode" name="B_zipcode" maxlength="10" size="10" value="[% B_zipcode %]" />
683                                 [% END %]
684           [% IF ( mandatoryB_zipcode ) %]<span class="required">Required</span>[% END %]
685                         </li>
686                         <li>
687                                 [% IF ( mandatoryB_country ) %]
688                                         <label for="B_country" class="required">
689                                 [% ELSE %]
690                                         <label for="B_country">
691                                 [% END %]
692                                 Country: </label>
693                                 [% IF ( opduplicate ) %]
694                                         <input type="text" id="B_country" name="B_country" size="20" value="[% B_country %]" onclick="this.value=''" />
695                                 [% ELSE %]
696                                         <input type="text" id="B_country" name="B_country" size="20" value="[% B_country %]" />
697                                 [% END %]
698           [% IF ( mandatoryB_country ) %]<span class="required">Required</span>[% END %]
699                         </li>
700             <li>
701                 [% IF ( mandatoryB_phone ) %]
702                 <label for="B_phone" class="required">
703                 [% ELSE %]
704                 <label for="B_phone">
705                 [% END %]
706                 Phone: </label>
707                 [% IF ( opduplicate ) %]
708                                         <input type="text" id="B_phone" name="B_phone" value="[% B_phone %]" onclick="this.value=''" />
709                 [% ELSE %]
710                                         <input type="text" id="B_phone" name="B_phone" value="[% B_phone %]" />
711                 [% END %]
712                 [% IF ( mandatoryB_phone ) %]<span class="required">Required</span>[% END %]
713             </li>
714                         <li> 
715         [% IF ( mandatoryB_email ) %]
716           <label for="B_email" class="required">
717         [% ELSE %]
718           <label for="B_email">
719         [% END %]
720         Email: </label>
721         [% IF ( opduplicate ) %]
722                         <input type="text" id="B_email" name="B_email" size="45" value="[% B_email %]" onclick="this.value=''" />
723         [% ELSE %]
724                         <input type="text" id="B_email" name="B_email" size="45" value="[% B_email %]" />
725                 [% END %]
726                 [% IF ( mandatoryB_email ) %]<span class="required">Required</span>[% END %] </li>
727             <li>
728                 [% IF ( mandatorycontactnote ) %]
729                 <label for="contactnote" class="required">
730                 [% ELSE %]
731                 <label for="contactnote">
732                 [% END %]
733                 Contact note: </label>
734                 <textarea id="contactnote" name="contactnote" cols="40" rows="2">[% contactnote %]</textarea>
735         [% IF ( mandatorycontactnote ) %]<span class="required">Required</span>[% END %]
736             </li>
737                         </ol>
738                 </fieldset>
739 [% END %]               
740 [% IF ( step_2 ) %]
741                 <fieldset class="rows" id="memberentry_altaddress">       
742                     <legend>Alternate Contact</legend><ol>
743                         <li>
744                             [% IF ( mandatoryaltcontactsurname ) %]
745                                 <label for="altcontactsurname" class="required">
746                                 [% ELSE %]
747                                 <label for="altcontactsurname">
748                                 [% END %]
749                                 Surname:</label>
750                                 [% IF ( opduplicate ) %]
751                                         <input type="text" name="altcontactsurname" id="altcontactsurname" value="[% altcontactsurname %]" onclick="this.value=''" />
752                                 [% ELSE %]
753                                         <input type="text" name="altcontactsurname" id="altcontactsurname" value="[% altcontactsurname %]" />
754                                 [% END %]
755                                 [% IF ( mandatoryaltcontactsurname ) %]<span class="required">Required</span>[% END %]
756                         </li>
757                         <li>
758                             [% IF ( mandatoryaltcontactfirstname ) %]
759                                 <label for="altcontactfirstname" class="required">
760                                 [% ELSE %]
761                                 <label for="altcontactfirstname">
762                                 [% END %]
763                                 First name:</label>
764                                 [% IF ( opduplicate ) %]
765                                         <input type="text" name="altcontactfirstname" id="altcontactfirstname" value="[% altcontactfirstname %]" onclick="this.value=''" />
766                                 [% ELSE %]
767                                         <input type="text" name="altcontactfirstname" id="altcontactfirstname" value="[% altcontactfirstname %]" />
768                                 [% END %]
769                                 [% IF ( mandatoryaltcontactfirstname ) %]<span class="required">Required</span>[% END %]
770                         </li>
771                         <li>
772                             [% IF ( mandatoryaltcontactaddress1 ) %]
773                                 <label for="altcontactaddress1" class="required">
774                                 [% ELSE %]
775                                 <label for="altcontactaddress1">
776                                 [% END %]
777                                 Address:</label>
778                                 [% IF ( opduplicate ) %]
779                                         <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% altcontactaddress1 %]" onclick="this.value=''" size="40" />
780                                 [% ELSE %]
781                                         <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% altcontactaddress1 %]" size="40" />
782                                 [% END %]
783                                 [% IF ( mandatoryaltcontactaddress1 ) %]<span class="required">Required</span>[% END %]
784                         </li>
785                         <li>
786                             [% IF ( mandatoryaltcontactaddress2 ) %]
787                                 <label for="altcontactaddress2" class="required">
788                                 [% ELSE %]
789                                 <label for="altcontactaddress2">
790                                 [% END %]
791                                 Address 2:</label>
792                                 [% IF ( opduplicate ) %]
793                                         <input type="text" name="altcontactaddress2" id="altcontactaddress2" value="[% altcontactaddress2 %]" onclick="this.value=''" size="40" />
794                                 [% ELSE %]
795                                         <input type="text" name="altcontactaddress2" id="altcontactaddress2" value="[% altcontactaddress2 %]" size="40" />
796                                 [% END %]
797                                 [% IF ( mandatoryaltcontactaddress2 ) %]<span class="required">Required</span>[% END %]
798                         </li>
799                         <li>
800                             [% IF ( mandatoryaltcontactaddress3 ) %]
801                                 <label for="altcontactaddress3" class="required">
802                                 [% ELSE %]
803                                 <label for="altcontactaddress3">
804                                 [% END %]
805                                 City:</label>
806                                 <input type="text" name="altcontactaddress3" id="altcontactaddress3" value="[% altcontactaddress3 %]" size="20" />
807                                 [% IF ( mandatoryaltcontactaddress3 ) %]<span class="required">Required</span>[% END %]
808                         </li>
809                         <li>
810                             [% IF ( mandatoryaltcontactstate ) %]
811                                 <label for="altcontactstate" class="required">
812                                 [% ELSE %]
813                                 <label for="altcontactstate">
814                                 [% END %]
815                                 State:</label>
816                                 <input type="text" name="altcontactstate" id="altcontactstate" value="[% altcontactstate %]" size="20" />
817                                 [% IF ( mandatoryaltcontactstate ) %]<span class="required">Required</span>[% END %]
818                         </li>
819                         <li>
820                             [% IF ( mandatoryaltcontactzipcode ) %]
821                                 <label for="altcontactzipcode" class="required">
822                                 [% ELSE %]
823                                 <label for="altcontactzipcode">
824                                 [% END %]
825                                 Zip/Postal code:</label>
826                                 [% IF ( opduplicate ) %]
827                                         <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% altcontactzipcode %]" onclick="this.value=''" size="5" />
828                                 [% ELSE %]
829                                         <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% altcontactzipcode %]" size="5" />
830                                 [% END %]
831                                 [% IF ( mandatoryaltcontactzipcode ) %]<span class="required">Required</span>[% END %]
832                         </li>
833                         <li>
834                             [% IF ( mandatoryaltcontactcountry ) %]
835                                 <label for="altcontactcountry" class="required">
836                                 [% ELSE %]
837                                 <label for="altcontactcountry">
838                                 [% END %]
839                                 Country:</label>
840                                 [% IF ( opduplicate ) %]
841                                         <input type="text" name="altcontactcountry" id="altcontactcountry" value="[% altcontactcountry %]" onclick="this.value=''" size="20" />
842                                 [% ELSE %]
843                                         <input type="text" name="altcontactcountry" id="altcontactcountry" value="[% altcontactcountry %]" size="20" />
844                                 [% END %]
845                                 [% IF ( mandatoryaltcontactcountry ) %]<span class="required">Required</span>[% END %]
846                         </li>                   
847                         <li>
848                             [% IF ( mandatoryaltcontactphone ) %]
849                                 <label for="altcontactphone" class="required">
850                                 [% ELSE %]
851                                 <label for="altcontactphone">
852                                 [% END %]
853                                 Phone:</label>
854                                 [% IF ( opduplicate ) %]
855                                         <input type="text" name="altcontactphone" id="altcontactphone" value="[% altcontactphone %]" onclick="this.value=''" />
856                                 [% ELSE %]
857                                         <input type="text" name="altcontactphone" id="altcontactphone" value="[% altcontactphone %]" />
858                                 [% END %]
859                                 [% IF ( mandatoryaltcontactphone ) %]<span class="required">Required</span>[% END %]
860                         </li>
861             </ol>
862         </fieldset>
863
864 [% END %]
865 [% IF ( step_3 ) %]
866
867   <fieldset class="rows" id="memberentry_library_management">
868     <legend>Library Management</legend><ol>
869    <li> [% IF ( mandatorycardnumber ) %]
870       <label for="cardnumber" class="required">
871     [% ELSE %]
872       <label for="cardnumber">
873     [% END %] 
874     Card number: </label>
875     [% IF ( opduplicate ) %]
876                 <input type="text" id="cardnumber" name="cardnumber" size="20" />
877     [% ELSE %]
878                 <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" />
879     [% END %]
880           [% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]</li>
881     <li>
882       [% IF ( mandatorybranchcode ) %]
883         <label for="branchcode" class="required">
884       [% ELSE %]
885         <label for="branchcode">
886       [% END %]
887       Library: </label>
888       [% CGIbranch %]
889           [% IF ( mandatorybranchcode ) %]<span class="required">Required</span>[% END %]
890     </li>
891     <li>
892         <label for="categorycode">Category: </label>
893         <select id="categorycode" name="categorycode">
894         [% FOREACH typeloo IN typeloop %]
895                         [% FOREACH categoryloo IN typeloo.categoryloop %]
896                                 [% IF ( loop.first ) %]
897                                         [% IF ( categoryloo.typename_C ) %]<optgroup label="Child">[% END %]
898                                         [% IF ( categoryloo.typename_A ) %]<optgroup label="Adult">[% END %]
899                                         [% IF ( categoryloo.typename_S ) %]<optgroup label="Staff">[% END %]
900                                         [% IF ( categoryloo.typename_I ) %]<optgroup label="Organization">[% END %]
901                                         [% IF ( categoryloo.typename_P ) %]<optgroup label="Professional">[% END %]
902                                         [% IF ( categoryloo.typename_X ) %]<optgroup label="Statistical">[% END %]
903                             [% END %]
904                                 [% IF ( categoryloo.categorycodeselected ) %]
905                <option value="[% categoryloo.categorycode %]" selected="selected">[% categoryloo.categoryname %]</option>
906                                 [% ELSE %]
907 <option value="[% categoryloo.categorycode %]">[% categoryloo.categoryname %]</option>
908                                 [% END %]
909                                 [% IF ( loop.last ) %]
910                                 </optgroup>
911                                 [% END %]
912             [% END %]
913        [% END %]
914        </select>
915     </li>
916     <li>
917       [% IF ( mandatorysort1 ) %]
918         <label for="sort1" class="required">
919       [% ELSE %]
920         <label for="sort1">
921       [% END %]
922       Sort 1: </label>
923       [% IF ( CGIsort1 ) %] 
924         [% CGIsort1 %]
925       [% ELSE %]
926         <input  type="text" id="sort1" name="sort1" size="20"  value="[% sort1 %]" />
927           [% IF ( mandatorysort1 ) %]<span class="required">Required</span>[% END %]
928       [% END %]   
929     </li>
930     <li>
931     [% IF ( mandatorysort2 ) %]
932     <label for="sort2" class="required">
933     [% ELSE %]
934     <label for="sort2">
935     [% END %]
936     Sort 2: </label>
937     [% IF ( CGIsort2 ) %] 
938       [% CGIsort2 %]
939     [% ELSE %]
940       [% IF ( opduplicate ) %]
941                 <input  type="text" id="sort2" name="sort2" size="20"  value="[% sort2 %]" onclick="this.value=''" />
942       [% ELSE %]
943                 <input  type="text" id="sort2" name="sort2" size="20"  value="[% sort2 %]" />
944       [% END %]
945           [% IF ( mandatorysort2 ) %]<span class="required">Required</span>[% END %]
946     [% END %] 
947     </li>
948         </ol>
949   </fieldset>
950         <fieldset class="rows" id="memberentry_subscription">
951         <legend>Library set-up</legend><ol>
952                 <li>
953                         [% IF ( mandatorydateenrolled ) %]
954                         <label for="dateenrolled" class="required">
955                         [% ELSE %]
956                         <label for="dateenrolled">
957                         [% END %]
958                         Registration date: </label>
959                         [% IF ( metric ) %]
960                                 <input type="text" id="dateenrolled" name="dateenrolled"  maxlength="10" size="10" onchange="CheckDate(document.form.dateenrolled);check_manip_date('verify');" value="[% dateenrolled %]" />
961                         [% ELSE %]
962                                 <input type="text" id="dateenrolled" name="dateenrolled"  maxlength="10" size="10" value="[% dateenrolled %]" />
963                         [% END %]
964             <img src="[% themelang %]/lib/calendar/cal.gif" id="dateenrolled_button" alt="Show Calendar" />
965       <script language="JavaScript" type="text/javascript">
966         Calendar.setup(
967           {
968             inputField : "dateenrolled",
969             ifFormat : "[% DHTMLcalendar_dateformat %]",
970             button : "dateenrolled_button"
971           }
972         );
973       </script>
974                 [% IF ( mandatorydateenrolled ) %]<span class="required">Required</span>[% END %]
975                 [% IF ( ERROR_dateenrolled ) %]<span class="required">(Error)</span>[% END %]
976                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
977                 </li>
978                 <li>
979                         [% IF ( mandatorydateexpiry ) %]
980                         <label for="dateexpiry" class="required">
981                         [% ELSE %]
982                         <label for="dateexpiry">
983                         [% END %]
984                         Expiry date (leave blank for auto calc) </label>
985                         [% IF ( metric ) %]
986                                 [% UNLESS ( opadd ) %]
987                                         <input type="text" id="dateexpiry" name="dateexpiry" maxlength="10"  size="10" onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');" value="[% dateexpiry %]" />
988                                 [% ELSE %]
989                                         <input type="text" id="dateexpiry" name="dateexpiry" maxlength="10"  size="10" onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');" />
990                                 [% END %]
991                         [% ELSE %]
992                                 [% UNLESS ( opadd ) %]
993                                 <input type="text" id="dateexpiry" name="dateexpiry" maxlength="10"  size="10" value="[% dateexpiry %]" />
994                                 [% ELSE %]
995                                 <input type="text" id="dateexpiry" name="dateexpiry" maxlength="10"  size="10" />
996                                 [% END %]
997                         [% END %]
998             <img src="[% themelang %]/lib/calendar/cal.gif" id="dateexpiry_button" alt="Show Calendar" />
999       <script language="JavaScript" type="text/javascript">
1000         Calendar.setup(
1001           {
1002             inputField : "dateexpiry",
1003             ifFormat : "[% DHTMLcalendar_dateformat %]",
1004             button : "dateexpiry_button"
1005           }
1006         );
1007       </script>
1008                 [% IF ( mandatorydateexpiry ) %]<span class="required">Required</span>[% END %]
1009                 [% IF ( ERROR_dateexpiry ) %]<span class="required">(Error)</span>[% END %]
1010                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
1011                 </li>
1012                 <li>
1013                         [% IF ( mandatoryopacnote ) %]
1014                                 <label for="opacnote" class="required">
1015                         [% ELSE %]
1016                                 <label for="opacnote">
1017                         [% END %]       
1018                         OPAC note: </label>
1019                         <textarea id="opacnote" name="opacnote" cols="55" rows="5">[% opacnote %]</textarea>
1020                         <div class="hint">This message appears on this patron's user page in the OPAC</div>
1021           [% IF ( mandatoryopacnote ) %]<span class="required">Required</span>[% END %]
1022                 </li>
1023                 <li>
1024                         [% IF ( mandatoryborrowernotes ) %]     
1025                                 <label for="borrowernotes" class="required">
1026                         [% ELSE %]
1027                                 <label for="borrowernotes">
1028                         [% END %]
1029                         Circulation note: </label>
1030                         <textarea id="borrowernotes" name="borrowernotes" cols="55" rows="5">[% borrowernotes %]</textarea>
1031                         <div class="hint">This message displays when checking out to this patron</div>
1032           [% IF ( mandatoryborrowernotes ) %]<span class="required">Required</span>[% END %]
1033                 </li>
1034                 </ol>
1035         </fieldset>
1036         <fieldset class="rows" id="memberentry_userid">
1037                 <legend>OPAC/Staff Login</legend><ol>
1038                 <li>
1039                         [% IF ( mandatoryuserid ) %]
1040                         <label for="userid" class="required">
1041                         [% ELSE %]
1042                         <label for="userid">
1043                         [% END %]
1044                         Username: </label>
1045
1046 [% IF ( NoUpdateLogin ) %]
1047         [% IF ( opduplicate ) %]
1048                 <input type="text" id="userid" name="userid" size="20" disabled="disabled" />
1049         [% ELSE %]
1050                 <input type="text" id="userid" name="userid" size="20" disabled="disabled" value="[% userid %]" />
1051         [% END %]
1052 [% ELSE %]
1053         [% IF ( opduplicate ) %]
1054                 <input type="text" id="userid" name="userid" size="20" value="" />
1055         [% ELSE %]
1056                 <input type="text" id="userid" name="userid" size="20" value="[% userid %]" />
1057         [% END %]
1058 [% END %]
1059
1060           [% IF ( mandatoryuserid ) %]<span class="required">Required</span>[% END %]
1061                 </li>
1062                 <li>
1063                         [% IF ( mandatorypassword ) %]
1064                         <label for="password" class="required">
1065                         [% ELSE %]
1066                         <label for="password">
1067                         [% END %]
1068                         Password: </label>
1069                         [% IF ( opadd ) %]
1070                         [% IF ( NoUpdateLogin ) %]
1071                                 [% IF ( opduplicate ) %]
1072                                         <input type="text" id="password" name="password" size="20"  disabled="disabled" />
1073                                 [% ELSE %]
1074                                         <input type="text" id="password" name="password" size="20"  disabled="disabled" value="[% password %]" />
1075                                 [% END %]
1076 [% ELSE %]
1077                                 [% IF ( opduplicate ) %]
1078                                         <input type="text" id="password" name="password" size="20" />
1079                                 [% ELSE %]
1080                                         <input type="text" id="password" name="password" size="20" value="[% password %]" />
1081                                 [% END %]
1082 [% END %]
1083                         [% ELSE %]
1084                         [% IF ( password ) %]
1085                                 [% IF ( NoUpdateLogin ) %]
1086                                         <input type="text" id="password" name="password" size="20"  disabled="disabled" value="****" />
1087                                 [% ELSE %]
1088                                         [% IF ( opduplicate ) %]
1089                                                 <input type="text" id="password" name="password" size="20" />
1090                                         [% ELSE %]
1091                                                 <input type="text" id="password" name="password" size="20" value="****" />
1092                                         [% END %]
1093                                 [% END %]
1094                         [% ELSE %]
1095                                 [% IF ( NoUpdateLogin ) %]
1096                                         <input type="text" id="password" name="password" size="20"  disabled="disabled" value="" />
1097                                 [% ELSE %]
1098                                         <input type="text" id="password" name="password" size="20" value="" />
1099                                 [% END %]
1100                         [% END %]
1101                         [% END %]
1102           [% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %][% IF ( ERROR_short_password ) %]<span class="required">Password is too short</span>[% END %]
1103 [% IF ( minPasswordLength ) %]<div class="hint">Minimum password length: [% minPasswordLength %]</div>[% END %]
1104                 </li></ol>
1105                 </fieldset>
1106                 <!--this zones are not necessary in modif mode -->
1107                 [% UNLESS ( opadd ) %]
1108                 <fieldset class="rows">
1109                         <legend>Patron Account Flags</legend>
1110                         <ol class="radio">
1111                         [% FOREACH flagloo IN flagloop %]
1112                                 <li><label class="radio" for="yes[% flagloo.name %]">
1113                                 [% IF ( flagloo.key == 'gonenoaddress' ) %]Gone no Address:[% END %]
1114                                 [% IF ( flagloo.key == 'debarred' ) %]Restricted:[% END %]
1115                                 [% IF ( flagloo.key == 'lost' ) %]Lost Card:[% END %]
1116                 </label>
1117                                 <label for="yes[% flagloo.name %]">Yes </label>
1118                                 [% IF ( flagloo.yes ) %]
1119                                 <input type="radio" id="yes[% flagloo.name %]" name="[% flagloo.name %]" value="1" checked="checked" />
1120                                 [% ELSE %]
1121                                 <input type="radio" id="yes[% flagloo.name %]" name="[% flagloo.name %]" value="1" />
1122                                 [% END %]
1123                                 <label for="no[% flagloo.name %]">No </label>
1124                                 [% IF ( flagloo.no ) %]
1125                                 <input type="radio" id="no[% flagloo.name %]" name="[% flagloo.name %]" value="0" checked="checked"/>
1126                                 [% ELSE %]
1127                                 <input type="radio" id="no[% flagloo.name %]" name="[% flagloo.name %]" value="0" />
1128                                 [% END %]
1129
1130             </li>
1131                         [% END %]
1132                         <li>
1133                                 <label for="yesdebarred" class="radio">Debarred: </label>
1134                                 [% IF ( debarred ) %]
1135                                 <label for="yesdebarred">Yes </label>
1136                                 <input type="radio" id="yesdebarred" name="debarred" value="1" checked="checked"/>
1137                 <label for="nodebarred">No </label>
1138                 <input type="radio" id="nodebarred" name="debarred" value="0"/>
1139                                 [% ELSE %]
1140                                 <label for="yesdebarred">Yes </label>
1141                                 <input type="radio" id="yesdebarred" name="debarred" value="1" />
1142                 <label for="nodebarred">No </label>
1143                 <input type="radio" id="nodebarred" name="debarred" value="0" checked="checked"/>
1144                                 [% END %]
1145                                 
1146                                 <br />
1147                                 <label for="datedebarred" class="radio">until:</label> 
1148                                 <input type="text" name="datedebarred" id="debarred" class="debarred" value="[% datedebarred %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
1149                                 <img src="[% themelang %]/lib/calendar/cal.gif" id="debarred_button" alt="Show Calendar" />
1150                          <script language="JavaScript" type="text/javascript">
1151                             Calendar.setup(
1152                             {
1153                                 inputField : "debarred",
1154                                 ifFormat : "[% DHTMLcalendar_dateformat %]",
1155                                 button : "debarred_button"
1156                             }
1157                             );
1158                         </script>
1159                         <br />
1160                         <label for="debarredcomment" class="radio">Comment:</label>
1161                                 <textarea id="debarredcomment" name="debarredcomment" cols="55" rows="3" [% IF ( opduplicate ) %] onclick="this.value=''"[% END %]>[% debarredcomment %]</textarea>
1162                 </li>
1163
1164                         </ol>
1165                         </fieldset>
1166     
1167                 [% END %]       
1168
1169 [% END %]
1170
1171 [% IF ( step_4 ) %][% IF ( ExtendedPatronAttributes ) %][% UNLESS ( no_patron_attribute_types ) %]
1172   <fieldset class="rows" id="memberentry_patron_attributes">
1173     <input type="hidden" name="setting_extended_patron_attributes" value="1" />
1174     <legend>Additional attributes and identifiers</legend>
1175     <table>
1176         <tr>
1177             <th>Type</th>
1178             <th colspan="2">Value</th>
1179         </tr>
1180         [% FOREACH patron_attribute IN patron_attributes %]
1181         <tr>
1182             <td>[% patron_attribute.code %] ([% patron_attribute.description %])
1183             </td>
1184             <td>
1185                 <input type="hidden" id="[% patron_attribute.form_id %]_code" name="[% patron_attribute.form_id %]_code" value="[% patron_attribute.code |html %]" />
1186                 [% IF ( patron_attribute.use_dropdown ) %]
1187                     <select id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]">
1188                         <option value="" />
1189                         [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
1190                             [% IF ( auth_val_loo.selected ) %]
1191                                 <option value="[% auth_val_loo.authorised_value %]" selected="selected">
1192                                     [% auth_val_loo.lib %]
1193                                 </option>
1194                             [% ELSE %]
1195                                 <option value="[% auth_val_loo.authorised_value %]" >
1196                                     [% auth_val_loo.lib %]
1197                                 </option>
1198                             [% END %]
1199                         [% END %]
1200                     </select>
1201                 [% ELSE %]
1202                     [% IF ( opduplicate ) %]
1203                     <input type="text" maxlength="64" value="[% patron_attribute.value %]"
1204                            id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]" onclick="this.value=''" />
1205                     [% ELSE %]
1206                     <input type="text" maxlength="64" value="[% patron_attribute.value %]"
1207                            id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]" />
1208                     [% END %]
1209                 [% END %]
1210                 [% IF ( patron_attribute.password_allowed ) %]
1211                     (Password: <input type="password" maxlength="64" value="[% patron_attribute.password %]"
1212                            id="[% patron_attribute.form_id %]_password" name="[% patron_attribute.form_id %]_password" />)
1213                 [% END %]
1214             </td>
1215             <td>
1216                 <a href="#" onclick="clear_entry(this); return false;">Clear</a>
1217                 [% IF ( patron_attribute.repeatable ) %]
1218                 <a href="#" onclick="clone_entry(this); return false;">New</a>
1219                 [% END %]
1220             </td>
1221         </tr>
1222         [% END %]
1223     </table>
1224   </fieldset>
1225 [% END %][% END %][% END %]
1226
1227 [% IF ( step_5 ) %][% IF ( EnhancedMessagingPreferences ) %]
1228   <fieldset class="rows" id="memberentry_messaging_prefs">
1229     [% IF ( opadd ) %]
1230     <!-- handle changing prefs if creating new patron and changing
1231          the patron category
1232     -->
1233     <script language="javascript" type="text/javascript">//<![CDATA[
1234        $(document).ready(function(){
1235             var message_prefs_dirty = false;
1236             $('#memberentry_messaging_prefs > *').change(function() {
1237                 message_prefs_dirty = true;
1238             });
1239             $('#categorycode').change(function() {
1240                 var categorycode = $(this).val();
1241                 if (message_prefs_dirty) {
1242                     if (!confirm('Change messaging preferences to default for this category?')) {
1243                         return;
1244                     }
1245                 }
1246                 $.getJSON('/cgi-bin/koha/members/default_messageprefs.pl?categorycode=' + categorycode,
1247                     function(data) {
1248                         $.each(data.messaging_preferences, function(i, item) {
1249                             var attrid = item.message_attribute_id;
1250                             var transports = ['email', 'rss', 'sms'];
1251                             $.each(transports, function(j, transport) {
1252                                 if (item['transport-' + transport] != ' ') {
1253                                     $('#' + transport + attrid).attr('checked', item['transport-' + transport]);
1254                                 } else {
1255                                     $('#' + transport + attrid).removeAttr('checked');
1256                                 }
1257                             });
1258                             if (item.digest && item.digest != ' ') {
1259                                 $('#digest' + attrid).attr('checked', item.digest);
1260                             } else {
1261                                 $('#digest' + attrid).removeAttr('checked');
1262                             }
1263                             if (item.takes_days == '1') {
1264                                 $('[name=' + attrid + '-DAYS]').val('' + item.days_in_advance);
1265                             }
1266                         });
1267                         message_prefs_dirty = false;
1268                     }
1269                 );
1270             });
1271         });
1272     //]]>
1273     </script>
1274     [% END %]
1275     <input type="hidden" name="setting_messaging_prefs" value="1" />
1276     <legend>Patron messaging preferences</legend>
1277     [% IF type_only %]
1278         <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>
1279     [% END %]
1280     [% INCLUDE 'messaging-preference-form.inc' %]
1281     [% IF ( SMSSendDriver ) %]
1282         <p><label for="SMSnumber">SMS number:</label>
1283           [% IF ( opduplicate ) %]
1284             <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]" onclick="this.value=''" />
1285           [% ELSE %]
1286             <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]" />
1287         [% END %]
1288         </p>
1289     [% END %]
1290   </fieldset>
1291 [% END %] [% END %]
1292
1293     <fieldset class="action">
1294         <input type="submit" name="save" onclick="return check_form_borrowers();" value="Save" />
1295       [% IF ( opadd ) %]
1296        <a class="cancel" href="/cgi-bin/koha/members/member.pl">Cancel</a>
1297            [% ELSE %]
1298           <a class="cancel" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Cancel</a>
1299            [% END %]
1300     </fieldset>
1301 </form>
1302   
1303 </div>
1304 </div>
1305
1306 [% UNLESS ( opadd ) %]<div class="yui-b">
1307 [% INCLUDE 'members-menu.inc' %]
1308 </div>[% END %]
1309 [% END %]
1310 </div>
1311 [% INCLUDE 'intranet-bottom.inc' %]
1312