Bug 3766: Cities/Towns only on one address
[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     [% IF Koha.Preference( 'AddressFormat' ) %]
429         [% INCLUDE "member-main-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
430     [% END %]
431 [% END # nostreet && nocity etc group%]
432
433 [% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %]
434   <fieldset class="rows" id="memberentry_contact">
435     <legend id="contact_lgd">Contact</legend><ol>
436         [% UNLESS nophone %]
437       <li>
438       [% IF ( mandatoryphone ) %]
439       <label for="phone" class="required">
440       [% ELSE %]
441       <label for="phone">
442       [% END %]
443       Primary phone: </label>
444         <input type="text" id="phone" name="phone" value="[% phone | html %]" />
445           [% IF ( mandatoryphone ) %]<span class="required">Required</span>[% END %]<div class="hint">Shows on transit slips</div>
446
447     </li>
448         [% END %]
449         [% UNLESS nophonepro %]
450     <li>
451       [% IF ( mandatoryphonepro ) %]
452       <label for="phonepro" class="required">
453       [% ELSE %]
454       <label for="phonepro">
455       [% END %]
456       Secondary phone: </label>
457     <input type="text" id="phonepro" name="phonepro" value="[% phonepro | html %]" />
458           [% IF ( mandatoryphonepro ) %]<span class="required">Required</span>[% END %]
459     </li>
460         [% END %]
461         [% UNLESS nomobile %]
462     <li>
463       [% IF ( mandatorymobile ) %]
464       <label for="mobile" class="required">
465       [% ELSE %]
466       <label for="mobile">
467       [% END %]
468       Other phone: </label>
469         <input type="text" id="mobile" name="mobile" value="[% mobile | html %]" />
470           [% IF ( mandatorymobile ) %]<span class="required">Required</span>[% END %]
471     </li>
472         [% END %]
473         [% UNLESS noemail %]
474     <li>
475       [% IF ( mandatoryemail ) %]
476       <label for="email" class="required">
477       [% ELSE %]
478       <label for="email">
479       [% END %]
480       Primary email: </label>
481         <input type="text" id="email" name="email" size="45" value="[% email | html %]" />
482           [% IF ( mandatoryemail ) %]<span class="required">Required</span>[% END %]<div class="hint">Shows on transit slips</div>
483
484     </li>
485         [% END %]
486         [% UNLESS noemailpro %]
487     <li>
488       [% IF ( mandatoryemailpro ) %]
489       <label for="emailpro" class="required">
490       [% ELSE %]
491       <label for="emailpro">
492       [% END %]
493       Secondary email: </label>
494         <input type="text" id="emailpro" name="emailpro" size="45" value="[% emailpro | html %]" />
495           [% IF ( mandatoryemailpro ) %]<span class="required">Required</span>[% END %]
496     </li>
497         [% END %]
498         [% UNLESS nofax %]
499     <li>
500       [% IF ( mandatoryfax ) %]
501       <label for="fax" class="required">
502       [% ELSE %]
503       <label for="fax">
504       [% END %]
505       Fax: </label>
506         <input type="text" id="fax" name="fax" value="[% fax | html %]" />
507           [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %]
508     </li>
509         [% END %]
510         </ol>
511   </fieldset>
512 [%END # hide fieldset %]
513
514 <!-- ************************ STEP_1 *********************** -->
515 [% END %]
516 [% IF ( step_6 ) %]
517
518     [% UNLESS noB_address && noB_address2 && noB_city && noB_zipcode && noB_state && noB_country &&nocontactnote && noB_phone && noB_email %]
519     [% SWITCH Koha.Preference( 'AddressFormat' ) %]
520         [% CASE 'de' %]
521             [% INCLUDE 'member-alt-address-style-de.inc' %]
522         [% CASE # us %]
523             [% INCLUDE 'member-alt-address-style-us.inc' %]
524      [% END %]
525
526     [% END # UNLESS noB_address && noB_city && noB_state && noB_phone && noB_email %]
527 [% END %]
528 [% IF ( step_2 ) %]
529     [% UNLESS noaltcontactsurname && noaltcontactfirstname && noaltcontactaddress1 && noaltcontactaddress2 && noaltcontactaddress3 && noaltcontactstate && noaltcontactzipcode && noaltcontactcountry && noaltcontactphone %]
530     [% SWITCH Koha.Preference( 'AddressFormat' ) %]
531         [% CASE 'de' %]
532             [% INCLUDE 'member-alt-contact-style-de.inc' %]
533         [% CASE # us %]
534             [% INCLUDE 'member-alt-contact-style-us.inc' %]
535      [% END %]
536     [% END # UNLESS noaltcontactsurname && noaltcontactfirstname etc %]
537
538 [% END %]
539 [% IF ( step_3 ) %]
540
541   [% SET autoMemberNum = Koha.Preference('autoMemberNum') %]
542   <fieldset class="rows" id="memberentry_library_management">
543     <legend id="library_management_lgd">Library management</legend><ol>
544       [% UNLESS nocardnumber %]
545         <li>
546           [% IF mandatorycardnumber %]
547             <label for="cardnumber" class="required">
548           [% ELSE %]
549             <label for="cardnumber" class="validated">
550           [% END %]
551             Card number: </label>
552
553           <!-- NOTE: div.hint closing tag isn't on the same line -->
554           [% IF minlength_cardnumber == maxlength_cardnumber %]
555                 <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber | html %]" minlength="[% minlength_cardnumber | html %]" maxlength="[% maxlength_cardnumber | html %]" />
556                 [% 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>
557                 <div class="hint">Card number must be exactly [% minlength_cardnumber | html %] characters.
558           [% ELSIF minlength_cardnumber && maxlength_cardnumber %]
559                 <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber | html %]" minlength="[% minlength_cardnumber | html %]" maxlength="[% maxlength_cardnumber | html %]" />
560                 [% 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>
561                 <div class="hint">Card number must be between [% minlength_cardnumber | html %] and [% maxlength_cardnumber | html %] characters.
562           [% ELSIF maxlength_cardnumber %]
563                 <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber | html %]" maxlength="[% maxlength_cardnumber | html %]" />
564                 [% 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>
565                 <div class="hint">Card number can be up to [% maxlength_cardnumber | html %] characters.
566           [% ELSE %]
567                 <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber | html %]" />
568                 [% IF mandatorycardnumber %]<span class="required">Required</span>[% END %]
569                 <div class="hint">There is no minimum or maximum character length.
570           [% END %]
571           [% IF autoMemberNum %]
572                 [% IF mandatorycardnumber %]
573                     <br/><span class="error">AutoMemberNum is set to enabled, but cardnumber is marked as mandatory in BorrowerMandatoryField: auto calc has been disabled.</span>
574                 [% ELSE %]
575                     <br/>Leave blank for auto calc during registration
576                 [% END %]
577           [% END %]
578                 </div><!--/hint div -->
579         </li>
580       [% END %]
581       [% UNLESS nobranchcode %]
582     <li>
583         <label for="libraries" class="required">Library:</label>
584         <select name="branchcode" size="1" id="libraries">
585             [% PROCESS options_for_libraries libraries => Branches.all( selected => userbranch, only_from_group => 1 ) %]
586         </select>
587         <span class="required">Required</span>
588     </li>
589         [% END %]
590     <li>
591         <label for="categorycode_entry" class="required">Category: </label>
592         <select id="categorycode_entry" name="categorycode" onchange="update_category_code(this);">
593         [% FOREACH typeloo IN typeloop %]
594             [% FOREACH categoryloo IN typeloo.categoryloop %]
595                 [% IF ( loop.first ) %]
596                     [% IF ( typeloo.typename_C ) %]<optgroup label="Child">[% END %]
597                     [% IF ( typeloo.typename_A ) %]<optgroup label="Adult">[% END %]
598                     [% IF ( typeloo.typename_S ) %]<optgroup label="Staff">[% END %]
599                     [% IF ( typeloo.typename_I ) %]<optgroup label="Organization">[% END %]
600                     [% IF ( typeloo.typename_P ) %]<optgroup label="Professional">[% END %]
601                     [% IF ( typeloo.typename_X ) %]<optgroup label="Statistical">[% END %]
602                 [% END %]
603                 [% IF ( categoryloo.categorycodeselected ) %]
604                     <option value="[% categoryloo.categorycode | html %]" selected="selected" data-typename="[% typeloo.typename | html %]">[% categoryloo.categoryname | html %]</option>
605                 [% ELSE %]
606                     <option value="[% categoryloo.categorycode | html %]" data-typename="[% typeloo.typename | html %]">[% categoryloo.categoryname | html %]</option>
607                 [% END %]
608                 [% IF ( loop.last ) %]
609                     </optgroup>
610                 [% END %]
611             [% END %]
612        [% END %]
613        </select>
614        <span class="required">Required</span>
615     </li>
616         [% UNLESS nosort1 %]
617     <li>
618       [% IF ( mandatorysort1 ) %]
619         <label for="sort1" class="required">
620       [% ELSE %]
621         <label for="sort1">
622       [% END %]
623       Sort 1: </label>
624       [% PROCESS 'av-build-dropbox.inc' name="sort1", category="Bsort1", default=sort1, size = 20 %]
625       [% IF ( mandatorysort1 ) %]<span class="required">Required</span>[% END %]
626     </li>
627         [% END %]
628         [% UNLESS nosort2 %]
629     <li>
630     [% IF ( mandatorysort2 ) %]
631     <label for="sort2" class="required">
632     [% ELSE %]
633     <label for="sort2">
634     [% END %]
635     Sort 2: </label>
636     [% PROCESS 'av-build-dropbox.inc' name="sort2", category="Bsort2", default=sort2, size = 20 %]
637     [% IF ( mandatorysort2 ) %]<span class="required">Required</span>[% END %]
638     </li>
639         [% END %]
640     [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
641       <li><label for="checkprevcheckout">Check for previous checkouts: </label>
642         <select name="checkprevcheckout" id="checkprevcheckout">
643         [% IF ( checkprevcheckout == 'yes' ) %]
644           <option value="yes" selected="selected">Yes if settings allow it</option>
645           <option value="no">No if settings allow it</option>
646           <option value="inherit">Inherit from settings</option>
647         [% ELSIF ( checkprevcheckout == 'no' ) %]
648           <option value="yes">Yes if settings allow it</option>
649           <option value="no" selected="selected">No if settings allow it</option>
650           <option value="inherit">Inherit from settings</option>
651         [% ELSE %]
652           <option value="yes">Yes if settings allow it</option>
653           <option value="no">No if settings allow it</option>
654           <option value="inherit" selected="selected">Inherit from settings</option>
655         [% END %]
656         </select>
657        </li>
658      [% END %]
659     [% IF Koha.Preference('TranslateNotices') %]
660         <li>
661             <label for="lang">Preferred language for notices: </label>
662             <select id="lang" name="lang">
663                 <option value="default">Default</option>
664                 [% FOR language IN languages %]
665                     [% FOR sublanguage IN language.sublanguages_loop %]
666                         [% IF language.plural %]
667                             [% IF sublanguage.rfc4646_subtag == lang %]
668                                 <option value="[% sublanguage.rfc4646_subtag | html %]" selected="selected">[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
669                             [% ELSE %]
670                                 <option value="[% sublanguage.rfc4646_subtag | html %]">[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
671                             [% END %]
672                         [% ELSE %]
673                             [% IF sublanguage.rfc4646_subtag == lang %]
674                                 <option value="[% sublanguage.rfc4646_subtag | html %]" selected="selected">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
675                             [% ELSE %]
676                                 <option value="[% sublanguage.rfc4646_subtag | html %]">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
677                             [% END %]
678                         [% END %]
679                     [% END %]
680                 [% END %]
681             </select>
682         </li>
683     [% END %]
684    </ol>
685   </fieldset>
686     [% UNLESS nodateenrolled &&  noopacnote && noborrowernotes %]
687         <fieldset class="rows" id="memberentry_subscription">
688         <legend id="library_setup_lgd">Library set-up</legend><ol>
689         [% UNLESS nodateenrolled %]
690                 <li>
691                         [% IF ( mandatorydateenrolled ) %]
692             <label for="from" class="required">
693                         [% ELSE %]
694             <label for="from">
695                         [% END %]
696                         Registration date: </label>
697             [% IF ( dateformat == "metric" ) %]
698                 <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" />
699             [% ELSE %]
700                 <input type="text" id="from" name="dateenrolled"  maxlength="10" size="10" value="[% dateenrolled | html %]" class="datepickerfrom" />
701             [% END %]
702                 [% IF ( mandatorydateenrolled ) %]<span class="required">Required</span>[% END %]
703                 [% IF ( ERROR_dateenrolled ) %]<span class="required">(Error)</span>[% END %]
704                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
705                 </li>
706         [% END %]
707         [% UNLESS nodateexpiry %]
708                 <li>
709         [% ELSE %]
710                 <li style="display:none">
711         [% END %]
712                         [% IF ( mandatorydateexpiry ) %]
713             <label for="to" class="required">
714                         [% ELSE %]
715             <label for="to">
716                         [% END %]
717                         Expiry date (leave blank for auto calc): </label>
718             [% IF ( dateformat == "metric" ) %]
719                                 [% UNLESS ( opadd ) %]
720                     <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" />
721                                 [% ELSE %]
722                     <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');" class="datepickerto" />
723                                 [% END %]
724                         [% ELSE %]
725                                 [% UNLESS ( opadd ) %]
726                 <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" value="[% dateexpiry | html UNLESS opduplicate %]" class="datepickerto" />
727                                 [% ELSE %]
728                 <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" value="[% dateexpiry | html %]" class="datepickerto" />
729                                 [% END %]
730                         [% END %]
731                 [% IF ( mandatorydateexpiry ) %]<span class="required">Required</span>[% END %]
732                 [% IF ( ERROR_dateexpiry ) %]<span class="required">(Error)</span>[% END %]
733                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
734                 </li>
735         [% UNLESS noopacnote %]
736                 <li>
737                         [% IF ( mandatoryopacnote ) %]
738                                 <label for="opacnote" class="required">
739                         [% ELSE %]
740                                 <label for="opacnote">
741             [% END %]
742                         OPAC note: </label>
743             <textarea id="opacnote" name="opacnote" cols="55" rows="5">[% opacnote | html UNLESS opduplicate %]</textarea>
744                         <div class="hint">This message appears on this patron's user page in the OPAC</div>
745           [% IF ( mandatoryopacnote ) %]<span class="required">Required</span>[% END %]
746                 </li>
747         [% END %]
748         [% UNLESS noborrowernotes %]
749                 <li>
750             [% IF ( mandatoryborrowernotes ) %]
751                                 <label for="borrowernotes" class="required">
752                         [% ELSE %]
753                                 <label for="borrowernotes">
754                         [% END %]
755                         Circulation note: </label>
756             <textarea id="borrowernotes" name="borrowernotes" cols="55" rows="5">[% borrowernotes | html UNLESS opduplicate %]</textarea>
757                         <div class="hint">This message displays when checking out to this patron</div>
758           [% IF ( mandatoryborrowernotes ) %]<span class="required">Required</span>[% END %]
759                 </li>
760         [% END %]
761                 </ol>
762         </fieldset>
763     [% END # hide fieldset %]
764
765     [% UNLESS nouserid && nopassword %]
766         <fieldset class="rows" id="memberentry_userid">
767         <legend id="opac_staff_login_lgd">OPAC/Staff login</legend><ol>
768         [% UNLESS nouserid %]
769                 <li>
770                         [% IF ( mandatoryuserid ) %]
771                         <label for="userid" class="required">
772                         [% ELSE %]
773                         <label for="userid">
774                         [% END %]
775                         Username: </label>
776
777 [% IF ( NoUpdateLogin ) %]
778         [% IF ( opduplicate ) %]
779                 <input type="text" id="userid" name="userid" size="20" disabled="disabled" />
780         [% ELSE %]
781                 <input type="text" id="userid" name="userid" size="20" disabled="disabled" value="[% userid | html %]" />
782         [% END %]
783 [% ELSE %]
784         [% IF ( opduplicate ) %]
785                 <input type="text" id="userid" name="userid" size="20" value="" />
786         [% ELSE %]
787                 <input type="text" id="userid" name="userid" size="20" value="[% userid | html %]" />
788         [% END %]
789 [% END %]
790
791 [%# Dummy input to avoid Firefox from using userid/password saved for authentication %]
792 <input type="text" disabled="disabled" style="display:none" />
793
794           [% IF ( mandatoryuserid ) %]<span class="required">Required</span>[% END %]
795                 </li>
796         [%END %]
797         [% UNLESS nopassword %]
798                 <li>
799                         [% IF ( mandatorypassword ) %]
800                         <label for="password" class="required">
801                         [% ELSE %]
802                         <label for="password">
803                         [% END %]
804                         Password: </label>
805                         [% IF ( opadd ) %]
806                         [% IF ( NoUpdateLogin ) %]
807                                 [% IF ( opduplicate ) %]
808                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" />
809                                 [% ELSE %]
810                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" value="[% password | html %]" />
811                                 [% END %]
812 [% ELSE %]
813                                 [% IF ( opduplicate ) %]
814                                         <input type="password" id="password" name="password" size="20" />
815                                 [% ELSE %]
816                                         <input type="password" id="password" name="password" size="20" value="[% password | html %]" />
817                                 [% END %]
818 [% END %]
819                         [% ELSE %]
820                         [% IF ( password ) %]
821                                 [% IF ( NoUpdateLogin ) %]
822                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" value="****" />
823                                 [% ELSE %]
824                                         [% IF ( opduplicate ) %]
825                                                 <input type="password" id="password" name="password" size="20" />
826                                         [% ELSE %]
827                                                 <input type="password" id="password" name="password" size="20" value="****" />
828                                         [% END %]
829                                 [% END %]
830                         [% ELSE %]
831                                 [% IF ( NoUpdateLogin ) %]
832                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" value="" />
833                                 [% ELSE %]
834                                         <input type="password" id="password" name="password" size="20" value="" />
835                                 [% END %]
836                         [% END %]
837                         [% END %]
838             [% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %]
839             [% IF ( ERROR_password_too_short ) %]<span class="required">Password is too short</span>[% END %]
840             [% IF ( ERROR_password_too_weak ) %]<span class="required">Password is too weak</span>[% END %]
841             [% IF ( ERROR_password_has_whitespaces ) %]<span class="required">Password has leading or trailing whitespaces</span>[% END %]
842             <div class="hint">Minimum password length: [% minPasswordLength | html %]</div>
843                 </li>
844                 <li>
845                         [% IF ( mandatorypassword ) %]
846                         <label for="password2" class="required">
847                         [% ELSE %]
848                         <label for="password2">
849                         [% END %]
850                         Confirm password: </label>
851                         [% IF ( opadd ) %]
852                         [% IF ( NoUpdateLogin ) %]
853                                 [% IF ( opduplicate ) %]
854                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" />
855                                 [% ELSE %]
856                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" value="[% password | html %]" />
857                                 [% END %]
858 [% ELSE %]
859                                 [% IF ( opduplicate ) %]
860                                         <input type="password" id="password2" name="password2" size="20" />
861                                 [% ELSE %]
862                                         <input type="password" id="password2" name="password2" size="20" value="[% password | html %]" />
863                                 [% END %]
864 [% END %]
865                         [% ELSE %]
866                         [% IF ( password ) %]
867                                 [% IF ( NoUpdateLogin ) %]
868                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" value="****" />
869                                 [% ELSE %]
870                                         [% IF ( opduplicate ) %]
871                                                 <input type="password" id="password2" name="password2" size="20" />
872                                         [% ELSE %]
873                                                 <input type="password" id="password2" name="password2" size="20" value="****" />
874                                         [% END %]
875                                 [% END %]
876                         [% ELSE %]
877                                 [% IF ( NoUpdateLogin ) %]
878                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" value="" />
879                                 [% ELSE %]
880                                         <input type="password" id="password2" name="password2" size="20" value="" />
881                                 [% END %]
882                         [% END %]
883                         [% END %]
884           [% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %][% IF ( ERROR_password_mismatch ) %]<span class="required">Passwords do not match</span>[% END %]
885                 </li>
886                 </ol>
887                 </fieldset>
888         [% END # hide fieldset %][% END %]
889                 <!--this zones are not necessary in modif mode -->
890         [% UNLESS ( opadd || opduplicate ) %]
891         <fieldset class="rows" id="memberentry_account_flags">
892             <legend id="account_flags_lgd">Patron account flags</legend>
893                         <ol class="radio">
894                         [% FOREACH flagloo IN flagloop %]
895                                 <li><label class="radio" for="yes[% flagloo.name | html %]">
896                 [% IF ( flagloo.key == 'gonenoaddress' ) %]Gone no address:[% END %]
897                 [% IF ( flagloo.key == 'lost' ) %]Lost card:[% END %]
898                 </label>
899                 [% IF CAN_user_circulate_manage_restrictions %]
900                             <label for="yes[% flagloo.name | html %]">
901                                 [% IF ( flagloo.yes ) %]
902                                 <input type="radio" id="yes[% flagloo.name | html %]" name="[% flagloo.name | html %]" value="1" checked="checked" />
903                                 [% ELSE %]
904                                 <input type="radio" id="yes[% flagloo.name | html %]" name="[% flagloo.name | html %]" value="1" />
905                                 [% END %]
906                             Yes </label>
907                             <label for="no[% flagloo.name | html %]">
908                                 [% IF ( flagloo.no ) %]
909                                 <input type="radio" id="no[% flagloo.name | html %]" name="[% flagloo.name | html %]" value="0" checked="checked"/>
910                                 [% ELSE %]
911                                 <input type="radio" id="no[% flagloo.name | html %]" name="[% flagloo.name | html %]" value="0" />
912                                 [% END %]
913                             No </label>
914                 [% ELSE %]
915                   [% IF flagloo.yes %]Yes[% ELSE %]No[% END %]
916                 [% END %]
917
918             </li>
919                         [% END %]
920
921                         </ol>
922                         </fieldset>
923
924               <fieldset class="rows" id="memberentry_restrictions">
925                 <legend id="restrictions_lgd">Patron restrictions</legend>
926
927                 [% IF ( debarments ) %]
928                     <table>
929                         <thead>
930                             <tr>
931                                  <th>Type</th>
932                                  <th>Comment</th>
933                                  <th>Expiration</th>
934                                  <th>Created</th>
935                                  [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
936                                    <th>Remove?</th>
937                                  [% END %]
938                             </tr>
939                         </thead>
940
941                         <tbody>
942                             [% FOREACH d IN debarments %]
943                                 <tr>
944                                     <td>[% d.type | html %]</td>
945                                     <td>
946                                     [% IF d.comment.search('OVERDUES_PROCESS') %]
947                                         Restriction added by overdues process [% d.comment.remove('OVERDUES_PROCESS ') | $raw %]
948                                     [% ELSE %]
949                                         [% d.comment | $raw %]
950                                     [% END %]
951                                     </td>
952                                     <td>[% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] <i>Indefinite</i> [% END %]</td>
953                                     <td>[% d.created | $KohaDates %]</td>
954                                     [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
955                                       <td>
956                                         <input type="checkbox" id="debarment_[% d.borrower_debarment_id | html %]" name="remove_debarment" value="[% d.borrower_debarment_id | html %]" />
957                                       </td>
958                                     [% END %]
959                                 </tr>
960                             [% END %]
961                         </tbody>
962                     </table>
963                 [% ELSE %]
964                     <p>Patron is currently unrestricted.</p>
965                 [% END %]
966
967                 [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
968                     <p><a href="#" id="add_manual_restriction">Add manual restriction</a></p>
969                     <fieldset id="manual_restriction_form">
970                         <input type="hidden" id="add_debarment" name="add_debarment" value="0" />
971                         <legend id="manual_restriction_lgd">Add manual restriction</legend>
972                         <ol>
973                             <li><label for="debarred_comment">Comment: </label><input type="text" id="debarred_comment" name="debarred_comment" onchange="$('#add_debarment').val(1);" /></li>
974                             <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" />
975                                     <a href='javascript:void(0)' onclick="$('#debarred_expiration').val('');">Clear date</a></li>
976
977                         </ol>
978                         <p>
979                             <a class="cancel" id="cancel_manual_restriction" href="#">Cancel</a>
980                         </p>
981                     </fieldset>
982                 [% END %]
983             </fieldset>
984                 [% END %]
985
986 [% END %]
987
988 [% IF ( step_7 ) %]
989 [% IF Koha.Preference('HouseboundModule') %]
990   <fieldset class="rows" id="memberentry_housebound_roles">
991     <legend id="housebound_roles">Housebound roles</legend>
992     <ol class="radio">
993       <li>
994         <label class="radio" for="housebound_chooser">
995           Chooser:
996         </label>
997         [% IF ( housebound_role.housebound_chooser == 1 ) %]
998         <label for="yes_housebound_chooser">Yes </label>
999         <input type="radio" id="yes_housebound_chooser"
1000                name="housebound_chooser" value="1"
1001                checked="checked" />
1002         <label for="no_housebound_chooser">No </label>
1003         <input type="radio" id="no_housebound_chooser"
1004                name="housebound_chooser" value="0" />
1005         [% ELSE %]
1006         <label for="yes_housebound_chooser">Yes </label>
1007         <input type="radio" id="yes_housebound_chooser"
1008                name="housebound_chooser" value="1" />
1009         <label for="no_housebound_chooser">No </label>
1010         <input type="radio" id="no_housebound_chooser"
1011                name="housebound_chooser" value="0"
1012                checked="checked" />
1013         [% END %]
1014       </li>
1015       <li>
1016         <label class="radio" for="housebound_deliverer">Deliverer:</label>
1017         [% IF ( housebound_role.housebound_deliverer == 1 ) %]
1018         <label for="yes_housebound_deliverer">Yes </label>
1019         <input type="radio" id="yes_housebound_deliverer"
1020                name="housebound_deliverer" value="1"
1021                checked="checked" />
1022         <label for="no_housebound_deliverer">No </label>
1023         <input type="radio" id="no_housebound_deliverer"
1024                name="housebound_deliverer" value="0" />
1025         [% ELSE %]
1026         <label for="yes_housebound_deliverer">Yes </label>
1027         <input type="radio" id="yes_housebound_deliverer"
1028                name="housebound_deliverer" value="1" />
1029         <label for="no_housebound_deliverer">No </label>
1030         <input type="radio" id="no_housebound_deliverer"
1031                name="housebound_deliverer" value="0"
1032                checked="checked" />
1033         [% END %]
1034       </li>
1035     </ol>
1036   </fieldset>
1037 [% END # hide fieldset %]
1038 [% END # IF step_7 %]
1039
1040 [% IF ( step_4 ) %]
1041 [% IF Koha.Preference('ExtendedPatronAttributes') %][% UNLESS ( no_patron_attribute_types ) %]
1042   <fieldset class="rows" id="memberentry_patron_attributes">
1043     <legend id="patron_attributes_lgd">Additional attributes and identifiers</legend>
1044     <input type="hidden" name="setting_extended_patron_attributes" value="1" />
1045     [% FOREACH pa_loo IN patron_attributes %]
1046         <ol class="attributes_table">
1047             [% IF pa_loo.class %]
1048                 <fieldset id="aai_[% pa_loo.class | html %]">
1049                 <legend id="[% pa_loo.class | html %]_lgd">[% pa_loo.lib | html %]</legend>
1050             [% END %]
1051             [% FOREACH patron_attribute IN pa_loo.items %]
1052                 <li data-category_code="[% patron_attribute.category_code | html %]">
1053                     <label for="[% patron_attribute.form_id | html %]">[% patron_attribute.description | html %]: </label>
1054                         [% IF ( patron_attribute.use_dropdown ) %]
1055                             <select id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]">
1056                                 <option value=""></option>
1057                                 [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
1058                                     [% IF auth_val_loo.authorised_value == patron_attribute.value %]
1059                                         <option value="[% auth_val_loo.authorised_value | html %]" selected="selected">
1060                                             [% auth_val_loo.lib | html %]
1061                                         </option>
1062                                     [% ELSE %]
1063                                         <option value="[% auth_val_loo.authorised_value | html %]" >
1064                                             [% auth_val_loo.lib | html %]
1065                                         </option>
1066                                     [% END %]
1067                                 [% END %]
1068                             </select>
1069                         [% ELSE %]
1070                             <textarea rows="2" cols="30" id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]">[% patron_attribute.value | html %]</textarea>
1071                         [% END %]
1072                         <input type="hidden" id="[% patron_attribute.form_id | html %]_code" name="[% patron_attribute.form_id | html %]_code" value="[% patron_attribute.code | html %]" />
1073                         <a href="#" onclick="clear_entry(this); return false;"><i class="fa fa-fw fa-trash"></i> Clear</a>
1074                         [% IF ( patron_attribute.repeatable ) %]
1075                         <a href="#" onclick="clone_entry(this); return false;"><i class="fa fa-fw fa-plus"></i> New</a>
1076                         [% END %]
1077                 </li>
1078             [% END %]
1079             [% IF pa_loo.class %]</fieldset>[% END %]
1080         </ol>
1081     [% END %]
1082   </fieldset>
1083 [% END %][% END %][% END %]
1084
1085 [% IF ( step_5 ) %][% IF ( EnhancedMessagingPreferences ) %]
1086   <fieldset class="rows" id="memberentry_messaging_prefs">
1087     <legend id="patron_messaging_prefs_lgd">Patron messaging preferences</legend>
1088     <div id="messaging_prefs_loading" class="form-message" style="display:none">
1089         <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading new messaging defaults
1090     </div>
1091     <input type="hidden" name="setting_messaging_prefs" value="1" />
1092     [% INCLUDE 'messaging-preference-form.inc' %]
1093     [% IF ( SMSSendDriver ) %]
1094         <p><label for="SMSnumber">SMS number:</label>
1095             <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber | html %]" />
1096             <span class="hint">SMS number should be in the format 1234567890 or +11234567890</span>
1097         </p>
1098         [% UNLESS nosms_provider_id %]
1099         <p>
1100             <label for="sms_provider_id">SMS provider:</label>
1101             <select id="sms_provider_id" name="sms_provider_id">
1102                 <option value="">Unknown</option>
1103                 [% FOREACH s IN sms_providers %]
1104                     [% IF s.id == sms_provider_id %]
1105                         <option value="[% s.id | html %]" selected="selected">[% s.name | html %]</option>
1106                     [% ELSE %]
1107                         <option value="[% s.id | html %]">[% s.name | html %]</option>
1108                     [% END %]
1109                 [% END %]
1110             </select>
1111         </p>
1112         [% END %]
1113     [% END %]
1114   </fieldset>
1115 [% END %] [% END %]
1116
1117 </form>
1118
1119 [% IF quickadd && opadd  && !check_member %]
1120     <form id="quick_add_form" class="toggler">
1121         <fieldset class="rows quick_add"><legend>Quick add</legend>
1122             <ol id="quick_add_list">
1123             </ol>
1124         </fieldset>
1125     </form>
1126 [% END %]
1127
1128 [% END %]
1129             </main>
1130         </div> <!-- /.col-sm-10.col-sm-push-2 -->
1131
1132         [% UNLESS ( opadd ) %]
1133             <div class="col-sm-2 col-sm-pull-10">
1134                 <aside>
1135                     [% INCLUDE 'circ-menu.inc' %]
1136                 </aside>
1137             </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1138         [% END %]
1139      </div> <!-- /.row -->
1140
1141 [% MACRO jsinclude BLOCK %]
1142     [% Asset.js("lib/hc-sticky.js") | $raw %]
1143     [% INCLUDE 'calendar.inc' %]
1144     [% INCLUDE 'str/members-menu.inc' %]
1145     [% Asset.js("js/members-menu.js") | $raw %]
1146     <script>
1147         function update_cardnumber_warning(size){
1148             var max_len = [% maxlength_cardnumber | html %];
1149             if ( size >= max_len ) {
1150                 $("#cn_max").show();
1151             } else {
1152                 $("#cn_max").hide();
1153             }
1154         }
1155         var Sticky;
1156         $(document).ready(function() {
1157
1158                 $("#saverecord").css({ 'margin-left': 0 });
1159
1160             Sticky = $("#toolbar");
1161             Sticky.hcSticky({
1162                 stickTo: "main",
1163                 stickyClass: "floating"
1164             });
1165
1166             [% IF categorycode %]
1167                 update_category_code( "[% categorycode | html %]" );
1168             [% ELSE %]
1169                 if ( $("#categorycode_entry").length > 0 ){
1170                     var category_code = $("#categorycode_entry").find("option:selected").val();
1171                     update_category_code( category_code );
1172                 }
1173             [% END %]
1174
1175             $("#cn_max").hide();
1176             var content;
1177             $("#cardnumber").on("keydown", function(e){
1178                 content = $(this).val();
1179             });
1180             $("#cardnumber").on("keyup", function(e){
1181                 // .val() will return the value of the input after the key has been released
1182                 var l = $(this).val().length;
1183                 if ( l == content.length + 1 ) { l--; }
1184                 update_cardnumber_warning(l);
1185             });
1186             $("#cardnumber").bind("paste", function(e){
1187                 var pastedData = e.originalEvent.clipboardData.getData('text');
1188                 update_cardnumber_warning(pastedData.length - 1);
1189             } );
1190             var toggle_quick_add = $(".toggle_quick_add");
1191             $(toggle_quick_add).click(function(e){
1192                 toggle_quick_add.toggle();
1193                 e.preventDefault();
1194                 var toggle_to = '';
1195                 var toggle_from = '';
1196                 if( $("#entryform:visible").length ) {
1197                     toggle_to = "#quick_add_form label";
1198                     toggle_from = "#entryform label";
1199                 } else {
1200                     toggle_to="#entryform label";
1201                     toggle_from = "#quick_add_form label";
1202                 }
1203                 $(toggle_from).each(function() {
1204                     var input_label = $(this).attr('for');
1205                     if ( input_label == 'sex-male' || input_label == 'sex-none' || input_label == 'sex-female' ) {
1206                         $(toggle_to+"[for='"+input_label+"']").next().prop('checked', $(this).next().prop('checked') );
1207                         return;
1208                     }
1209                     $(toggle_to+"[for='"+input_label+"']").next().val(  $(this).next().val() );
1210                 });
1211
1212                 $(".toggler").toggle();
1213             });
1214
1215             $("#save_quick_add").click(function(){
1216                 $("#quick_add_form").validate();
1217                 if( $("#quick_add_form").valid()){
1218                     $('.toggle_quick_add').click();
1219                     $('#saverecord').click();
1220                 }
1221                 else {return false;}
1222             });
1223
1224             $("#saverecord").click(function(){
1225                 if( check_form_borrowers() ){
1226                     $("#entryform").submit();
1227                 }
1228             });
1229
1230             $('#duplicate').on('click', function() {
1231                 $("input[name='op']").val('modify');
1232                 $("input[name='borrowernumber']").val('[% check_member | html %]');
1233                 $("input[name='check_member']").val('');
1234                 $('#entryform').submit();
1235             });
1236
1237             $('#not-duplicate').on('click', function() {
1238                 $("input[name='nodouble']").val('1');
1239                 $('#entryform').submit();
1240             });
1241         });
1242
1243         var MSG_SEPARATOR = _("Separator must be / in field %s");
1244         var MSG_INCORRECT_DAY = _("Invalid day entered in field %s");
1245         var MSG_INCORRECT_MONTH = _("Invalid month entered in field %s");
1246         var MSG_INCORRECT_YEAR = _("Invalid year entered in field %s");
1247         var MSG_DUPLICATE_PATRON = _("Warning: Duplicate patron");
1248         var MSG_DUPLICATE_ORGANIZATION = _("Warning: Duplicate organization");
1249         var MSG_LATE_EXPIRY = _("Warning: Expiration date falls before enrollment date");
1250         var MSG_DUPLICATE_SUSPICION = _("Please confirm whether this is a duplicate patron");
1251         var MSG_MONTH = _("%s month")
1252         var MSG_MONTHS = _("%s months")
1253         var MSG_YEAR = _("%s year")
1254         var MSG_YEARS = _("%s years")
1255         var LABEL_CHANGE = _("Change");
1256         var LABEL_SET_TO_PATRON = _("Set to patron");
1257         var LABEL_AGE = _("Age");
1258         var MSG_MESSAGING_DFEAULTS = _("Change messaging preferences to default for this category?");
1259
1260         [% IF quickadd && opadd  && !check_member %]
1261             $(document).ready(function () {
1262
1263                 $("#entryform,#saverecord").hide();
1264                 [% q_add_f = Koha.Preference('PatronQuickAddFields').split('\|') %]
1265                 var qaddfields = [[% FOREACH field IN q_add_f.unique %]"[% field | html %]",[% END %]];
1266                 var skipped_fields = ["contactname","contactfirstname","relationship"]; //Guarantor form is pulled as a whole, ignore individual fields
1267                 $("#entryform label").each(function () {
1268                     var input_label = $(this).attr('for');
1269                     if ( input_label == 'sex-female' ) {
1270                         input_label='sex';
1271                     }
1272                     else if ( input_label == 'btitle' ) {
1273                         input_label='title';
1274                     }
1275                     if ( skipped_fields.indexOf( input_label ) != -1 ) { input_label=""; }
1276                     if( qaddfields.indexOf( input_label ) != -1 || $(this).attr('class') == 'required' ){
1277                        $(this).parent().clone().appendTo("#quick_add_list");
1278                        [% UNLESS mandatorypassword %]
1279                              if( input_label == 'password' ) $("#entryform label[for='password2']").parent().clone().appendTo("#quick_add_list");
1280                        [% END %]
1281                     }
1282                 });
1283                     if( $("#memberentry_guarantor").length ) {
1284                         $("#memberentry_guarantor").clone().appendTo("#quick_add_list").css("margin",0);
1285                         $("#quick_add_form #memberentry_guarantor").append("<p>" + _("Note: Quick add guarantor form populates address fields in full form") + "</p>");
1286                         $("#quick_add_list #guarantordelete").prop('id','qagd');
1287                     }
1288                 $("#qagd").click(function() { $("#guarantordelete").click(); });
1289                 $("#quick_add_form").show();
1290             });
1291         [% END %]
1292
1293     </script>
1294     [% Asset.js("js/members.js") | $raw %]
1295     [% Asset.js("js/messaging-preference-form.js") | $raw %]
1296     [% PROCESS 'password_check.inc' %]
1297     [% PROCESS 'add_password_check' new_password => 'password' %]
1298 [% END %]
1299
1300 [% INCLUDE 'intranet-bottom.inc' %]