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