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