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