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