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