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