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