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