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