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