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