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