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