52acc1db37488e4b343da795f1db0173a271c4d3
[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( 'NorwegianPatronDBEnable' ) == 1 ) %]
639         <li>
640             <label for="sort2">Sync with the Norwegian national patron database:</label>
641             [% IF ( sync == 0 ) %]
642                 <input type="radio" id="sync" name="sync" value="1"> Yes
643                 <input type="radio" id="sync" name="sync" value="0" checked> No
644             [% ELSE %]
645                 <input type="radio" id="sync" name="sync" value="1" checked> Yes
646                 <input type="radio" id="sync" name="sync" value="0"> No
647             [% END %]
648         </li>
649     [% END %]
650     [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
651       <li><label for="checkprevcheckout">Check for previous checkouts: </label>
652         <select name="checkprevcheckout" id="checkprevcheckout">
653         [% IF ( checkprevcheckout == 'yes' ) %]
654           <option value="yes" selected="selected">Yes if settings allow it</option>
655           <option value="no">No if settings allow it</option>
656           <option value="inherit">Inherit from settings</option>
657         [% ELSIF ( checkprevcheckout == 'no' ) %]
658           <option value="yes">Yes if settings allow it</option>
659           <option value="no" selected="selected">No if settings allow it</option>
660           <option value="inherit">Inherit from settings</option>
661         [% ELSE %]
662           <option value="yes">Yes if settings allow it</option>
663           <option value="no">No if settings allow it</option>
664           <option value="inherit" selected="selected">Inherit from settings</option>
665         [% END %]
666         </select>
667        </li>
668      [% END %]
669     [% IF Koha.Preference('TranslateNotices') %]
670         <li>
671             <label for="lang">Preferred language for notices: </label>
672             <select id="lang" name="lang">
673                 <option value="default">Default</option>
674                 [% FOR language IN languages %]
675                     [% FOR sublanguage IN language.sublanguages_loop %]
676                         [% IF language.plural %]
677                             [% IF sublanguage.rfc4646_subtag == lang %]
678                                 <option value="[% sublanguage.rfc4646_subtag | html %]" selected="selected">[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
679                             [% ELSE %]
680                                 <option value="[% sublanguage.rfc4646_subtag | html %]">[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
681                             [% END %]
682                         [% ELSE %]
683                             [% IF sublanguage.rfc4646_subtag == lang %]
684                                 <option value="[% sublanguage.rfc4646_subtag | html %]" selected="selected">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
685                             [% ELSE %]
686                                 <option value="[% sublanguage.rfc4646_subtag | html %]">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
687                             [% END %]
688                         [% END %]
689                     [% END %]
690                 [% END %]
691             </select>
692         </li>
693     [% END %]
694    </ol>
695   </fieldset>
696     [% UNLESS nodateenrolled &&  noopacnote && noborrowernotes %]
697         <fieldset class="rows" id="memberentry_subscription">
698         <legend id="library_setup_lgd">Library set-up</legend><ol>
699         [% UNLESS nodateenrolled %]
700                 <li>
701                         [% IF ( mandatorydateenrolled ) %]
702             <label for="from" class="required">
703                         [% ELSE %]
704             <label for="from">
705                         [% END %]
706                         Registration date: </label>
707             [% IF ( dateformat == "metric" ) %]
708                 <input type="text" id="from" name="dateenrolled"  maxlength="10" size="10" onchange="CheckDate(document.form.dateenrolled);check_manip_date('verify');" value="[% dateenrolled | html %]" class="datepickerfrom" />
709             [% ELSE %]
710                 <input type="text" id="from" name="dateenrolled"  maxlength="10" size="10" value="[% dateenrolled | html %]" class="datepickerfrom" />
711             [% END %]
712                 [% IF ( mandatorydateenrolled ) %]<span class="required">Required</span>[% END %]
713                 [% IF ( ERROR_dateenrolled ) %]<span class="required">(Error)</span>[% END %]
714                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
715                 </li>
716         [% END %]
717         [% UNLESS nodateexpiry %]
718                 <li>
719         [% ELSE %]
720                 <li style="display:none">
721         [% END %]
722                         [% IF ( mandatorydateexpiry ) %]
723             <label for="to" class="required">
724                         [% ELSE %]
725             <label for="to">
726                         [% END %]
727                         Expiry date (leave blank for auto calc): </label>
728             [% IF ( dateformat == "metric" ) %]
729                                 [% UNLESS ( opadd ) %]
730                     <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');" value="[% dateexpiry | html UNLESS opduplicate %]" class="datepickerto" />
731                                 [% ELSE %]
732                     <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');" class="datepickerto" />
733                                 [% END %]
734                         [% ELSE %]
735                                 [% UNLESS ( opadd ) %]
736                 <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" value="[% dateexpiry | html UNLESS opduplicate %]" class="datepickerto" />
737                                 [% ELSE %]
738                 <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" value="[% dateexpiry | html %]" class="datepickerto" />
739                                 [% END %]
740                         [% END %]
741                 [% IF ( mandatorydateexpiry ) %]<span class="required">Required</span>[% END %]
742                 [% IF ( ERROR_dateexpiry ) %]<span class="required">(Error)</span>[% END %]
743                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
744                 </li>
745         [% UNLESS noopacnote %]
746                 <li>
747                         [% IF ( mandatoryopacnote ) %]
748                                 <label for="opacnote" class="required">
749                         [% ELSE %]
750                                 <label for="opacnote">
751             [% END %]
752                         OPAC note: </label>
753             <textarea id="opacnote" name="opacnote" cols="55" rows="5">[% opacnote | html UNLESS opduplicate %]</textarea>
754                         <div class="hint">This message appears on this patron's user page in the OPAC</div>
755           [% IF ( mandatoryopacnote ) %]<span class="required">Required</span>[% END %]
756                 </li>
757         [% END %]
758         [% UNLESS noborrowernotes %]
759                 <li>
760             [% IF ( mandatoryborrowernotes ) %]
761                                 <label for="borrowernotes" class="required">
762                         [% ELSE %]
763                                 <label for="borrowernotes">
764                         [% END %]
765                         Circulation note: </label>
766             <textarea id="borrowernotes" name="borrowernotes" cols="55" rows="5">[% borrowernotes | html UNLESS opduplicate %]</textarea>
767                         <div class="hint">This message displays when checking out to this patron</div>
768           [% IF ( mandatoryborrowernotes ) %]<span class="required">Required</span>[% END %]
769                 </li>
770         [% END %]
771                 </ol>
772         </fieldset>
773     [% END # hide fieldset %]
774
775     [% UNLESS nouserid && nopassword %]
776         <fieldset class="rows" id="memberentry_userid">
777         <legend id="opac_staff_login_lgd">OPAC/Staff login</legend><ol>
778         [% UNLESS nouserid %]
779                 <li>
780                         [% IF ( mandatoryuserid ) %]
781                         <label for="userid" class="required">
782                         [% ELSE %]
783                         <label for="userid">
784                         [% END %]
785                         Username: </label>
786
787 [% IF ( NoUpdateLogin ) %]
788         [% IF ( opduplicate ) %]
789                 <input type="text" id="userid" name="userid" size="20" disabled="disabled" />
790         [% ELSE %]
791                 <input type="text" id="userid" name="userid" size="20" disabled="disabled" value="[% userid | html %]" />
792         [% END %]
793 [% ELSE %]
794         [% IF ( opduplicate ) %]
795                 <input type="text" id="userid" name="userid" size="20" value="" />
796         [% ELSE %]
797                 <input type="text" id="userid" name="userid" size="20" value="[% userid | html %]" />
798         [% END %]
799 [% END %]
800
801 [%# Dummy input to avoid Firefox from using userid/password saved for authentication %]
802 <input type="text" disabled="disabled" style="display:none" />
803
804           [% IF ( mandatoryuserid ) %]<span class="required">Required</span>[% END %]
805                 </li>
806         [%END %]
807         [% UNLESS nopassword %]
808                 <li>
809                         [% IF ( mandatorypassword ) %]
810                         <label for="password" class="required">
811                         [% ELSE %]
812                         <label for="password">
813                         [% END %]
814                         Password: </label>
815                         [% IF ( opadd ) %]
816                         [% IF ( NoUpdateLogin ) %]
817                                 [% IF ( opduplicate ) %]
818                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" />
819                                 [% ELSE %]
820                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" value="[% password | html %]" />
821                                 [% END %]
822 [% ELSE %]
823                                 [% IF ( opduplicate ) %]
824                                         <input type="password" id="password" name="password" size="20" />
825                                 [% ELSE %]
826                                         <input type="password" id="password" name="password" size="20" value="[% password | html %]" />
827                                 [% END %]
828 [% END %]
829                         [% ELSE %]
830                         [% IF ( password ) %]
831                                 [% IF ( NoUpdateLogin ) %]
832                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" value="****" />
833                                 [% ELSE %]
834                                         [% IF ( opduplicate ) %]
835                                                 <input type="password" id="password" name="password" size="20" />
836                                         [% ELSE %]
837                                                 <input type="password" id="password" name="password" size="20" value="****" />
838                                         [% END %]
839                                 [% END %]
840                         [% ELSE %]
841                                 [% IF ( NoUpdateLogin ) %]
842                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" value="" />
843                                 [% ELSE %]
844                                         <input type="password" id="password" name="password" size="20" value="" />
845                                 [% END %]
846                         [% END %]
847                         [% END %]
848             [% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %]
849             [% IF ( ERROR_password_too_short ) %]<span class="required">Password is too short</span>[% END %]
850             [% IF ( ERROR_password_too_weak ) %]<span class="required">Password is too weak</span>[% END %]
851             [% IF ( ERROR_password_has_whitespaces ) %]<span class="required">Password has leading or trailing whitespaces</span>[% END %]
852             <div class="hint">Minimum password length: [% minPasswordLength | html %]</div>
853                 </li>
854                 <li>
855                         [% IF ( mandatorypassword ) %]
856                         <label for="password2" class="required">
857                         [% ELSE %]
858                         <label for="password2">
859                         [% END %]
860                         Confirm password: </label>
861                         [% IF ( opadd ) %]
862                         [% IF ( NoUpdateLogin ) %]
863                                 [% IF ( opduplicate ) %]
864                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" />
865                                 [% ELSE %]
866                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" value="[% password | html %]" />
867                                 [% END %]
868 [% ELSE %]
869                                 [% IF ( opduplicate ) %]
870                                         <input type="password" id="password2" name="password2" size="20" />
871                                 [% ELSE %]
872                                         <input type="password" id="password2" name="password2" size="20" value="[% password | html %]" />
873                                 [% END %]
874 [% END %]
875                         [% ELSE %]
876                         [% IF ( password ) %]
877                                 [% IF ( NoUpdateLogin ) %]
878                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" value="****" />
879                                 [% ELSE %]
880                                         [% IF ( opduplicate ) %]
881                                                 <input type="password" id="password2" name="password2" size="20" />
882                                         [% ELSE %]
883                                                 <input type="password" id="password2" name="password2" size="20" value="****" />
884                                         [% END %]
885                                 [% END %]
886                         [% ELSE %]
887                                 [% IF ( NoUpdateLogin ) %]
888                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" value="" />
889                                 [% ELSE %]
890                                         <input type="password" id="password2" name="password2" size="20" value="" />
891                                 [% END %]
892                         [% END %]
893                         [% END %]
894           [% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %][% IF ( ERROR_password_mismatch ) %]<span class="required">Passwords do not match</span>[% END %]
895                 </li>
896                 </ol>
897                 </fieldset>
898         [% END # hide fieldset %][% END %]
899                 <!--this zones are not necessary in modif mode -->
900         [% UNLESS ( opadd || opduplicate ) %]
901         <fieldset class="rows" id="memberentry_account_flags">
902             <legend id="account_flags_lgd">Patron account flags</legend>
903                         <ol class="radio">
904                         [% FOREACH flagloo IN flagloop %]
905                                 <li><label class="radio" for="yes[% flagloo.name | html %]">
906                 [% IF ( flagloo.key == 'gonenoaddress' ) %]Gone no address:[% END %]
907                 [% IF ( flagloo.key == 'lost' ) %]Lost card:[% END %]
908                 </label>
909                 [% IF CAN_user_circulate_manage_restrictions %]
910                             <label for="yes[% flagloo.name | html %]">
911                                 [% IF ( flagloo.yes ) %]
912                                 <input type="radio" id="yes[% flagloo.name | html %]" name="[% flagloo.name | html %]" value="1" checked="checked" />
913                                 [% ELSE %]
914                                 <input type="radio" id="yes[% flagloo.name | html %]" name="[% flagloo.name | html %]" value="1" />
915                                 [% END %]
916                             Yes </label>
917                             <label for="no[% flagloo.name | html %]">
918                                 [% IF ( flagloo.no ) %]
919                                 <input type="radio" id="no[% flagloo.name | html %]" name="[% flagloo.name | html %]" value="0" checked="checked"/>
920                                 [% ELSE %]
921                                 <input type="radio" id="no[% flagloo.name | html %]" name="[% flagloo.name | html %]" value="0" />
922                                 [% END %]
923                             No </label>
924                 [% ELSE %]
925                   [% IF flagloo.yes %]Yes[% ELSE %]No[% END %]
926                 [% END %]
927
928             </li>
929                         [% END %]
930
931                         </ol>
932                         </fieldset>
933
934               <fieldset class="rows" id="memberentry_restrictions">
935                 <legend id="restrictions_lgd">Patron restrictions</legend>
936
937                 [% IF ( debarments ) %]
938                     <table>
939                         <thead>
940                             <tr>
941                                  <th>Type</th>
942                                  <th>Comment</th>
943                                  <th>Expiration</th>
944                                  <th>Created</th>
945                                  [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
946                                    <th>Remove?</th>
947                                  [% END %]
948                             </tr>
949                         </thead>
950
951                         <tbody>
952                             [% FOREACH d IN debarments %]
953                                 <tr>
954                                     <td>[% d.type | html %]</td>
955                                     <td>
956                                     [% IF d.comment.search('OVERDUES_PROCESS') %]
957                                         Restriction added by overdues process [% d.comment.remove('OVERDUES_PROCESS ') | $raw %]
958                                     [% ELSE %]
959                                         [% d.comment | $raw %]
960                                     [% END %]
961                                     </td>
962                                     <td>[% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] <i>Indefinite</i> [% END %]</td>
963                                     <td>[% d.created | $KohaDates %]</td>
964                                     [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
965                                       <td>
966                                         <input type="checkbox" id="debarment_[% d.borrower_debarment_id | html %]" name="remove_debarment" value="[% d.borrower_debarment_id | html %]" />
967                                       </td>
968                                     [% END %]
969                                 </tr>
970                             [% END %]
971                         </tbody>
972                     </table>
973                 [% ELSE %]
974                     <p>Patron is currently unrestricted.</p>
975                 [% END %]
976
977                 [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
978                     <p><a href="#" id="add_manual_restriction">Add manual restriction</a></p>
979                     <fieldset id="manual_restriction_form">
980                         <input type="hidden" id="add_debarment" name="add_debarment" value="0" />
981                         <legend id="manual_restriction_lgd">Add manual restriction</legend>
982                         <ol>
983                             <li><label for="debarred_comment">Comment: </label><input type="text" id="debarred_comment" name="debarred_comment" onchange="$('#add_debarment').val(1);" /></li>
984                             <li><label for="debarred_expiration">Expiration: </label><input name="debarred_expiration" id="debarred_expiration" size="10" value="" class="datepicker" onchange="$('#add_debarment').val(1);" />
985                                     <a href='javascript:void(0)' onclick="$('#debarred_expiration').val('');">Clear date</a></li>
986
987                         </ol>
988                         <p>
989                             <a class="cancel" id="cancel_manual_restriction" href="#">Cancel</a>
990                         </p>
991                     </fieldset>
992                 [% END %]
993             </fieldset>
994                 [% END %]
995
996 [% END %]
997
998 [% IF ( step_7 ) %]
999 [% IF Koha.Preference('HouseboundModule') %]
1000   <fieldset class="rows" id="memberentry_housebound_roles">
1001     <legend id="housebound_roles">Housebound roles</legend>
1002     <ol class="radio">
1003       <li>
1004         <label class="radio" for="housebound_chooser">
1005           Chooser:
1006         </label>
1007         [% IF ( housebound_role.housebound_chooser == 1 ) %]
1008         <label for="yes_housebound_chooser">Yes </label>
1009         <input type="radio" id="yes_housebound_chooser"
1010                name="housebound_chooser" value="1"
1011                checked="checked" />
1012         <label for="no_housebound_chooser">No </label>
1013         <input type="radio" id="no_housebound_chooser"
1014                name="housebound_chooser" value="0" />
1015         [% ELSE %]
1016         <label for="yes_housebound_chooser">Yes </label>
1017         <input type="radio" id="yes_housebound_chooser"
1018                name="housebound_chooser" value="1" />
1019         <label for="no_housebound_chooser">No </label>
1020         <input type="radio" id="no_housebound_chooser"
1021                name="housebound_chooser" value="0"
1022                checked="checked" />
1023         [% END %]
1024       </li>
1025       <li>
1026         <label class="radio" for="housebound_deliverer">Deliverer:</label>
1027         [% IF ( housebound_role.housebound_deliverer == 1 ) %]
1028         <label for="yes_housebound_deliverer">Yes </label>
1029         <input type="radio" id="yes_housebound_deliverer"
1030                name="housebound_deliverer" value="1"
1031                checked="checked" />
1032         <label for="no_housebound_deliverer">No </label>
1033         <input type="radio" id="no_housebound_deliverer"
1034                name="housebound_deliverer" value="0" />
1035         [% ELSE %]
1036         <label for="yes_housebound_deliverer">Yes </label>
1037         <input type="radio" id="yes_housebound_deliverer"
1038                name="housebound_deliverer" value="1" />
1039         <label for="no_housebound_deliverer">No </label>
1040         <input type="radio" id="no_housebound_deliverer"
1041                name="housebound_deliverer" value="0"
1042                checked="checked" />
1043         [% END %]
1044       </li>
1045     </ol>
1046   </fieldset>
1047 [% END # hide fieldset %]
1048 [% END # IF step_7 %]
1049
1050 [% IF ( step_4 ) %]
1051 [% IF ( ExtendedPatronAttributes ) %][% UNLESS ( no_patron_attribute_types ) %]
1052   <fieldset class="rows" id="memberentry_patron_attributes">
1053     <legend id="patron_attributes_lgd">Additional attributes and identifiers</legend>
1054     <input type="hidden" name="setting_extended_patron_attributes" value="1" />
1055     [% FOREACH pa_loo IN patron_attributes %]
1056         [% IF pa_loo.class %]
1057             <fieldset id="aai_[% pa_loo.class | html %]">
1058             <legend id="[% pa_loo.class | html %]_lgd">[% pa_loo.lib | html %]</legend>
1059         [% END %]
1060         <ol class="attributes_table">
1061             [% FOREACH patron_attribute IN pa_loo.items %]
1062                 <li data-category_code="[% patron_attribute.category_code | html %]">
1063                     <label for="[% patron_attribute.form_id | html %]">[% patron_attribute.description | html %]: </label>
1064                         [% IF ( patron_attribute.use_dropdown ) %]
1065                             <select id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]">
1066                                 <option value=""></option>
1067                                 [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
1068                                     [% IF auth_val_loo.authorised_value == patron_attribute.value %]
1069                                         <option value="[% auth_val_loo.authorised_value | html %]" selected="selected">
1070                                             [% auth_val_loo.lib | html %]
1071                                         </option>
1072                                     [% ELSE %]
1073                                         <option value="[% auth_val_loo.authorised_value | html %]" >
1074                                             [% auth_val_loo.lib | html %]
1075                                         </option>
1076                                     [% END %]
1077                                 [% END %]
1078                             </select>
1079                         [% ELSE %]
1080                             <textarea rows="2" cols="30" id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]">[% patron_attribute.value | html %]</textarea>
1081                         [% END %]
1082                         <input type="hidden" id="[% patron_attribute.form_id | html %]_code" name="[% patron_attribute.form_id | html %]_code" value="[% patron_attribute.code | html %]" />
1083                         <a href="#" onclick="clear_entry(this); return false;"><i class="fa fa-fw fa-trash"></i> Clear</a>
1084                         [% IF ( patron_attribute.repeatable ) %]
1085                         <a href="#" onclick="clone_entry(this); return false;"><i class="fa fa-fw fa-plus"></i> New</a>
1086                         [% END %]
1087                 </li>
1088             [% END %]
1089         </ol>
1090         [% IF pa_loo.class %]</fieldset>[% END %]
1091     [% END %]
1092   </fieldset>
1093 [% END %][% END %][% END %]
1094
1095 [% IF ( step_5 ) %][% IF ( EnhancedMessagingPreferences ) %]
1096   <fieldset class="rows" id="memberentry_messaging_prefs">
1097     <legend id="patron_messaging_prefs_lgd">Patron messaging preferences</legend>
1098     [% IF ( opadd ) %]
1099     <!-- handle changing prefs if creating new patron and changing
1100          the patron category
1101     -->
1102     <script type="text/javascript">//<![CDATA[
1103        $(document).ready(function(){
1104             var message_prefs_dirty = false;
1105             $('#memberentry_messaging_prefs > *').change(function() {
1106                 message_prefs_dirty = true;
1107             });
1108             $('#categorycode_entry').change(function() {
1109                 var categorycode = $(this).val();
1110                 if (message_prefs_dirty) {
1111                     if (!confirm(_("Change messaging preferences to default for this category?"))) {
1112                         return;
1113                     }
1114                 }
1115                 $.getJSON('/cgi-bin/koha/members/default_messageprefs.pl?categorycode=' + categorycode,
1116                     function(data) {
1117                         $.each(data.messaging_preferences, function(i, item) {
1118                             var attrid = item.message_attribute_id;
1119                             var transports = ['email', 'rss', 'sms'];
1120                             $.each(transports, function(j, transport) {
1121                                 if (item['transports_' + transport] == 1) {
1122                                     $('#' + transport + attrid).prop('checked', true);
1123                                 } else {
1124                                     $('#' + transport + attrid).prop('checked', false);
1125                                 }
1126                             });
1127                             if (item.digest && item.digest != ' ') {
1128                                 $('#digest' + attrid).prop('checked', true);
1129                             } else {
1130                                 $('#digest' + attrid).prop('checked', false);
1131                             }
1132                             if (item.takes_days == '1') {
1133                                 $('[name=' + attrid + '-DAYS]').val('' + item.days_in_advance);
1134                             }
1135                         });
1136                         message_prefs_dirty = false;
1137                     }
1138                 );
1139             });
1140         });
1141     //]]>
1142     </script>
1143     [% END %]
1144     <input type="hidden" name="setting_messaging_prefs" value="1" />
1145     [% INCLUDE 'messaging-preference-form.inc' %]
1146     [% IF ( SMSSendDriver ) %]
1147         <p><label for="SMSnumber">SMS number:</label>
1148             <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber | html %]" />
1149         </p>
1150         [% UNLESS nosms_provider_id %]
1151         <p>
1152             <label for="sms_provider_id">SMS provider:</label>
1153             <select id="sms_provider_id" name="sms_provider_id"/>
1154                 <option value="">Unknown</option>
1155                 [% FOREACH s IN sms_providers %]
1156                     [% IF s.id == sms_provider_id %]
1157                         <option value="[% s.id | html %]" selected="selected">[% s.name | html %]</option>
1158                     [% ELSE %]
1159                         <option value="[% s.id | html %]">[% s.name | html %]</option>
1160                     [% END %]
1161                 [% END %]
1162             </select>
1163         </p>
1164         [% END %]
1165     [% END %]
1166   </fieldset>
1167 [% END %] [% END %]
1168
1169 </form>
1170
1171 [% IF quickadd && opadd  && !check_member %]
1172     <form id="quick_add_form" class="toggler">
1173         <fieldset class="rows quick_add"><legend>Quick add</legend>
1174             <ol id="quick_add_list">
1175             </ol>
1176         </fieldset>
1177     </form>
1178 [% END %]
1179 </div>
1180 </div>
1181
1182 [% UNLESS ( opadd ) %]<div class="yui-b">
1183 [% INCLUDE 'members-menu.inc' %]
1184 </div>[% END %]
1185 [% END %]
1186 </div>
1187
1188 [% MACRO jsinclude BLOCK %]
1189     [% Asset.js("lib/jquery/plugins/jquery.fixFloat.js") | $raw %]
1190     [% INCLUDE 'calendar.inc' %]
1191     [% INCLUDE 'str/members-menu.inc' %]
1192     [% Asset.js("js/members-menu.js") | $raw %]
1193     <script type="text/javascript">
1194         $(document).ready(function() {
1195
1196                 $("#saverecord").css({ 'margin-left': 0 });
1197                 var original_offset = $("#toolbar").position().top;
1198                 var additional_height = $("#filters").height();
1199                 $('#toolbar').fixFloat({ 'originalOffset': original_offset });
1200                 $("#filteraction_on").on("click", function(){
1201                     $(window).off('scroll');
1202                     $("#toolbar").css({ top: original_offset + additional_height });
1203                     $('#toolbar').fixFloat({ 'originalOffset': original_offset + additional_height });
1204                 });
1205                 $("#filteraction_off").on("click", function(){
1206                     $(window).off('scroll');
1207                     $("#toolbar").css({ top: original_offset });
1208                     $('#toolbar').fixFloat({ 'originalOffset': original_offset });
1209                 })
1210
1211             [% IF categorycode %]
1212                 update_category_code( "[% categorycode | html %]" );
1213             [% ELSE %]
1214                 if ( $("#categorycode_entry").length > 0 ){
1215                     var category_code = $("#categorycode_entry").find("option:selected").val();
1216                     update_category_code( category_code );
1217                 }
1218             [% END %]
1219         });
1220
1221         function update_cardnumber_warning(size){
1222             var max_len = [% maxlength_cardnumber | html %];
1223             if ( size >= max_len ) {
1224                 $("#cn_max").show();
1225             } else {
1226                 $("#cn_max").hide();
1227             }
1228         }
1229
1230         $(document).ready(function() {
1231             $("#cn_max").hide();
1232             var content;
1233             $("#cardnumber").on("keydown", function(e){
1234                 content = $(this).val();
1235             });
1236             $("#cardnumber").on("keyup", function(e){
1237                 // .val() will return the value of the input after the key has been released
1238                 var l = $(this).val().length;
1239                 if ( l == content.length + 1 ) { l--; }
1240                 update_cardnumber_warning(l);
1241             });
1242             $("#cardnumber").bind("paste", function(e){
1243                 var pastedData = e.originalEvent.clipboardData.getData('text');
1244                 update_cardnumber_warning(pastedData.length - 1);
1245             } );
1246             var toggle_quick_add = $(".toggle_quick_add");
1247             $(toggle_quick_add).click(function(e){
1248                 toggle_quick_add.toggle();
1249                 e.preventDefault();
1250                 var toggle_to = '';
1251                 var toggle_from = '';
1252                 if( $("#entryform:visible").length ) {
1253                     toggle_to = "#quick_add_form label";
1254                     toggle_from = "#entryform label";
1255                 } else {
1256                     toggle_to="#entryform label";
1257                     toggle_from = "#quick_add_form label";
1258                 }
1259                 $(toggle_from).each(function() {
1260                     var input_label = $(this).attr('for');
1261                     if ( input_label == 'sex-male' || input_label == 'sex-none' || input_label == 'sex-female' ) {
1262                         $(toggle_to+"[for='"+input_label+"']").next().prop('checked', $(this).next().prop('checked') );
1263                         return;
1264                     }
1265                     $(toggle_to+"[for='"+input_label+"']").next().val(  $(this).next().val() );
1266                 });
1267
1268                 $(".toggler").toggle();
1269             });
1270
1271             $("#save_quick_add").click(function(){
1272                 $("#quick_add_form").validate();
1273                 if( $("#quick_add_form").valid()){
1274                     $('.toggle_quick_add').click();
1275                     $('#saverecord').click();
1276                 }
1277                 else {return false;}
1278             });
1279
1280             $("#saverecord").click(function(){
1281                 if( check_form_borrowers() ){
1282                     $("#entryform").submit();
1283                 }
1284             });
1285
1286             $('#duplicate').on('click', function() {
1287                 $("input[name='op']").val('modify');
1288                 $("input[name='borrowernumber']").val('[% check_member | html %]');
1289                 $("input[name='check_member']").val('');
1290                 $('#entryform').submit();
1291             });
1292
1293             $('#not-duplicate').on('click', function() {
1294                 $("input[name='nodouble']").val('1');
1295                 $('#entryform').submit();
1296             });
1297         });
1298
1299         var MSG_SEPARATOR = _("Separator must be / in field %s");
1300         var MSG_INCORRECT_DAY = _("Invalid day entered in field %s");
1301         var MSG_INCORRECT_MONTH = _("Invalid month entered in field %s");
1302         var MSG_INCORRECT_YEAR = _("Invalid year entered in field %s");
1303         var MSG_DUPLICATE_PATRON = _("Warning: Duplicate patron");
1304         var MSG_DUPLICATE_ORGANIZATION = _("Warning: Duplicate organization");
1305         var MSG_LATE_EXPIRY = _("Warning: Expiration date falls before enrollment date");
1306         var MSG_DUPLICATE_SUSPICION = _("Please confirm whether this is a duplicate patron");
1307         var MSG_MONTH = _("%s month")
1308         var MSG_MONTHS = _("%s months")
1309         var MSG_YEAR = _("%s year")
1310         var MSG_YEARS = _("%s years")
1311         var LABEL_CHANGE = _("Change");
1312         var LABEL_SET_TO_PATRON = _("Set to patron");
1313         var LABEL_AGE = _("Age");
1314
1315         [% IF quickadd && opadd  && !check_member %]
1316             $(document).ready(function () {
1317
1318                 $("#entryform,#saverecord").hide();
1319                 [% q_add_f = Koha.Preference('PatronQuickAddFields').split('\|') | html %]
1320                 var qaddfields = [[% FOREACH field IN q_add_f.unique %]"[% field | html %]",[% END %]];
1321                 var skipped_fields = ["contactname","contactfirstname","relationship"]; //Guarantor form is pulled as a whole, ignore individual fields
1322                 $("#entryform label").each(function () {
1323                     var input_label = $(this).attr('for');
1324                     if ( input_label == 'sex-female' ) {
1325                         input_label='sex';
1326                     }
1327                     else if ( input_label == 'btitle' ) {
1328                         input_label='title';
1329                     }
1330                     if ( skipped_fields.indexOf( input_label ) != -1 ) { input_label=""; }
1331                     if( qaddfields.indexOf( input_label ) != -1 || $(this).attr('class') == 'required' ){
1332                        $(this).parent().clone().appendTo("#quick_add_list");
1333                        [% UNLESS mandatorypassword %]
1334                              if( input_label == 'password' ) $("#entryform label[for='password2']").parent().clone().appendTo("#quick_add_list");
1335                        [% END %]
1336                     }
1337                 });
1338                     if( $("#memberentry_guarantor").length ) {
1339                         $("#memberentry_guarantor").clone().appendTo("#quick_add_list").css("margin",0);
1340                         $("#quick_add_form #memberentry_guarantor").append("<p>" + _("Note: Quick add guarantor form populates address fields in full form") + "</p>");
1341                         $("#quick_add_list #guarantordelete").prop('id','qagd');
1342                     }
1343                 $("#qagd").click(function() { $("#guarantordelete").click(); });
1344                 $("#quick_add_form").show();
1345             });
1346         [% END %]
1347
1348     </script>
1349     [% Asset.js("js/members.js") | $raw %]
1350     [% Asset.js("js/messaging-preference-form.js") | $raw %]
1351 [% END %]
1352
1353 [% INCLUDE 'intranet-bottom.inc' %]
1354 [% PROCESS 'password_check.inc' %]
1355 [% PROCESS 'add_password_check' new_password => 'password' %]