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