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