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