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