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