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