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