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