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