Bug 15758: Koha::Libraries - Remove GetBranchesLoop
[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 %] [% END %][% IF (surname) %][% surname %] [% 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 %] [% 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 %])</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-small toggler" id="save_quick_add" name="save"><i class="fa fa-save"></i> Save</button>
215     [% END %]
216     <button class="btn btn-small toggler" id="saverecord" name="save" ><i class="fa fa-save"></i> Save</button>
217     [% IF opadd %]
218         <a class="btn btn-small" href="/cgi-bin/koha/members/member.pl" class="toggler save_entryform">
219     [% ELSE %]
220         <a class="btn btn-small" 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 %][% 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 %][% 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 %][% 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">Female </label><input type="radio" name="sex" id="sex-female" value="F" checked="checked"  />
360                 [% ELSE %]
361                     <label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F" />
362                 [% END %]
363                 [% IF ( male ) %]
364                     <label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" checked="checked" />
365                 [% ELSE %]
366                     <label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" />
367                 [% END %]
368                 [% IF ( none ) %]
369                     <label for="sex-none">None specified </label><input type="radio" name="sex" id="sex-none" value=""  checked="checked"  />
370                 [% ELSE %]
371                     <label for="sex-none">None specified </label><input type="radio" name="sex" id="sex-none" value="" />
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 %]" />
407                     [% ELSE %]
408                     <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" />
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 %]" />
426      [% ELSE %]
427         <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" />
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 %]" />
437      [% ELSE %]
438         <input name="contactfirstname" id="contactfirstname" type="text" size="20" value="[% contactfirstname %]" />
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 %]" />
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 %]" />
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 %]" />
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 %]" />
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 %]" />
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 %]" />
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   <fieldset class="rows" id="memberentry_library_management">
600     <legend id="library_management_lgd">Library management</legend><ol>
601       [% UNLESS nocardnumber %]
602         <li>
603           [% IF ( mandatorycardnumber ) %]
604             <label for="cardnumber" class="required">
605           [% ELSE %]
606             <label for="cardnumber" class="validated">
607           [% END %]
608           Card number: </label>
609           [% IF minlength_cardnumber == maxlength_cardnumber %]
610                 <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" minlength="[% minlength_cardnumber %]" maxlength="[% maxlength_cardnumber %]" />
611                 [% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]
612                 <div class="hint">Card number must be exactly [% minlength_cardnumber %] characters.</div>
613           [% ELSIF minlength_cardnumber && maxlength_cardnumber %]
614                 <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" minlength="[% minlength_cardnumber %]" maxlength="[% maxlength_cardnumber %]" />
615                 [% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]
616                 <div class="hint">Card number must be between [% minlength_cardnumber %] and [% maxlength_cardnumber %] characters.</div>
617           [% ELSIF maxlength_cardnumber %]
618                 <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" maxlength="[% maxlength_cardnumber %]" />
619                 [% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]
620                 <div class="hint">Card number can be up to [% maxlength_cardnumber %] characters.</div>
621           [% ELSE %]
622                 <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" />
623                 [% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]
624                 <div class="hint">There is no minimum or maximum character length.</div>
625           [% END %]
626         </li>
627       [% END %]
628       [% UNLESS nobranchcode %]
629     <li>
630         <label for="libraries" class="required">Library:</label>
631         <select name="branchcode" size="1" id="libraries">
632             [% PROCESS options_for_libraries libraries => Branches.all( selected => userbranch ) %]
633         </select>
634         <span class="required">Required</span>
635     </li>
636         [% END %]
637     <li>
638         <label for="categorycode_entry" class="required">Category: </label>
639         <select id="categorycode_entry" name="categorycode" onchange="update_category_code(this);">
640         [% FOREACH typeloo IN typeloop %]
641             [% FOREACH categoryloo IN typeloo.categoryloop %]
642                 [% IF ( loop.first ) %]
643                     [% IF ( typeloo.typename_C ) %]<optgroup label="Child">[% END %]
644                     [% IF ( typeloo.typename_A ) %]<optgroup label="Adult">[% END %]
645                     [% IF ( typeloo.typename_S ) %]<optgroup label="Staff">[% END %]
646                     [% IF ( typeloo.typename_I ) %]<optgroup label="Organization">[% END %]
647                     [% IF ( typeloo.typename_P ) %]<optgroup label="Professional">[% END %]
648                     [% IF ( typeloo.typename_X ) %]<optgroup label="Statistical">[% END %]
649                 [% END %]
650                 [% IF ( categoryloo.categorycodeselected ) %]
651                     <option value="[% categoryloo.categorycode %]" selected="selected" data-typename="[% typeloo.typename %]">[% categoryloo.categoryname %]</option>
652                 [% ELSE %]
653                     <option value="[% categoryloo.categorycode %]" data-typename="[% typeloo.typename %]">[% categoryloo.categoryname %]</option>
654                 [% END %]
655                 [% IF ( loop.last ) %]
656                     </optgroup>
657                 [% END %]
658             [% END %]
659        [% END %]
660        </select>
661        <span class="required">Required</span>
662     </li>
663         [% UNLESS nosort1 %]
664     <li>
665       [% IF ( mandatorysort1 ) %]
666         <label for="sort1" class="required">
667       [% ELSE %]
668         <label for="sort1">
669       [% END %]
670       Sort 1: </label>
671       [% PROCESS 'av-build-dropbox.inc' name="sort1", category="Bsort1", default=sort1, size = 20 %]
672       [% IF ( mandatorysort1 ) %]<span class="required">Required</span>[% END %]
673     </li>
674         [% END %]
675         [% UNLESS nosort2 %]
676     <li>
677     [% IF ( mandatorysort2 ) %]
678     <label for="sort2" class="required">
679     [% ELSE %]
680     <label for="sort2">
681     [% END %]
682     Sort 2: </label>
683     [% PROCESS 'av-build-dropbox.inc' name="sort2", category="Bsort2", default=sort2, size = 20 %]
684     [% IF ( mandatorysort2 ) %]<span class="required">Required</span>[% END %]
685     </li>
686         [% END %]
687     [% IF ( Koha.Preference( 'NorwegianPatronDBEnable' ) == 1 ) %]
688         <li>
689             <label for="sort2">Sync with the Norwegian national patron database:</label>
690             [% IF ( sync == 0 ) %]
691                 <input type="radio" id="sync" name="sync" value="1"> Yes
692                 <input type="radio" id="sync" name="sync" value="0" checked> No
693             [% ELSE %]
694                 <input type="radio" id="sync" name="sync" value="1" checked> Yes
695                 <input type="radio" id="sync" name="sync" value="0"> No
696             [% END %]
697         </li>
698     [% END %]
699     [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
700       <li><label for="checkprevcheckout">Check for previous checkouts: </label>
701         <select name="checkprevcheckout" id="checkprevcheckout">
702         [% IF ( checkprevcheckout == 'yes' ) %]
703           <option value="yes" selected="selected">Yes if settings allow it</option>
704           <option value="no">No if settings allow it</option>
705           <option value="inherit">Inherit from settings</option>
706         [% ELSIF ( checkprevcheckout == 'no' ) %]
707           <option value="yes">Yes if settings allow it</option>
708           <option value="no" selected="selected">No if settings allow it</option>
709           <option value="inherit">Inherit from settings</option>
710         [% ELSE %]
711           <option value="yes">Yes if settings allow it</option>
712           <option value="no">No if settings allow it</option>
713           <option value="inherit" selected="selected">Inherit from settings</option>
714         [% END %]
715         </select>
716        </li>
717      [% END %]
718    </ol>
719   </fieldset>
720     [% UNLESS nodateenrolled &&  noopacnote && noborrowernotes %]
721         <fieldset class="rows" id="memberentry_subscription">
722         <legend id="library_setup_lgd">Library set-up</legend><ol>
723         [% UNLESS nodateenrolled %]
724                 <li>
725                         [% IF ( mandatorydateenrolled ) %]
726             <label for="from" class="required">
727                         [% ELSE %]
728             <label for="from">
729                         [% END %]
730                         Registration date: </label>
731             [% IF ( dateformat == "metric" ) %]
732                 <input type="text" id="from" name="dateenrolled"  maxlength="10" size="10" onchange="CheckDate(document.form.dateenrolled);check_manip_date('verify');" value="[% dateenrolled %]" class="datepickerfrom" />
733             [% ELSE %]
734                 <input type="text" id="from" name="dateenrolled"  maxlength="10" size="10" value="[% dateenrolled %]" class="datepickerfrom" />
735             [% END %]
736                 [% IF ( mandatorydateenrolled ) %]<span class="required">Required</span>[% END %]
737                 [% IF ( ERROR_dateenrolled ) %]<span class="required">(Error)</span>[% END %]
738                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
739                 </li>
740         [% END %]
741         [% UNLESS nodateexpiry %]
742                 <li>
743         [% ELSE %]
744                 <li style="display:none">
745         [% END %]
746                         [% IF ( mandatorydateexpiry ) %]
747             <label for="to" class="required">
748                         [% ELSE %]
749             <label for="to">
750                         [% END %]
751                         Expiry date (leave blank for auto calc): </label>
752             [% IF ( dateformat == "metric" ) %]
753                                 [% UNLESS ( opadd ) %]
754                     <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" />
755                                 [% ELSE %]
756                     <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');" class="datepickerto" />
757                                 [% END %]
758                         [% ELSE %]
759                                 [% UNLESS ( opadd ) %]
760                 <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" value="[% UNLESS opduplicate %][% dateexpiry %][% END %]" class="datepickerto" />
761                                 [% ELSE %]
762                 <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" class="datepickerto" />
763                                 [% END %]
764                         [% END %]
765                 [% IF ( mandatorydateexpiry ) %]<span class="required">Required</span>[% END %]
766                 [% IF ( ERROR_dateexpiry ) %]<span class="required">(Error)</span>[% END %]
767                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
768                 </li>
769         [% UNLESS noopacnote %]
770                 <li>
771                         [% IF ( mandatoryopacnote ) %]
772                                 <label for="opacnote" class="required">
773                         [% ELSE %]
774                                 <label for="opacnote">
775             [% END %]
776                         OPAC note: </label>
777             <textarea id="opacnote" name="opacnote" cols="55" rows="5">[% UNLESS opduplicate %][% opacnote %][% END %]</textarea>
778                         <div class="hint">This message appears on this patron's user page in the OPAC</div>
779           [% IF ( mandatoryopacnote ) %]<span class="required">Required</span>[% END %]
780                 </li>
781         [% END %]
782         [% UNLESS noborrowernotes %]
783                 <li>
784             [% IF ( mandatoryborrowernotes ) %]
785                                 <label for="borrowernotes" class="required">
786                         [% ELSE %]
787                                 <label for="borrowernotes">
788                         [% END %]
789                         Circulation note: </label>
790             <textarea id="borrowernotes" name="borrowernotes" cols="55" rows="5">[% UNLESS opduplicate %][% borrowernotes %][% END %]</textarea>
791                         <div class="hint">This message displays when checking out to this patron</div>
792           [% IF ( mandatoryborrowernotes ) %]<span class="required">Required</span>[% END %]
793                 </li>
794         [% END %]
795                 </ol>
796         </fieldset>
797     [% END # hide fieldset %]
798
799     [% UNLESS nouserid && nopassword %]
800         <fieldset class="rows" id="memberentry_userid">
801         <legend id="opac_staff_login_lgd">OPAC/Staff login</legend><ol>
802         [% UNLESS nouserid %]
803                 <li>
804                         [% IF ( mandatoryuserid ) %]
805                         <label for="userid" class="required">
806                         [% ELSE %]
807                         <label for="userid">
808                         [% END %]
809                         Username: </label>
810
811 [% IF ( NoUpdateLogin ) %]
812         [% IF ( opduplicate ) %]
813                 <input type="text" id="userid" name="userid" size="20" disabled="disabled" />
814         [% ELSE %]
815                 <input type="text" id="userid" name="userid" size="20" disabled="disabled" value="[% userid %]" />
816         [% END %]
817 [% ELSE %]
818         [% IF ( opduplicate ) %]
819                 <input type="text" id="userid" name="userid" size="20" value="" />
820         [% ELSE %]
821                 <input type="text" id="userid" name="userid" size="20" value="[% userid %]" />
822         [% END %]
823 [% END %]
824
825 [%# Dummy input to avoid Firefox from using userid/password saved for authentication %]
826 <input type="text" disabled="disabled" style="display:none" />
827
828           [% IF ( mandatoryuserid ) %]<span class="required">Required</span>[% END %]
829                 </li>
830         [%END %]
831         [% UNLESS nopassword %]
832                 <li>
833                         [% IF ( mandatorypassword ) %]
834                         <label for="password" class="required">
835                         [% ELSE %]
836                         <label for="password">
837                         [% END %]
838                         Password: </label>
839                         [% IF ( opadd ) %]
840                         [% IF ( NoUpdateLogin ) %]
841                                 [% IF ( opduplicate ) %]
842                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" />
843                                 [% ELSE %]
844                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" value="[% password %]" />
845                                 [% END %]
846 [% ELSE %]
847                                 [% IF ( opduplicate ) %]
848                                         <input type="password" id="password" name="password" size="20" />
849                                 [% ELSE %]
850                                         <input type="password" id="password" name="password" size="20" value="[% password %]" />
851                                 [% END %]
852 [% END %]
853                         [% ELSE %]
854                         [% IF ( password ) %]
855                                 [% IF ( NoUpdateLogin ) %]
856                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" value="****" />
857                                 [% ELSE %]
858                                         [% IF ( opduplicate ) %]
859                                                 <input type="password" id="password" name="password" size="20" />
860                                         [% ELSE %]
861                                                 <input type="password" id="password" name="password" size="20" value="****" />
862                                         [% END %]
863                                 [% END %]
864                         [% ELSE %]
865                                 [% IF ( NoUpdateLogin ) %]
866                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" value="" />
867                                 [% ELSE %]
868                                         <input type="password" id="password" name="password" size="20" value="" />
869                                 [% END %]
870                         [% END %]
871                         [% END %]
872           [% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %][% IF ( ERROR_short_password ) %]<span class="required">Password is too short</span>[% END %]
873 [% IF ( minPasswordLength ) %]<div class="hint">Minimum password length: [% minPasswordLength %]</div>[% END %]
874                 </li>
875                 <li>
876                         [% IF ( mandatorypassword ) %]
877                         <label for="password2" class="required">
878                         [% ELSE %]
879                         <label for="password2">
880                         [% END %]
881                         Confirm password: </label>
882                         [% IF ( opadd ) %]
883                         [% IF ( NoUpdateLogin ) %]
884                                 [% IF ( opduplicate ) %]
885                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" />
886                                 [% ELSE %]
887                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" value="[% password %]" />
888                                 [% END %]
889 [% ELSE %]
890                                 [% IF ( opduplicate ) %]
891                                         <input type="password" id="password2" name="password2" size="20" />
892                                 [% ELSE %]
893                                         <input type="password" id="password2" name="password2" size="20" value="[% password %]" />
894                                 [% END %]
895 [% END %]
896                         [% ELSE %]
897                         [% IF ( password ) %]
898                                 [% IF ( NoUpdateLogin ) %]
899                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" value="****" />
900                                 [% ELSE %]
901                                         [% IF ( opduplicate ) %]
902                                                 <input type="password" id="password2" name="password2" size="20" />
903                                         [% ELSE %]
904                                                 <input type="password" id="password2" name="password2" size="20" value="****" />
905                                         [% END %]
906                                 [% END %]
907                         [% ELSE %]
908                                 [% IF ( NoUpdateLogin ) %]
909                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" value="" />
910                                 [% ELSE %]
911                                         <input type="password" id="password2" name="password2" size="20" value="" />
912                                 [% END %]
913                         [% END %]
914                         [% END %]
915           [% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %][% IF ( ERROR_password_mismatch ) %]<span class="required">Passwords do not match</span>[% END %]
916                 </li>
917                 </ol>
918                 </fieldset>
919         [% END # hide fieldset %][% END %]
920                 <!--this zones are not necessary in modif mode -->
921         [% UNLESS ( opadd || opduplicate ) %]
922         <fieldset class="rows" id="memberentry_account_flags">
923             <legend id="account_flags_lgd">Patron account flags</legend>
924                         <ol class="radio">
925                         [% FOREACH flagloo IN flagloop %]
926                                 <li><label class="radio" for="yes[% flagloo.name %]">
927                 [% IF ( flagloo.key == 'gonenoaddress' ) %]Gone no address:[% END %]
928                 [% IF ( flagloo.key == 'lost' ) %]Lost card:[% END %]
929                 </label>
930                 [% IF CAN_user_circulate_manage_restrictions %]
931                                 <label for="yes[% flagloo.name %]">Yes </label>
932                                 [% IF ( flagloo.yes ) %]
933                                 <input type="radio" id="yes[% flagloo.name %]" name="[% flagloo.name %]" value="1" checked="checked" />
934                                 [% ELSE %]
935                                 <input type="radio" id="yes[% flagloo.name %]" name="[% flagloo.name %]" value="1" />
936                                 [% END %]
937                                 <label for="no[% flagloo.name %]">No </label>
938                                 [% IF ( flagloo.no ) %]
939                                 <input type="radio" id="no[% flagloo.name %]" name="[% flagloo.name %]" value="0" checked="checked"/>
940                                 [% ELSE %]
941                                 <input type="radio" id="no[% flagloo.name %]" name="[% flagloo.name %]" value="0" />
942                                 [% END %]
943                 [% ELSE %]
944                   [% IF flagloo.yes %]Yes[% ELSE %]No[% END %]
945                 [% END %]
946
947             </li>
948                         [% END %]
949
950                         </ol>
951                         </fieldset>
952
953               <fieldset class="rows" id="memberentry_restrictions">
954                 <legend id="restrictions_lgd">Patron restrictions</legend>
955
956                 [% IF ( debarments ) %]
957                     <table>
958                         <thead>
959                             <tr>
960                                  <th>Type</th>
961                                  <th>Comment</th>
962                                  <th>Expiration</th>
963                                  [% IF CAN_user_borrowers && CAN_user_circulate_manage_restrictions %]
964                                    <th>Remove?</th>
965                                  [% END %]
966                             </tr>
967                         </thead>
968
969                         <tbody>
970                             [% FOREACH d IN debarments %]
971                                 <tr>
972                                     <td>[% d.type %]</td>
973                                     <td>
974                                     [% IF d.comment.search('OVERDUES_PROCESS') %]
975                                         Restriction added by overdues process [% d.comment.remove('OVERDUES_PROCESS ') %]
976                                     [% ELSE %]
977                                         [% d.comment %]
978                                     [% END %]
979                                     </td>
980                                     <td>[% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] <i>Indefinite</i> [% END %]</td>
981                                     [% IF CAN_user_borrowers && CAN_user_circulate_manage_restrictions %]
982                                       <td>
983                                         <input type="checkbox" id="debarment_[% d.borrower_debarment_id %]" name="remove_debarment" value="[% d.borrower_debarment_id %]" />
984                                       </td>
985                                     [% END %]
986                                 </tr>
987                             [% END %]
988                         </tbody>
989                     </table>
990                 [% ELSE %]
991                     <p>Patron is currently unrestricted.</p>
992                 [% END %]
993
994                 [% IF CAN_user_borrowers && CAN_user_circulate_manage_restrictions %]
995                     <p><a href="#" id="add_manual_restriction">Add manual restriction</a></p>
996                     <fieldset id="manual_restriction_form">
997                         <input type="hidden" id="add_debarment" name="add_debarment" value="0" />
998                         <legend id="manual_restriction_lgd">Add manual restriction</legend>
999                         <ol>
1000                             <li><label for="debarred_comment">Comment: </label><input type="text" id="debarred_comment" name="debarred_comment" onchange="$('#add_debarment').val(1);" /></li>
1001                             <li><label for="debarred_expiration">Expiration: </label><input name="debarred_expiration" id="debarred_expiration" size="10" value="" class="datepicker" onchange="$('#add_debarment').val(1);" />
1002                                     <a href='javascript:void(0)' onclick="$('#debarred_expiration').val('');">Clear date</a></li>
1003
1004                         </ol>
1005                         <p>
1006                             <a class="cancel" id="cancel_manual_restriction" href="#">Cancel</a>
1007                         </p>
1008                     </fieldset>
1009                 [% END %]
1010             </fieldset>
1011                 [% END %]
1012
1013 [% END %]
1014
1015 [% IF ( step_4 ) %][% IF ( ExtendedPatronAttributes ) %][% UNLESS ( no_patron_attribute_types ) %]
1016   <fieldset class="rows" id="memberentry_patron_attributes">
1017     <legend id="patron_attributes_lgd">Additional attributes and identifiers</legend>
1018     <input type="hidden" name="setting_extended_patron_attributes" value="1" />
1019     [% FOREACH pa_loo IN patron_attributes %]
1020         [% IF pa_loo.class %]
1021             <fieldset id="aai_[% pa_loo.class %]">
1022             <legend id="[% pa_loo.class %]_lgd">[% pa_loo.lib %]</legend>
1023         [% END %]
1024         <ol class="attributes_table">
1025             [% FOREACH patron_attribute IN pa_loo.items %]
1026                 <li data-category_code="[% patron_attribute.category_code %]">
1027                     <label for="[% patron_attribute.form_id %]">[% patron_attribute.description %]: </label>
1028                         <input type="hidden" id="[% patron_attribute.form_id %]_code" name="[% patron_attribute.form_id %]_code" value="[% patron_attribute.code |html %]" />
1029                         [% IF ( patron_attribute.use_dropdown ) %]
1030                             <select id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]">
1031                                 <option value=""></option>
1032                                 [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
1033                                     [% IF auth_val_loo.authorised_value == patron_attribute.value %]
1034                                         <option value="[% auth_val_loo.authorised_value %]" selected="selected">
1035                                             [% auth_val_loo.lib %]
1036                                         </option>
1037                                     [% ELSE %]
1038                                         <option value="[% auth_val_loo.authorised_value %]" >
1039                                             [% auth_val_loo.lib %]
1040                                         </option>
1041                                     [% END %]
1042                                 [% END %]
1043                             </select>
1044                         [% ELSE %]
1045                             <textarea rows="2" cols="30" id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]">[% patron_attribute.value %]</textarea>
1046                         [% END %]
1047                         <a href="#" onclick="clear_entry(this); return false;"><i class="fa fa-fw fa-trash"></i> Clear</a>
1048                         [% IF ( patron_attribute.repeatable ) %]
1049                         <a href="#" onclick="clone_entry(this); return false;"><i class="fa fa-fw fa-plus"></i> New</a>
1050                         [% END %]
1051                 </li>
1052             [% END %]
1053         </ol>
1054         [% IF pa_loo.class %]</fieldset>[% END %]
1055     [% END %]
1056   </fieldset>
1057 [% END %][% END %][% END %]
1058
1059 [% IF ( step_5 ) %][% IF ( EnhancedMessagingPreferences ) %]
1060   <fieldset class="rows" id="memberentry_messaging_prefs">
1061     <legend id="patron_messaging_prefs_lgd">Patron messaging preferences</legend>
1062     [% IF ( opadd ) %]
1063     <!-- handle changing prefs if creating new patron and changing
1064          the patron category
1065     -->
1066     <script type="text/javascript">//<![CDATA[
1067        $(document).ready(function(){
1068             var message_prefs_dirty = false;
1069             $('#memberentry_messaging_prefs > *').change(function() {
1070                 message_prefs_dirty = true;
1071             });
1072             $('#categorycode_entry').change(function() {
1073                 var categorycode = $(this).val();
1074                 if (message_prefs_dirty) {
1075                     if (!confirm(_("Change messaging preferences to default for this category?"))) {
1076                         return;
1077                     }
1078                 }
1079                 $.getJSON('/cgi-bin/koha/members/default_messageprefs.pl?categorycode=' + categorycode,
1080                     function(data) {
1081                         $.each(data.messaging_preferences, function(i, item) {
1082                             var attrid = item.message_attribute_id;
1083                             var transports = ['email', 'rss', 'sms'];
1084                             $.each(transports, function(j, transport) {
1085                                 if (item['transports_' + transport] == 1) {
1086                                     $('#' + transport + attrid).prop('checked', true);
1087                                 } else {
1088                                     $('#' + transport + attrid).prop('checked', false);
1089                                 }
1090                             });
1091                             if (item.digest && item.digest != ' ') {
1092                                 $('#digest' + attrid).prop('checked', true);
1093                             } else {
1094                                 $('#digest' + attrid).prop('checked', false);
1095                             }
1096                             if (item.takes_days == '1') {
1097                                 $('[name=' + attrid + '-DAYS]').val('' + item.days_in_advance);
1098                             }
1099                         });
1100                         message_prefs_dirty = false;
1101                     }
1102                 );
1103             });
1104         });
1105     //]]>
1106     </script>
1107     [% END %]
1108     <input type="hidden" name="setting_messaging_prefs" value="1" />
1109     [% INCLUDE 'messaging-preference-form.inc' %]
1110     [% IF ( SMSSendDriver ) %]
1111         <p><label for="SMSnumber">SMS number:</label>
1112             <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]" />
1113         </p>
1114         <p>
1115             <label for="sms_provider_id">SMS provider:</label>
1116             <select id="sms_provider_id" name="sms_provider_id"/>
1117                 <option value="">Unknown</option>
1118                 [% FOREACH s IN sms_providers %]
1119                     [% IF s.id == sms_provider_id %]
1120                         <option value="[% s.id %]" selected="selected">[% s.name %]</option>
1121                     [% ELSE %]
1122                         <option value="[% s.id %]">[% s.name %]</option>
1123                     [% END %]
1124                 [% END %]
1125             </select>
1126         </p>
1127     [% END %]
1128   </fieldset>
1129 [% END %] [% END %]
1130
1131 </form>
1132
1133 [% IF quickadd && opadd  && !check_member %]
1134     <form id="quick_add_form" class="toggler">
1135         <fieldset class="rows quick_add"><legend>Quick add</legend>
1136             <ol id="quick_add_list">
1137             </ol>
1138         </fieldset>
1139     </form>
1140     <script>
1141         $(document).ready(function () {
1142             $("#entryform,#saverecord").hide();
1143             [% q_add_f = Koha.Preference('PatronQuickAddFields').split('\|') %]
1144             var qaddfields = [[% FOREACH field IN q_add_f.unique %]"[% field %]",[% END %]];
1145             var skipped_fields = ["contactname","contactfirstname","relationship"]; //Guarantor form is pulled as a whole, ignore individual fields
1146             $("#entryform label").each(function () {
1147                 var input_label = $(this).attr('for');
1148                 if ( input_label == 'sex-female' ) {
1149                     input_label='sex';
1150                 }
1151                 else if ( input_label == 'btitle' ) {
1152                     input_label='title';
1153                 }
1154                 if ( skipped_fields.indexOf( input_label ) != -1 ) { input_label=""; }
1155                 if( qaddfields.indexOf( input_label ) != -1 || $(this).attr('class') == 'required' ){
1156                    $(this).parent().clone().appendTo("#quick_add_list");
1157                    if( input_label == 'password') $("#entryform label[for='password2']").parent().clone().appendTo("#quick_add_list");
1158                 }
1159             });
1160                 if( $("#memberentry_guarantor").length ) {
1161                     $("#memberentry_guarantor").clone().appendTo("#quick_add_list").css("margin",0);
1162                 }
1163             $("#quick_add_form").show();
1164         });
1165     </script>
1166 [% END %]
1167 </div>
1168 </div>
1169
1170 [% UNLESS ( opadd ) %]<div class="yui-b">
1171 [% INCLUDE 'members-menu.inc' %]
1172 </div>[% END %]
1173 [% END %]
1174 </div>
1175 [% INCLUDE 'intranet-bottom.inc' %]
1176