Bug 35602: Fix typo AutoMemberNum
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / memberentrygen.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE To %]
4 [% USE Koha %]
5 [% USE KohaDates %]
6 [% USE Branches %]
7 [% PROCESS 'member-main-address-style.inc' %]
8 [% PROCESS 'member-alt-address-style.inc' %]
9 [% PROCESS 'member-alt-contact-style.inc' %]
10 [% PROCESS 'restriction-types.inc' %]
11 [% PROCESS 'i18n.inc' %]
12 [% SET footerjs = 1 %]
13 [% INCLUDE 'doc-head-open.inc' %]
14 <title>[% FILTER collapse %]
15         [% UNLESS blocking_error %]
16             [% IF ( opadd ) %]
17                 [% t("Add patron") | html %]
18             [% ELSE %]
19                 [% t("Modify patron") | html %]
20             [% END %]
21             [% INCLUDE 'patron-title.inc' no_html = 1 %]
22             [% IF patron_category %]([% patron_category.description | html %])[% END %]
23         [% END %] &rsaquo;
24     [% t("Patrons") | html %] &rsaquo;
25     [% t("Koha") | html %]
26 [% END %]</title>
27 <style>
28 legend:hover {
29     cursor: pointer;
30 }
31 </style>
32 [% INCLUDE 'doc-head-close.inc' %]
33 </head>
34
35 <body id="pat_memberentrygen" class="pat">
36     [% WRAPPER 'header.inc' %]
37         [% INCLUDE 'patron-search-header.inc' %]
38     [% END %]
39
40     [% WRAPPER 'sub-header.inc' %]
41         [% WRAPPER breadcrumbs %]
42             [% WRAPPER breadcrumb_item %]
43                     <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
44             [% END %]
45             [% UNLESS blocking_error %]
46                 [% UNLESS opadd %]
47                     [% IF (borrower_data.firstname || borrower_data.surname ) %]
48                         [% WRAPPER breadcrumb_item %]
49                             <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber | uri %]">
50                                 [% INCLUDE 'patron-title.inc' %]
51                             </a>
52                         [% END %]
53                     [% END %]
54                 [% END %]
55             [% END %]
56             [% WRAPPER breadcrumb_item bc_active= 1 %]
57                 [% IF ( opadd ) %]
58                     <span>Add patron</span>
59                 [% ELSE %]
60                     <span>Modify patron</span>
61                 [% END %]
62                 [% IF patron_category %]
63                     ([% patron_category.description | html %])
64                 [% END %]
65             [% END %]
66         [% END #/ WRAPPER breadcrumbs %]
67     [% END #/ WRAPPER sub-header.inc %]
68
69     <div class="main container-fluid">
70         <div class="row">
71             [% IF borrower_data.messages %]
72                 [% FOR message IN borrower_data.messages %]
73                     [% SWITCH message.error %]
74                         [% CASE 'error_on_insert_patron' %]
75                             <div class="dialog alert">Something went wrong when creating the patron. Check the logs for details.</div>
76                         [% CASE 'error_on_update_patron' %]
77                             <div class="dialog alert">Something went wrong when updating the patron. Check the logs for details.</div>
78                         [% CASE %]<div class="dialog alert">Unhandled error: [% message.error | html %]</div>
79                     [% END %]
80                 [% END %]
81             [% END %]
82             [% IF ( opadd ) %]
83                 <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
84             [% ELSE %]
85                 <div class="col-sm-10 col-sm-push-2">
86             [% END %]
87                 <main class="clearfix">
88                     [% INCLUDE 'blocking_errors.inc' %]
89
90                     [% IF error_alert %]
91                         [% IF ( error_alert == "no_email" ) %]
92                             <div class="dialog alert">This member has no email</div>
93                         [% ELSE %]
94                             <div class="dialog alert">[% error_alert | html %]</div>
95                         [% END %]
96                     [% END %]
97                     [% IF info_alert %]
98                         <div class="dialog message">Email has been sent.</div>
99                     [% END %]
100
101                     [% INCLUDE 'noadd-warnings.inc' %]
102
103                     [% UNLESS ( no_add ) %]
104                         <h1>
105                             [% IF ( opadd ) %]
106                                 <span>Add patron</span>
107                             [% ELSIF ( opduplicate ) %]
108                                 <span>Duplicate patron</span>
109                             [% ELSE %]
110                                 <span>Modify patron</span>
111                             [% END %]
112                             [% INCLUDE 'patron-title.inc' %]
113                             [% IF patron_category %]([% patron_category.description | html %])[% END %]
114                         </h1>
115
116                         [% IF quickadd && opadd && !check_member %]
117                             <a href="#" class="toggle_quick_add"><i class="fa fa-plus-square"></i> Show full form</a>
118                             <a href="#" class="toggle_quick_add" style="display:none"><i class="fa fa-minus-square"></i> Show brief form</a>
119                         [% END %]
120
121                         [% IF ( check_member ) %]
122                             <div class="dialog alert">
123                                 <h3>Duplicate patron record?</h3>
124                                 <p><a class="popup_patronview" href="/cgi-bin/koha/members/moremember.pl?print=brief&amp;borrowernumber=[% check_member | uri %]"><i class="fa-solid fa-window-restore"></i> View existing record</a></p>
125                                 <button id="duplicate" type="submit" class="new"> <i class="fa-solid fa-pencil" aria-hidden="true"></i> It is a duplicate. Edit existing record </button>
126                                 <button type="submit" id="not-duplicate" class="new"> <i class="fa fa-plus"></i> Not a duplicate. Save as new record </button>
127                             </div>
128                         [% END %]
129
130                         [% IF ( nok ) %]
131                             <div class="dialog alert">
132                                 <p>The following fields are wrong. Please fix them.</p>
133                                 <ul>
134                                     [% IF ( ERROR_login_exist ) %]
135                                         <li id="ERROR_login_exist">Username already exists or could not create unique new one.</li>
136                                     [% END %]
137                                     [% IF ERROR_cardnumber_already_exists %]
138                                         <li id="ERROR_cardnumber">Cardnumber already in use.</li>
139                                     [% END %]
140                                     [% IF ERROR_cardnumber_length %]
141                                         <li id="ERROR_cardnumber">Cardnumber length is incorrect.</li>
142                                     [% END %]
143                                     [% IF ( ERROR_age_limitations ) %]
144                                     <li id="ERROR_age_limitations">Patron's age is incorrect for their category.
145                                             Ages allowed are [% age_low | html %]-[% age_high | html %].</li>
146                                     [% END %]
147                                     [% IF ( ERROR_branch ) %]
148                                         <li id="ERROR_branch">Library is invalid.</li>
149                                     [% END %]
150                                     [% IF ( ERROR_dateofbirth ) %]
151                                         <li id="ERROR_dateofbirth">Date of birth is invalid.</li>
152                                     [% END %]
153                                     [% IF ( ERROR_dateenrolled ) %]
154                                         <li id="ERROR_dateenrolled">Date of enrollment is invalid.</li>
155                                     [% END %]
156                                     [% IF ( ERROR_dateexpiry ) %]
157                                         <li id="ERROR_dateexpiry">Date of expiration is invalid.</li>
158                                     [% END %]
159                                     [% IF ( ERROR_password_too_short ) %]
160                                         <li id="ERROR_short_password">Password must be at least [% minPasswordLength | html %] characters long.</li>
161                                     [% END %]
162                                     [% IF ( ERROR_password_too_weak ) %]
163                                         <li id="ERROR_weak_password">Password must contain at least one digit, one lowercase and one uppercase.</li>
164                                     [% END %]
165                                     [% IF ( ERROR_password_has_whitespaces ) %]
166                                         <li id="ERROR_weak_password">Password must not contain leading or trailing whitespaces.</li>
167                                     [% END %]
168                                     [% IF ( ERROR_password_mismatch ) %]
169                                         <li id="ERROR_password_mismatch">Passwords do not match.</li>
170                                     [% END %]
171                                     [% IF ( ERROR_password_expiration_date ) %]
172                                         <li id="ERROR_dateexpiry">Password expiration date is invalid.</li>
173                                     [% END %]
174                                     [% IF ( ERROR_extended_unique_id_failed ) %]
175                                         <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>
176                                     [% END %]
177                                     [% IF ERROR_bad_email %]
178                                         <li id="ERROR_bad_email">The primary email is invalid.</li>
179                                     [% END %]
180                                     [% IF ERROR_bad_email_secondary %]
181                                         <li id="ERROR_bad_email_secondary">The secondary email is invalid.</li>
182                                     [% END %]
183                                     [% IF ERROR_bad_email_alternative %]
184                                         <li id="ERROR_bad_email_alternative">The alternative email is invalid.</li>
185                                     [% END %]
186                                     [% IF ( ERROR_child_no_guarantor ) %]
187                                         <li id="ERROR_child_no_guarantor">A child patron needs a guarantor.</li>
188                                     [% END %]
189                                     [% IF ( ERROR_guarantor_is_guarantee ) %]
190                                         <li id="ERROR_guarantor_is_guarantee">A guarantor cannot be a guarantee.</li>
191                                     [% END %]
192                                     [% IF ( ERROR_cannot_delete_guarantor ) %]
193                                         <li id="ERROR_cannot_delete_guarantor">Cannot delete guarantor(s). A child patron needs a guarantor.</li>
194                                     [% END %]
195                                 </ul>
196                             </div>
197                         [% END %]
198
199                         [% SET fieldstohide = Koha.Preference('CollapseFieldsPatronAddForm') %]
200                         [% IF Koha.Preference('CollapseFieldsPatronAddForm') %][% UNLESS step %]
201                             <p id="selections">
202                                 <input type="checkbox" id="toggle_hidden_fields" title="These fields are collapsed by default by the CollapseFieldsPatronAddForm system preference"><strong>Show collapsed fields:</strong>
203                                 [% FOREACH field IN fieldstohide.split(',') %]
204                                     [% SWITCH field %]
205                                         [% CASE 'identity' %] <span>Patron identity</span> |
206                                         [% CASE 'guarantor' %] <span>Guarantor information</span> |
207                                         [% CASE 'primary_address' %] <span>Main address</span> |
208                                         [% CASE 'primary_contact' %] <span>Contact information</span> |
209                                         [% CASE 'alt_address' %] <span>Alternate address</span> |
210                                         [% CASE 'alt_contact' %] <span>Alternate contact</span> |
211                                         [% CASE 'lib_mgmt' %] <span>Library management</span> |
212                                         [% CASE 'lib_setup' %] <span>Library setup</span> |
213                                         [% CASE 'login' %] <span>OPAC/Staff interface login</span> |
214                                         [% CASE 'flags' %] <span>Patron account flags</span> |
215                                         [% CASE 'debarments' %] <span>Patron restrictions</span> |
216                                         [% CASE 'housebound' %][% IF Koha.Preference('HouseboundModule')%] <span>Housebound roles</span> |[% END %]
217                                         [% CASE 'additional' %] <span>Additional attributes and identifiers</span> |
218                                         [% CASE 'messaging' %] <span>Patron messaging preferences</span> |
219                                     [% END %]
220                                 [% END %]
221                             </p>
222                         [% END %][% END %]
223
224                         [% UNLESS ( check_member ) %]
225                             <div id="toolbar" class="btn-toolbar">
226                                 [% IF quickadd && opadd %]
227                                     <button class="btn btn-primary toggler" id="save_quick_add" name="save"><i class="fa fa-save"></i> Save</button>
228                                 [% END %]
229                                 <button class="btn btn-primary toggler" id="saverecord" name="save" ><i class="fa fa-save"></i> Save</button>
230                                 [% IF opadd %]
231                                     <a class="btn btn-link" href="/cgi-bin/koha/members/member.pl" class="toggler save_entryform">
232                                 [% ELSE %]
233                                     <a class="btn btn-link" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber | html %]">
234                                 [% END %]
235                                     <i class="fa fa-times"></i> Cancel
236                                 </a>
237                             </div>
238                         [% END %]
239
240                         <form name="form" id="entryform" action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off" class="toggler">
241                             [% UNLESS ( check_member ) %]
242                                 <input type="hidden" name="nodouble"  value="[% nodouble | html %]" />
243                             [% END %]
244                             <!--    field always hidden in different form (1,2,3) -->
245                             <input type="hidden" name="BorrowerMandatoryField" value="[% BorrowerMandatoryField | html %]" />
246                             <input type="hidden" name="updtype" value="[% updtype | html %]" />
247                             <input type="hidden" name="destination" value="[% destination | html %]" />
248                             <input type="hidden" name="check_member" value="[% check_member | html %]" />
249                             <input type="hidden" name="borrowernumber" value="[% borrowernumber | html UNLESS opduplicate %]" />
250                             <input type="hidden" name="nodouble"  value="[% nodouble | html UNLESS opduplicate %]" />
251                             <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
252                             [% IF ( step ) %]
253                                 <input type="hidden" name="step"  value="[% step | html %]" />
254                             [% END %]
255                             [% IF ( opadd ) %]
256                                 <input type="hidden" name="op" value="insert" />
257                             [% ELSIF ( opduplicate ) %]
258                                 <input type="hidden" name="op" value="insert" />
259                             [% ELSE %]
260                                 <input type="hidden" name="op" value="save" />
261                                 [% IF step == 4 || step == 5 || step == 6 || step == 2 || step == 1 || step == 7 %]
262                                     [%# Only put the card number if we arent showing it in the form later %]
263                                     [% IF borrower_data.cardnumber %]
264                                         <input type="hidden" name="cardnumber" value="[% borrower_data.cardnumber | html %]" />
265                                     [% END %]
266                                 [% END %]
267                             [% END %]
268
269                             [% IF ( step_1 ) %]
270                                 [% UNLESS notitle && nosurname && nofirstname && nomiddle_name && nodateofbirth && noinitials && noothernames &&nosex && nopronouns %]
271                                     <fieldset class="rows" id="memberentry_identity">
272                                         <legend id="identity_lgd">[% IF ( patron_category.category_type == 'I' ) %]<span>Organization [% ELSE %]Patron [% END %]identity</span></legend>
273                                         <ol>
274                                             [% UNLESS ( patron_category.category_type == 'I' ) %]
275                                                 [% UNLESS notitle %]
276                                                     [% IF Koha.Preference('BorrowersTitles') %]
277                                                         <li>
278                                                             [% IF ( mandatorytitle ) %]
279                                                                 <label for="btitle" class="required">
280                                                             [% ELSE %]
281                                                                 <label for="btitle">
282                                                             [% END %]
283                                                             Salutation: </label>
284                                                             <select id="btitle" name="title">
285                                                                 <option value=""></option>
286                                                                 [% FOREACH t IN Koha.Preference('BorrowersTitles').split('\|') %]
287                                                                     [% IF btitle == t %]
288                                                                         <option value="[% t | html %]" selected="selected">[% t | html %]</option>
289                                                                     [% ELSE %]
290                                                                         <option value="[% t | html %]">[% t | html %]</option>
291                                                                     [% END %]
292                                                                 [% END %]
293                                                             </select>
294                                                             [% IF ( mandatorytitle ) %]
295                                                                 <span class="required">Required</span>
296                                                             [% END %]
297                                                         </li>
298                                                     [% END # /IF Koha.Preference('BorrowersTitles') %]
299                                                 [% END # /UNLESS notitle %]
300                                             [% END # /UNLESS ( I ) %]
301
302                                             [% UNLESS nosurname %]
303                                                 <li>
304                                                     [% IF ( patron_category.category_type == 'I' ) %]
305                                                         <label for="surname" class="required">
306                                                             Name:
307                                                         </label>
308                                                     [% ELSE %]
309                                                         [% IF ( mandatorysurname ) %]
310                                                             <label for="surname" class="required">
311                                                         [% ELSE %]
312                                                             <label for="surname">
313                                                         [% END %]
314                                                         Surname: </label>
315                                                     [% END %]
316
317                                                     [% IF ( uppercasesurnames ) %]
318                                                         <input style="text-transform:uppercase;" type="text" id="surname" name="surname" size="20"  value="[% patron.surname | html %]" />
319                                                     [% ELSE %]
320                                                         <input type="text" id="surname" name="surname" size="20"  value="[% patron.surname | html %]" />
321                                                     [% END %]
322                                                     [% IF ( mandatorysurname ) %]
323                                                         <span class="required">Required</span>
324                                                     [% END %]
325                                                 </li>
326                                             [% END # /UNLESS nosurname %]
327
328                                             [% UNLESS ( patron_category.category_type == 'I' ) %]
329                                                 [% UNLESS nofirstname %]
330                                                     <li>
331                                                         [% IF ( mandatoryfirstname ) %]
332                                                             <label for="firstname" class="required">
333                                                         [% ELSE %]
334                                                             <label for="firstname">
335                                                         [% END %]
336                                                             First name:
337                                                         </label>
338                                                         <input type="text" id="firstname" name="firstname" size="20"  value="[% borrower_data.firstname | html UNLESS opduplicate %]" />
339                                                         [% IF ( mandatoryfirstname ) %]
340                                                             <span class="required">Required</span>
341                                                         [% END %]
342                                                     </li>
343                                                 [% END #/UNLESS nofirstname %]
344                                                 [% UNLESS nomiddle_name %]
345                                                     <li>
346                                                         [% IF ( mandatorymiddle_name ) %]
347                                                             <label for="middle_name" class="required">
348                                                         [% ELSE %]
349                                                             <label for="middle_name">
350                                                         [% END %]
351                                                             Middle name:
352                                                         </label>
353                                                         <input type="text" id="middle_name" name="middle_name" size="20"  value="[% borrower_data.middle_name | html UNLESS opduplicate %]" />
354                                                         [% IF ( mandatorymiddle_name ) %]
355                                                             <span class="required">Required</span>
356                                                         [% END %]
357                                                     </li>
358                                                 [% END #/UNLESS nomiddle_name %]
359                                                 [% UNLESS nodateofbirth %]
360                                                     <li>
361                                                         [% IF ( mandatorydateofbirth ) %]
362                                                             <label for="dateofbirth" class="required">
363                                                         [% ELSE %]
364                                                             <label for="dateofbirth">
365                                                         [% END %]
366                                                         Date of birth:
367                                                         </label>
368                                                         <input type="text" id="dateofbirth" name="dateofbirth" size="20" value="[% borrower_data.dateofbirth | html UNLESS opduplicate %]" class="flatpickr" data-flatpickr-pastinclusive="true" />
369                                                          [% IF ( mandatorydateofbirth ) %]
370                                                             <span class="required">Required</span>
371                                                         [% END %]
372                                                         [% IF ( ERROR_dateofbirth ) %]
373                                                             <span class="required">(Error)</span>
374                                                         [% END %]
375                                                         <div id="dateofbirth_hint" class="hint">[% INCLUDE 'date-format.inc' %]</div>
376                                                     </li>
377                                                 [% END # /UNLESS nodateofbirth %]
378                                                 [% UNLESS noinitials %]
379                                                     <li>
380                                                         [% IF ( mandatoryinitials ) %]
381                                                             <label for="initials" class="required">
382                                                         [% ELSE %]
383                                                             <label for="initials">
384                                                         [% END %]
385                                                             Initials:
386                                                         </label>
387                                                         <input type="text" id="initials" name="initials" size="20"  value="[% borrower_data.initials | html UNLESS opduplicate %]" />
388                                                         [% IF ( mandatoryinitials ) %]
389                                                             <span class="required">Required</span>
390                                                         [% END %]
391                                                     </li>
392                                                 [% END # /UNLESS noinitials %]
393                                                 [% UNLESS nopronouns %]
394                                                     <li>
395                                                         [% IF ( mandatorypronouns ) %]
396                                                             <label for="pronouns" class="required">
397                                                         [% ELSE %]
398                                                             <label for="pronouns">
399                                                         [% END %]
400                                                             Pronouns:
401                                                         </label>
402                                                         <input type="text" id="pronouns" name="pronouns" size="20"  value="[% borrower_data.pronouns | html UNLESS opduplicate %]" />
403                                                         [% IF ( mandatorypronouns ) %]
404                                                             <span class="required">Required</span>
405                                                         [% END %]
406                                                     </li>
407                                                 [% END # /UNLESS nopronouns %]
408                                             [% END #/UNLESS ( I ) %]
409                                             [% UNLESS noothernames %]
410                                                 <li>
411                                                     [% IF ( mandatoryothernames ) %]
412                                                         <label for="othernames" class="required">
413                                                     [% ELSE %]
414                                                         <label for="othernames">
415                                                     [% END %]
416                                                         Other name:
417                                                     </label>
418                                                     <input type="text" id="othernames" name="othernames" size="20"  value="[% borrower_data.othernames | html UNLESS opduplicate %]" />
419                                                     [% IF ( mandatoryothernames ) %]
420                                                         <span class="required">Required</span>
421                                                     [% END %]
422                                                     [% IF ( patron_category.category_type == 'I' ) %]<input type="hidden" name="sex" value="N" />[% END %]
423                                                 </li>
424                                             [% END #/UNLESS noothernames %]
425
426                                             [% UNLESS ( patron_category.category_type == 'I' ) %]
427                                                 [% UNLESS nosex %]
428                                                     <li class="radio">
429                                                         [% UNLESS ( opduplicate ) %]
430                                                             [% IF ( female ) %]
431                                                                 <label for="sex-female"><input type="radio" name="sex" id="sex-female" value="F" checked="checked" /><span class="patronsex-female"> Female</span></label>
432                                                             [% ELSE %]
433                                                                 <label for="sex-female"><input type="radio" name="sex" id="sex-female" value="F" /><span class="patronsex-female"> Female</span></label>
434                                                             [% END %]
435                                                             [% IF ( male ) %]
436                                                                 <label for="sex-male"><input type="radio" name="sex" id="sex-male" value="M" checked="checked" /><span class="patronsex-male"> Male</span></label>
437                                                             [% ELSE %]
438                                                                 <label for="sex-male"><input type="radio" name="sex" id="sex-male" value="M" /><span class="patronsex-male"> Male</span></label>
439                                                             [% END %]
440                                                             [% IF ( other ) %]
441                                                                 <label for="sex-other"><input type="radio" name="sex" id="sex-other" value="O" checked="checked" /><span class="patronsex-other"> Other</span></label>
442                                                             [% ELSE %]
443                                                                 <label for="sex-other"><input type="radio" name="sex" id="sex-other" value="O" /><span class="patronsex-other"> Other</span></label>
444                                                             [% END %]
445                                                             [% IF ( none ) %]
446                                                                 <label for="sex-none"><input type="radio" name="sex" id="sex-none" value=""  checked="checked" /><span class="patronsex-none"> None specified</span></label>
447                                                             [% ELSE %]
448                                                                 <label for="sex-none"><input type="radio" name="sex" id="sex-none" value="" /><span class="patronsex-none"> None specified</span></label>
449                                                             [% END %]
450                                                         [% ELSE %]
451                                                             <label for="sex-female"><span class="patronsex-female">Female </span></label><input type="radio" name="sex" id="sex-female" value="F" />
452                                                             <label for="sex-male"><span class="patronsex-male">Male </span></label><input type="radio" name="sex" id="sex-male" value="M" />
453                                                             <label for="sex-other"><span class="patronsex-other">Other </span></label><input type="radio" name="sex" id="sex-other" value="O" />
454                                                             <label for="sex-none"><span class="patronsex-none">None specified </span></label><input type="radio" name="sex" id="sex-none" value="" checked="checked" />
455                                                         [% END # /UNLESS ( opduplicate )%]
456                                                     </li>
457                                                 [% END # /UNLESS nosex %]
458                                             [% END # /UNLESS ( I ) %]
459                                         </ol>
460                                     </fieldset> <!-- /#memberentry_identity -->
461                                 [% END # hide fieldset %]
462
463                                 [% IF show_guarantor || guarantor %]
464                                     [% SET possible_relationships = Koha.Preference('borrowerRelationship') %]
465                                     <div id="memberentry_guarantor_anchor">
466                                         <fieldset id="memberentry_guarantor" class="rows">
467                                             <legend>Patron guarantor</legend>
468
469                                             <div id="guarantor_relationships">
470                                                 [% FOREACH r IN relationships %]
471                                                     <fieldset>
472                                                         <ol>
473                                                             [% IF patron_category.category_type == 'I' %]
474                                                                 <li class="guarantor-details" data-borrowernumber="[% r.guarantor_id | $raw %]">
475                                                                     <span class="label">Organization:</span>
476                                                                     [% INCLUDE 'patron-title.inc' patron=r.guarantor hide_patron_infos_if_needed=1 %]
477                                                                 </li>
478                                                                 <li>
479                                                                     <span class="label">Relationship:</span>
480                                                                     <span>[% r.relationship | html %]</span>
481                                                                 </li>
482                                                             [% ELSE %]
483                                                                 <li class="guarantor-details" data-borrowernumber="[% r.guarantor_id | $raw %]">
484                                                                     <span class="label">Guarantor:</span>
485                                                                     [% INCLUDE 'patron-title.inc' patron=r.guarantor hide_patron_infos_if_needed=1 %]
486                                                                 </li>
487                                                                 <li>
488                                                                     <span class="label">Relationship:</span>
489                                                                     <span>[% r.relationship | html %]</span>
490                                                                 </li>
491
492                                                                 <li>
493                                                                     <label for="delete_guarantor-[% r.id | uri %]">Remove: </label>
494                                                                     <input type="checkbox" id="delete_guarantor-[% r.id | uri %]" name="delete_guarantor" value="[% r.id | html %]" />
495                                                                 </li>
496                                                             [% END %]
497                                                         </ol>
498                                                     </fieldset>
499                                                 [% END # END relationships foreach %]
500                                                 [% IF guarantor && (!relationships) %]
501                                                     <fieldset class="guarantor">
502                                                         <ol>
503                                                             <li class="guarantor-details" data-borrowernumber="0">
504                                                                 <span class="label">Guarantor:</span>
505                                                                 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantor.borrowernumber | uri %]" target="blank">[% guarantor.firstname | html %] [% guarantor.surname | html %] ([% guarantor.cardnumber | html %])</a>
506                                                                 <input type="hidden" class="new_guarantor_id" name="new_guarantor_id" value="[% guarantor.borrowernumber | html %]"/>
507                                                             </li>
508
509                                                             [% IF possible_relationships %]
510                                                                 <li>
511                                                                     [% UNLESS empty_relationship_allowed %]
512                                                                         <label for="guarantor_relationship" class="required">Relationship: </label>
513                                                                         <select class="new_guarantor_relationship" name="new_guarantor_relationship" required="required">
514                                                                     [% ELSE %]
515                                                                         <label for="guarantor_relationship">Relationship: </label>
516                                                                         <select class="new_guarantor_relationship" name="new_guarantor_relationship">
517                                                                     [% END %]
518                                                                         <option value="" selected>Empty option</option>
519                                                                         [% FOREACH pr IN possible_relationships.split('\|') %]
520                                                                             [% IF pr != "" %]
521                                                                                 <option value="[% pr | html %]">[% pr | html %]</option>
522                                                                             [% END %]
523                                                                         [% END %]
524                                                                     </select>
525                                                                     [% UNLESS empty_relationship_allowed %]
526                                                                         <span class="required">Required</span>
527                                                                     [% END %]
528                                                                 </li>
529                                                             [% ELSE %]
530                                                                 <input type="hidden" name="new_guarantor_relationship" value="" />
531                                                             [% END %]
532
533                                                             <li>
534                                                                 <label for="guarantor_cancel">&nbsp;</label>
535                                                                 <span><a href="#" class="guarantor_cancel"><i class="fa fa-trash-can" aria-hidden="true"></i> Remove</a></span>
536                                                             </li>
537                                                         </ol>
538                                                     </fieldset>
539                                                 [% END %]
540                                             </div> <!-- #/guarantor_relationships -->
541
542                                             <fieldset class="guarantor" id="guarantor_template">
543                                                 <ol>
544                                                     <li class="guarantor-details" data-borrowernumber="0">
545                                                         <span class="label">Guarantor:</span>
546                                                         <a class="new_guarantor_link" href="#" target="blank">
547                                                             <span class="new_guarantor_firstname_text"></span> <span class="new_guarantor_surname_text"></span>
548                                                             (<span class="new_guarantor_id_text"></span>)
549                                                          </a>
550                                                         <input type="hidden" class="new_guarantor_id" name="new_guarantor_id" value=""/>
551                                                     </li>
552
553                                                     [% IF possible_relationships %]
554                                                         <li>
555                                                             [% UNLESS empty_relationship_allowed %]
556                                                                 <label for="guarantor_relationship" class="required">Relationship: </label>
557                                                                 <select class="new_guarantor_relationship" name="new_guarantor_relationship" required="required">
558                                                             [% ELSE %]
559                                                                 <label for="guarantor_relationship">Relationship: </label>
560                                                                 <select class="new_guarantor_relationship" name="new_guarantor_relationship">
561                                                             [% END %]
562                                                                 <option value="" selected></option>
563                                                                 [% FOREACH pr IN possible_relationships.split('\|') %]
564                                                                     [% IF pr != "" %]
565                                                                         <option value="[% pr | html %]">[% pr | html %]</option>
566                                                                     [% END %]
567                                                                 [% END %]
568                                                             </select>
569                                                             [% UNLESS empty_relationship_allowed %]
570                                                                 <span class="required">Required</span>
571                                                             [% END %]
572                                                         </li>
573                                                     [% ELSE %]
574                                                         <input type="hidden" name="new_guarantor_relationship" value="" />
575                                                     [% END %]
576
577                                                     <li>
578                                                         <label for="guarantor_cancel">&nbsp;</label>
579                                                         <span><a href="#" class="guarantor_cancel"><i class="fa fa-trash-can"></i> Remove</a></span>
580                                                     </li>
581                                                 </ol>
582                                             </fieldset>
583
584                                             <ol>
585                                                 <input type="hidden" id="guarantor_id" value="" />
586                                                 <input name="guarantor_surname" id="guarantor_surname" type="hidden" />
587                                                 <input name="guarantor_firstname" id="guarantor_firstname" type="hidden" />
588
589                                                 <li>
590                                                     <a href="#" id="guarantor_search" class="btn btn-default"><i class="fa fa-plus"></i> Add guarantor</a>
591                                                 </li>
592
593                                                 [% IF Koha.Preference('AllowStaffToSetCheckoutsVisibilityForGuarantor') %]
594                                                     <li>
595                                                         <label for="privacy_guarantor_checkouts">Show checkouts to guarantors:</label>
596                                                         <select name="privacy_guarantor_checkouts" id="privacy_guarantor_checkouts">
597                                                             [% IF borrower_data.privacy_guarantor_checkouts %]
598                                                                 <option value="0">No</option>
599                                                                 <option value="1" selected>Yes</option>
600                                                             [% ELSE %]
601                                                                 <option value="0" selected>No</option>
602                                                                 <option value="1">Yes</option>
603                                                             [% END %]
604                                                         </select>
605                                                         <div class="hint">Allow guarantors of this patron to view this patron's checkouts from the OPAC</div>
606                                                     </li>
607                                                 [% END %]
608                                                 [% IF Koha.Preference('AllowStaffToSetFinesVisibilityForGuarantor') %]
609                                                     <li>
610                                                         <label for="privacy_guarantor_fines">Show charges to guarantors:</label>
611                                                         <select name="privacy_guarantor_fines" id="privacy_guarantor_fines">
612                                                             [% IF borrower_data.privacy_guarantor_fines %]
613                                                                 <option value="0">No</option>
614                                                                 <option value="1" selected>Yes</option>
615                                                             [% ELSE %]
616                                                                 <option value="0" selected>No</option>
617                                                                 <option value="1">Yes</option>
618                                                             [% END %]
619                                                         </select>
620                                                         <div class="hint">Allow guarantors of this patron to view this patron's charges from the OPAC</div>
621                                                     </li>
622                                                 [% END %]
623                                             </ol>
624                                         </fieldset> <!-- /#memberentry_guarantor -->
625                                     </div> <!-- #/memberentry_guarantor_anchor -->
626
627                                     [% UNLESS nocontactname && nocontactfirstname && norelationship %]
628                                         <fieldset class="rows" id="non_patron_guarantor">
629                                             <legend>Non-patron guarantor</legend>
630                                             <ol>
631                                                 [% UNLESS nocontactname %]
632                                                     <li>
633                                                         [% IF ( mandatorycontactname ) %]
634                                                             <label for="contactname" class="required">
635                                                         [% ELSE %]
636                                                             <label for="contactname">
637                                                         [% END %]
638                                                             Guarantor surname:
639                                                         </label>
640                                                         <input type="text" id="contactname" name="contactname" value="[% patron.contactname | html %]" />
641                                                         [% IF ( mandatorycontactname ) %]
642                                                             <span class="required">Required</span>
643                                                         [% END %]
644                                                         <div class="hint">Non-patron guarantor surname</div>
645                                                     </li>
646                                                 [% END # /UNLESS nocontactname %]
647
648                                                 [% UNLESS nocontactfirstname %]
649                                                     <li>
650                                                         [% IF ( mandatorycontactfirstname ) %]
651                                                             <label for="contactfirstname" class="required">
652                                                         [% ELSE %]
653                                                             <label for="contactfirstname">
654                                                         [% END %]
655                                                             Guarantor first name:
656                                                         </label>
657                                                         <input type="text" id="contactfirstname" name="contactfirstname" value="[% patron.contactfirstname | html %]" />
658                                                         [% IF ( mandatorycontactfirstname ) %]
659                                                             <span class="required">Required</span>
660                                                         [% END %]
661                                                         <div class="hint">Non-patron guarantor first name</div>
662                                                     </li>
663                                                 [% END # /UNLESS noaltcontactfirstname %]
664
665                                                 [% UNLESS norelationship %]
666                                                     [% IF possible_relationships %]
667                                                         <li>
668                                                             <label for="relationship">Relationship: </label>
669                                                             <select class="relationship" name="relationship">
670                                                                 <option value=""></option>
671                                                                 [% FOREACH pr IN possible_relationships.split('\|') %]
672                                                                     [% IF pr == borrower_data.relationship %]
673                                                                         <option value="[% pr | html %]" selected="selected">[% pr | html %]</option>
674                                                                     [% ELSE %]
675                                                                         <option value="[% pr | html %]">[% pr | html %]</option>
676                                                                     [% END %]
677                                                                 [% END %]
678                                                             </select>
679                                                         </li>
680                                                     [% END #/IF possible_relationships %]
681                                                 [% END # /UNLESS norelationship %]
682                                             </ol>
683                                         </fieldset> <!-- /#non_patron_guarantor -->
684                                     [% END # /UNLESS nocontactname && nocontactfirstname && norelationship %]
685                                 [% END # /IF show_guarantor || guarantor  %]
686
687                                 [% UNLESS noaddress && noaddress2 && nocity && nostate && nozipcode && nocountry %]
688                                     [% PROCESS 'main-address-style' %]
689                                 [% END # /UNLESS nostreet && nocity etc group%]
690
691                                 [% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %]
692                                     <fieldset class="rows" id="memberentry_contact">
693                                         <legend id="contact_lgd">Contact information</legend>
694                                         <ol>
695                                             [% UNLESS nophone %]
696                                                 <li>
697                                                     [% IF ( mandatoryphone ) %]
698                                                         <label for="phone" class="required">
699                                                     [% ELSE %]
700                                                         <label for="phone">
701                                                     [% END %]
702                                                         Primary phone:
703                                                     </label>
704                                                     <input type="text" id="phone" name="phone" value="[% patron.phone | html %]" />
705                                                     [% IF ( mandatoryphone ) %]
706                                                         <span class="required">Required</span>
707                                                     [% END %]
708                                                     <div class="hint">Shows on transit slips</div>
709                                                 </li>
710                                             [% END # /UNLESS nophone %]
711
712                                             [% UNLESS nophonepro %]
713                                                 <li>
714                                                     [% IF ( mandatoryphonepro ) %]
715                                                         <label for="phonepro" class="required">
716                                                     [% ELSE %]
717                                                         <label for="phonepro">
718                                                     [% END %]
719                                                         Secondary phone:
720                                                     </label>
721                                                     <input type="text" id="phonepro" name="phonepro" value="[% patron.phonepro | html %]" />
722                                                     [% IF ( mandatoryphonepro ) %]
723                                                         <span class="required">Required</span>
724                                                     [% END %]
725                                                 </li>
726                                             [% END # /UNLESS nophonepro %]
727
728                                             [% UNLESS nomobile %]
729                                                 <li>
730                                                     [% IF ( mandatorymobile ) %]
731                                                         <label for="mobile" class="required">
732                                                     [% ELSE %]
733                                                         <label for="mobile">
734                                                     [% END %]
735                                                         Other phone:
736                                                     </label>
737                                                     <input type="text" id="mobile" name="mobile" value="[% patron.mobile | html %]" />
738                                                     [% IF ( mandatorymobile ) %]
739                                                         <span class="required">Required</span>
740                                                     [% END %]
741                                                 </li>
742                                             [% END # /UNLESS nomobile %]
743
744                                             [% UNLESS noemail %]
745                                                 <li>
746                                                     [% IF ( mandatoryemail ) %]
747                                                         <label for="email" class="required">
748                                                     [% ELSE %]
749                                                         <label for="email">
750                                                     [% END %]
751                                                         Primary email:
752                                                     </label>
753                                                     [% IF ( NoUpdateEmail ) %]
754                                                     <input type="text" id="email" name="email" size="45" value="[% patron.email | html %]" disabled="disabled" />
755                                                     [% ELSE %]
756                                                     <input type="text" id="email" name="email" size="45" value="[% patron.email | html %]" />
757                                                     [% END %]
758                                                     [% IF ( mandatoryemail ) %]
759                                                         <span class="required">Required</span>
760                                                     [% END %]
761                                                     <div class="hint">Shows on transit slips</div>
762                                                 </li>
763                                             [% END #/UNLESS noemail %]
764
765                                             [% UNLESS noemailpro %]
766                                                 <li>
767                                                     [% IF ( mandatoryemailpro ) %]
768                                                         <label for="emailpro" class="required">
769                                                     [% ELSE %]
770                                                         <label for="emailpro">
771                                                     [% END %]
772                                                         Secondary email:
773                                                     </label>
774                                                     [% IF ( NoUpdateEmail ) %]
775                                                     <input type="text" id="emailpro" name="emailpro" size="45" value="[% patron.emailpro | html %]" disabled="disabled"/>
776                                                     [% ELSE %]
777                                                     <input type="text" id="emailpro" name="emailpro" size="45" value="[% patron.emailpro | html %]" />
778                                                     [% END %]
779                                                     [% IF ( mandatoryemailpro ) %]
780                                                         <span class="required">Required</span>
781                                                     [% END %]
782                                                 </li>
783                                             [% END #/UNLESS noemailpro %]
784
785                                             [% UNLESS nofax %]
786                                                 <li>
787                                                     [% IF ( mandatoryfax ) %]
788                                                         <label for="fax" class="required">
789                                                     [% ELSE %]
790                                                         <label for="fax">
791                                                     [% END %]
792                                                         Fax:
793                                                     </label>
794                                                     <input type="text" id="fax" name="fax" value="[% patron.fax | html %]" />
795                                                     [% IF ( mandatoryfax ) %]
796                                                         <span class="required">Required</span>
797                                                     [% END %]
798                                                 </li>
799                                             [% END #/UNLESS nofax %]
800
801                                             [% UNLESS noprimary_contact_method %]
802                                                 <li>
803                                                     [% IF mandatoryprimary_contact_method %]
804                                                         <label for="primary_contact_method" class="required">
805                                                     [% ELSE %]
806                                                         <label for="primary_contact_method">
807                                                     [% END %]
808                                                     Main contact method: </label>
809
810                                                     <select id="primary_contact_method" name="primary_contact_method">
811                                                         <option value=""></option>
812                                                         [% UNLESS nophone %]
813                                                             [% IF ( borrower_data.primary_contact_method == 'phone' ) %]
814                                                                 <option value="phone" selected="selected">Primary phone</option>
815                                                             [% ELSE %]
816                                                                 <option value="phone">Primary phone</option>
817                                                             [% END %]
818                                                         [% END %]
819                                                         [% UNLESS nophonepro %]
820                                                             [% IF ( borrower_data.primary_contact_method == 'phonepro' ) %]
821                                                                 <option value="phonepro" selected="selected">Secondary phone</option>
822                                                             [% ELSE %]
823                                                                 <option value="phonepro">Secondary phone</option>
824                                                             [% END %]
825                                                         [% END %]
826                                                         [% UNLESS nomobile %]
827                                                             [% IF ( borrower_data.primary_contact_method == 'mobile' ) %]
828                                                                 <option value="mobile" selected="selected">Other phone</option>
829                                                             [% ELSE %]
830                                                                 <option value="mobile">Other phone</option>
831                                                             [% END %]
832                                                         [% END %]
833                                                         [% UNLESS noemail %]
834                                                             [% IF ( borrower_data.primary_contact_method == 'email' ) %]
835                                                                 <option value="email" selected="selected">Primary email</option>
836                                                             [% ELSE %]
837                                                                 <option value="email">Primary email</option>
838                                                             [% END %]
839                                                         [% END %]
840                                                         [% UNLESS noemailpro %]
841                                                             [% IF ( borrower_data.primary_contact_method == 'emailpro' ) %]
842                                                                 <option value="emailpro" selected="selected">Secondary email</option>
843                                                             [% ELSE %]
844                                                                 <option value="emailpro">Secondary email</option>
845                                                             [% END %]
846                                                         [% END %]
847                                                         [% UNLESS nofax %]
848                                                             [% IF ( borrower_data.primary_contact_method == 'fax' ) %]
849                                                                 <option value="fax" selected="selected">Fax</option>
850                                                             [% ELSE %]
851                                                                 <option value="fax">Fax</option>
852                                                             [% END %]
853                                                         [% END %]
854                                                     </select>
855                                                     [% IF mandatoryprimary_contact_method %]
856                                                         <span class="required">Required</span>
857                                                     [% END %]
858                                                 </li>
859                                             [% END %]
860                                         </ol>
861                                     </fieldset> <!-- /#memberentry_contact -->
862                                 [% END # hide fieldset %]
863
864                                 <!-- ************************ STEP_1 *********************** -->
865                             [% END # /IF ( step_1 ) %]
866
867                             [% IF ( step_6 ) %]
868                                 [% UNLESS noB_address && noB_address2 && noB_city && noB_zipcode && noB_state && noB_country &&nocontactnote && noB_phone && noB_email %]
869                                     [% PROCESS 'alt-address-style' %]
870                                 [% END # UNLESS noB_address && noB_city && noB_state && noB_phone && noB_email %]
871                             [% END # /IF ( step_6 ) %]
872
873                             [% IF ( step_2 ) %]
874                                 [% UNLESS noaltcontactsurname && noaltcontactfirstname && noaltcontactaddress1 && noaltcontactaddress2 && noaltcontactaddress3 && noaltcontactstate && noaltcontactzipcode && noaltcontactcountry && noaltcontactphone %]
875                                     [% PROCESS 'alt-contact-style' %]
876                                 [% END # UNLESS noaltcontactsurname && noaltcontactfirstname etc %]
877                             [% END # /IF ( step_2 ) %]
878
879                             [% IF ( step_3 ) %]
880                                 [% SET autoMemberNum = Koha.Preference('autoMemberNum') %]
881                                 <fieldset class="rows" id="memberentry_library_management">
882                                     <legend id="library_management_lgd">Library management</legend>
883                                     <ol>
884                                         [% UNLESS nocardnumber %]
885                                             <li>
886                                                 [% IF mandatorycardnumber %]
887                                                     <label for="cardnumber" class="required">
888                                                 [% ELSE %]
889                                                     <label for="cardnumber" class="validated">
890                                                 [% END %]
891                                                     Card number:
892                                                 </label>
893
894                                                 <!-- NOTE: div.hint closing tag isn't on the same line -->
895                                                 [% IF minlength_cardnumber == maxlength_cardnumber %]
896                                                     <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% borrower_data.cardnumber | html %]" minlength="[% minlength_cardnumber | html %]" maxlength="[% maxlength_cardnumber | html %]" />
897                                                     [% IF mandatorycardnumber %]
898                                                         <span class="required">Required</span>
899                                                     [% END %]
900                                                     <span id="cn_max" class="required">Card number must not be more than [% maxlength_cardnumber | html %] characters.</span>
901                                                     <div class="hint">Card number must be exactly [% minlength_cardnumber | html %] characters.
902                                                 [% ELSIF minlength_cardnumber && maxlength_cardnumber %]
903                                                     <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% borrower_data.cardnumber | html %]" minlength="[% minlength_cardnumber | html %]" maxlength="[% maxlength_cardnumber | html %]" />
904                                                     [% IF mandatorycardnumber %]
905                                                         <span class="required">Required</span>
906                                                     [% END %]
907                                                     <span id="cn_max" class="required">Card number must not be more than [% maxlength_cardnumber | html %] characters.</span>
908                                                     <div class="hint">Card number must be between [% minlength_cardnumber | html %] and [% maxlength_cardnumber | html %] characters.
909                                                 [% ELSIF maxlength_cardnumber %]
910                                                     <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% borrower_data.cardnumber | html %]" maxlength="[% maxlength_cardnumber | html %]" />
911                                                     [% IF mandatorycardnumber %]
912                                                         <span class="required">Required</span>
913                                                     [% END %]
914                                                     <span id="cn_max" class="required">Card number must not be more than [% maxlength_cardnumber | html %] characters.</span>
915                                                     <div class="hint">Card number can be up to [% maxlength_cardnumber | html %] characters.
916                                                 [% ELSE %]
917                                                     <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% borrower_data.cardnumber | html %]" />
918                                                     [% IF mandatorycardnumber %]
919                                                         <span class="required">Required</span>
920                                                     [% END %]
921                                                     <div class="hint">There is no minimum or maximum character length.
922                                                 [% END %]
923                                                 [% IF autoMemberNum %]
924                                                     [% IF mandatorycardnumber %]
925                                                         <br/><span class="error">autoMemberNum is set to enabled, but card number is marked as mandatory in BorrowerMandatoryField: auto calc has been disabled.</span>
926                                                     [% ELSE %]
927                                                         <br/>Leave blank for auto calc during registration
928                                                     [% END %]
929                                                 [% END %]
930                                                 </div><!--/div.hint -->
931                                             </li>
932                                         [% END # /UNLESS nocardnumber %]
933
934                                         [% UNLESS nobranchcode %]
935                                             <li>
936                                                 <label for="libraries" class="required">Library:</label>
937                                                 <select name="branchcode" id="libraries">
938                                                     [% PROCESS options_for_libraries libraries => Branches.all( selected => userbranch, only_from_group => 1 ) %]
939                                                 </select>
940                                                 <span class="required">Required</span>
941                                             </li>
942                                         [% END %]
943
944                                         <li>
945                                             <label for="categorycode_entry" class="required">Category: </label>
946                                             <select id="categorycode_entry" name="categorycode">
947                                                 [% FOREACH category_type IN patron_categories.keys %]
948                                                     [% SWITCH category_type %]
949                                                     [% CASE 'C' %]
950                                                         <optgroup label="Child">
951                                                     [% CASE 'A' %]
952                                                         <optgroup label="Adult">
953                                                     [% CASE 'S' %]
954                                                         <optgroup label="Staff">
955                                                     [% CASE 'I' %]
956                                                         <optgroup label="Organization">
957                                                     [% CASE 'P' %]
958                                                         <optgroup label="Professional">
959                                                     [% CASE 'X' %]
960                                                         <optgroup label="Statistical">
961                                                     [% CASE %]
962                                                         <optgroup label="Unknown">
963                                                     [% END %]
964                                                     [% FOREACH category IN patron_categories.$category_type %]
965                                                         [% IF category.categorycode == patron_category.categorycode %]
966                                                             <option value="[% category.categorycode | html %]" selected="selected" data-pwd-length="[% category.effective_min_password_length | html %]" data-pwd-strong="[% category.effective_require_strong_password | html %]" data-typename="[% category_type | html %]">[% category.description | html %]</option>
967                                                         [% ELSE %]
968                                                             <option value="[% category.categorycode | html %]" data-pwd-length="[% category.effective_min_password_length | html %]" data-pwd-strong="[% category.effective_require_strong_password | html %]" data-typename="[% category_type | html %]">[% category.description | html %]</option>
969                                                         [% END %]
970                                                     [% END %]
971                                                         </optgroup>
972                                                 [% END %]
973                                             </select>
974                                             [% IF limited_category %]
975                                                 <span style="float:right;" title="The patron's current category ([% patron_category.description | html %]) is limited to other libraries"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i></span>
976                                             [% END %]
977                                             <span class="required">Required</span>
978                                         </li>
979
980                                         [% UNLESS nosort1 %]
981                                             <li>
982                                                 [% IF ( mandatorysort1 ) %]
983                                                     <label for="sort1" class="required">
984                                                 [% ELSE %]
985                                                     <label for="sort1">
986                                                 [% END %]
987                                                     Sort 1:
988                                                 </label>
989                                                 [% PROCESS 'av-build-dropbox.inc' name="sort1", category="Bsort1", default=borrower_data.sort1, empty=1, size = 20 %]
990                                                 [% IF ( mandatorysort1 ) %]
991                                                     <span class="required">Required</span>
992                                                 [% END %]
993                                             </li>
994                                         [% END # /UNLESS nosort1 %]
995
996                                         [% UNLESS nosort2 %]
997                                             <li>
998                                                 [% IF ( mandatorysort2 ) %]
999                                                     <label for="sort2" class="required">
1000                                                 [% ELSE %]
1001                                                     <label for="sort2">
1002                                                 [% END %]
1003                                                     Sort 2:
1004                                                 </label>
1005                                                 [% PROCESS 'av-build-dropbox.inc' name="sort2", category="Bsort2", default=borrower_data.sort2, empty=1, size = 20 %]
1006                                                 [% IF ( mandatorysort2 ) %]
1007                                                     <span class="required">Required</span>
1008                                                 [% END %]
1009                                             </li>
1010                                         [% END # /UNLESS nosort2 %]
1011
1012                                         [% UNLESS noautorenew_checkouts %]
1013                                             <li class="radio">
1014                                                 <label for="yes-autorenew_checkouts">
1015                                                     Allow auto-renewal of items:
1016                                                 </label>
1017                                                     [% IF ( borrower_data.autorenew_checkouts || opadd ) %]
1018                                                         <label for="yes-autorenew_checkouts">
1019                                                             Yes
1020                                                             <input type="radio" id="yes-autorenew_checkouts" name="autorenew_checkouts" value="1" checked="checked" />
1021                                                         </label>
1022                                                         <label for="no-autorenew_checkouts">
1023                                                             No
1024                                                             <input type="radio" id="no-autorenew_checkouts" name="autorenew_checkouts" value="0" />
1025                                                         </label>
1026                                                     [% ELSE %]
1027                                                         <label for="yes-autorenew_checkouts">
1028                                                             Yes
1029                                                             <input type="radio" id="yes-autorenew_checkouts" name="autorenew_checkouts" value="1" />
1030                                                         </label>
1031                                                         <label for="no-autorenew_checkouts">
1032                                                             No
1033                                                             <input type="radio" id="no-autorenew_checkouts" name="autorenew_checkouts" value="0" checked="checked" />
1034                                                         </label>
1035                                                     [% END %]
1036                                             </li>
1037                                         [% END %]
1038
1039                                         <li class="radio">
1040                                             <label for="protected">Protected:</label>
1041                                             [% IF ( patron.protected == 1 ) %]
1042                                                 <label for="yes-protected">
1043                                                     Yes
1044                                                     <input type="radio" id="yes-protected" name="protected" value="1" checked="checked" />
1045                                                 </label>
1046                                                 <label for="no-protected">
1047                                                     No
1048                                                     <input type="radio" id="no-protected" name="protected" value="0" />
1049                                                 </label>
1050                                             [% ELSE %]
1051                                                 <label for="yes-protected">
1052                                                     Yes
1053                                                     <input type="radio" id="yes-protected" name="protected" value="1" />
1054                                                 </label>
1055                                                 <label for="no-protected">
1056                                                     No
1057                                                     <input type="radio" id="no-protected" name="protected" value="0" checked="checked" />
1058                                                 </label>
1059                                             [% END %]
1060                                         </li>
1061
1062                                         [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
1063                                             <li>
1064                                                 <label for="checkprevcheckout">Check for previous checkouts: </label>
1065                                                 <select name="checkprevcheckout" id="checkprevcheckout">
1066                                                     [% IF ( borrower_data.checkprevcheckout == 'yes' ) %]
1067                                                         <option value="yes" selected="selected">Yes if settings allow it</option>
1068                                                         <option value="no">No if settings allow it</option>
1069                                                         <option value="inherit">Inherit from settings</option>
1070                                                     [% ELSIF ( borrower_data.checkprevcheckout == 'no' ) %]
1071                                                         <option value="yes">Yes if settings allow it</option>
1072                                                         <option value="no" selected="selected">No if settings allow it</option>
1073                                                         <option value="inherit">Inherit from settings</option>
1074                                                     [% ELSE %]
1075                                                         <option value="yes">Yes if settings allow it</option>
1076                                                         <option value="no">No if settings allow it</option>
1077                                                         <option value="inherit" selected="selected">Inherit from settings</option>
1078                                                     [% END %]
1079                                                 </select>
1080                                             </li>
1081                                         [% END # /IF ( Koha.Preference('CheckPrevCheckout') %]
1082
1083                                         [% IF Koha.Preference('TranslateNotices') %]
1084                                             <li>
1085                                                 <label for="lang">Preferred language for notices: </label>
1086                                                 <select id="lang" name="lang">
1087                                                     <option value="default">Default</option>
1088                                                     [% FOR language IN languages %]
1089                                                         [% FOR sublanguage IN language.sublanguages_loop %]
1090                                                             [% IF language.plural %]
1091                                                                 [% IF sublanguage.rfc4646_subtag == borrower_data.lang %]
1092                                                                     <option value="[% sublanguage.rfc4646_subtag | html %]" selected="selected">[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
1093                                                                 [% ELSE %]
1094                                                                     <option value="[% sublanguage.rfc4646_subtag | html %]">[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
1095                                                                 [% END %]
1096                                                             [% ELSE %]
1097                                                                 [% IF sublanguage.rfc4646_subtag == borrower_data.lang %]
1098                                                                     <option value="[% sublanguage.rfc4646_subtag | html %]" selected="selected">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
1099                                                                 [% ELSE %]
1100                                                                     <option value="[% sublanguage.rfc4646_subtag | html %]">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
1101                                                                 [% END %]
1102                                                             [% END # /IF language.plural %]
1103                                                         [% END # /FOR sublanguage %]
1104                                                     [% END #/FOR language %]
1105                                                 </select> <!-- /#lang -->
1106                                             </li>
1107                                         [% END #/IF Koha.Preference('TranslateNotices') %]
1108                                     </ol>
1109                                 </fieldset> <!-- /#memberentry_library_management -->
1110
1111                                 [% UNLESS nodateenrolled &&  noopacnote && noborrowernotes %]
1112                                     <fieldset class="rows" id="memberentry_subscription">
1113                                         <legend id="library_setup_lgd">Library setup</legend><ol>
1114                                         [% UNLESS nodateenrolled %]
1115                                             <li>
1116                                                 [% IF ( mandatorydateenrolled ) %]
1117                                                     <label for="from" class="required">
1118                                                 [% ELSE %]
1119                                                     <label for="from">
1120                                                 [% END %]
1121                                                     Registration date:
1122                                                 </label>
1123                                                 <input type="text" id="from" name="dateenrolled"  maxlength="10" size="10" value="[% borrower_data.dateenrolled | html %]" class="flatpickr" data-date_to="to" />
1124                                                 [% IF ( mandatorydateenrolled ) %]
1125                                                     <span class="required">Required</span>
1126                                                 [% END %]
1127                                                 [% IF ( ERROR_dateenrolled ) %]
1128                                                     <span class="required">(Error)</span>
1129                                                 [% END %]
1130                                                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
1131                                             </li>
1132                                         [% END # /UNLESS nodateenrolled %]
1133
1134                                         [% UNLESS nodateexpiry %]
1135                                             <li>
1136                                         [% ELSE %]
1137                                             <li style="display:none">
1138                                         [% END %]
1139                                             [% IF ( mandatorydateexpiry ) %]
1140                                                 <label for="to" class="required">
1141                                             [% ELSE %]
1142                                                 <label for="to">
1143                                             [% END %]
1144                                                     Expiry date (leave blank for auto calc):
1145                                                 </label>
1146                                                 [% UNLESS ( opadd ) %]
1147                                                     <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" value="[% borrower_data.dateexpiry | html UNLESS opduplicate %]" class="flatpickr" />
1148                                                 [% ELSE %]
1149                                                     <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" value="[% borrower_data.dateexpiry | html %]" class="flatpickr" />
1150                                                 [% END %]
1151                                                 [% IF ( mandatorydateexpiry ) %]
1152                                                     <span class="required">Required</span>
1153                                                 [% END %]
1154                                                 [% IF ( ERROR_dateexpiry ) %]
1155                                                     <span class="required">(Error)</span>
1156                                                 [% END %]
1157                                                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
1158                                             </li>
1159
1160                                             [% UNLESS noopacnote %]
1161                                                 <li>
1162                                                     [% IF ( mandatoryopacnote ) %]
1163                                                         <label for="opacnote" class="required">
1164                                                     [% ELSE %]
1165                                                         <label for="opacnote">
1166                                                     [% END %]
1167                                                         OPAC note:
1168                                                     </label>
1169                                                     <textarea id="opacnote" name="opacnote" cols="55" rows="5">[% borrower_data.opacnote | html UNLESS opduplicate %]</textarea>
1170                                                     <div class="hint">This message appears on this patron's user page in the OPAC</div>
1171                                                     [% IF ( mandatoryopacnote ) %]
1172                                                         <span class="required">Required</span>
1173                                                     [% END %]
1174                                                 </li>
1175                                             [% END # /UNLESS noopacnote %]
1176
1177                                             [% UNLESS noborrowernotes %]
1178                                                 <li>
1179                                                     [% IF ( mandatoryborrowernotes ) %]
1180                                                         <label for="borrowernotes" class="required">
1181                                                     [% ELSE %]
1182                                                         <label for="borrowernotes">
1183                                                     [% END %]
1184                                                         Circulation note:
1185                                                     </label>
1186                                                     <textarea id="borrowernotes" name="borrowernotes" cols="55" rows="5">[% borrower_data.borrowernotes | $raw UNLESS opduplicate %]</textarea>
1187                                                     <div class="hint">This message displays when checking out to this patron</div>
1188                                                     [% IF ( mandatoryborrowernotes ) %]
1189                                                         <span class="required">Required</span>
1190                                                     [% END %]
1191                                                 </li>
1192                                             [% END # /UNLESS noborrowernotes %]
1193                                         </ol>
1194                                     </fieldset> <!-- /#memberentry_subscription -->
1195                                 [% END # hide fieldset %]
1196
1197                                 [% UNLESS nouserid && nopassword && !CanUpdatePasswordExpiration %]
1198                                     <fieldset class="rows" id="memberentry_userid">
1199                                         <legend id="opac_staff_login_lgd">OPAC/Staff interface login</legend>
1200                                         <ol>
1201                                             [% UNLESS nouserid %]
1202                                                 <li>
1203                                                     [% IF ( mandatoryuserid ) %]
1204                                                         <label for="userid" class="required">
1205                                                     [% ELSE %]
1206                                                         <label for="userid">
1207                                                     [% END %]
1208                                                         Username:
1209                                                     </label>
1210
1211                                                     [% IF ( NoUpdateLogin ) %]
1212                                                         [% IF ( opduplicate ) %]
1213                                                             <input type="text" id="userid" name="userid" size="20" disabled="disabled" />
1214                                                         [% ELSE %]
1215                                                             <input type="text" id="userid" name="userid" size="20" disabled="disabled" value="[% borrower_data.userid | html %]" />
1216                                                         [% END %]
1217                                                     [% ELSE %]
1218                                                         [% IF ( opduplicate ) %]
1219                                                             <input type="text" id="userid" name="userid" size="20" value="" />
1220                                                         [% ELSE %]
1221                                                             <input type="text" id="userid" name="userid" size="20" value="[% borrower_data.userid | html %]" />
1222                                                         [% END %]
1223                                                     [% END # /IF ( NoUpdateLogin ) %]
1224
1225                                                     [%# Dummy input to avoid Firefox from using userid/password saved for authentication %]
1226                                                     <input type="text" disabled="disabled" style="display:none" />
1227
1228                                                     [% IF ( mandatoryuserid ) %]
1229                                                         <span class="required">Required</span>
1230                                                     [% END %]
1231                                                 </li>
1232                                             [% END # /UNLESS nouserid %]
1233
1234                                             [% UNLESS nopassword %]
1235                                                 <li>
1236                                                     [% IF ( mandatorypassword ) %]
1237                                                         <label for="password" class="required">
1238                                                     [% ELSE %]
1239                                                         <label for="password">
1240                                                     [% END %]
1241                                                         Password:
1242                                                     </label>
1243                                                     [% IF ( opadd ) %]
1244                                                         [% IF ( NoUpdateLogin ) %]
1245                                                             [% IF ( opduplicate ) %]
1246                                                                 <input type="password" id="password" name="password" size="20"  disabled="disabled" />
1247                                                             [% ELSE %]
1248                                                                 <input type="password" id="password" name="password" size="20"  disabled="disabled" value="[% borrower_data.password | html %]" />
1249                                                             [% END %]
1250                                                         [% ELSE %]
1251                                                             [% IF ( opduplicate ) %]
1252                                                                 <input type="password" id="password" name="password" size="20" autocomplete="new-password" />
1253                                                             [% ELSE %]
1254                                                                 <input type="password" id="password" name="password" size="20" autocomplete="new-password" value="[% borrower_data.password | html %]" />
1255                                                             [% END %]
1256                                                         [% END # /IF ( NoUpdateLogin ) %]
1257                                                     [% ELSE # IF ( opadd ) %]
1258
1259                                                         [% IF ( borrower_data.password ) %]
1260                                                             [% IF ( NoUpdateLogin ) %]
1261                                                                 <input type="password" id="password" name="password" size="20"  disabled="disabled" value="****" />
1262                                                             [% ELSE %]
1263                                                                 [% IF ( opduplicate ) %]
1264                                                                     <input type="password" id="password" name="password" autocomplete="new-password" size="20" />
1265                                                                 [% ELSE %]
1266                                                                     <input type="password" id="password" name="password" size="20" value="****" />
1267                                                                 [% END %]
1268                                                             [% END %]
1269                                                         [% ELSE %]
1270                                                             [% IF ( NoUpdateLogin ) %]
1271                                                                 <input type="password" id="password" name="password" size="20"  disabled="disabled" value="" />
1272                                                             [% ELSE %]
1273                                                                 <input type="password" id="password" name="password" size="20" autocomplete="new-password" value="" />
1274                                                             [% END %]
1275                                                         [% END # /IF ( password ) %]
1276                                                     [% END # /IF ( opadd )  %]
1277                                                     [% IF ( mandatorypassword ) %]
1278                                                         <span class="required">Required</span>
1279                                                     [% END %]
1280                                                     [% IF ( ERROR_password_too_short ) %]
1281                                                         <span class="required">Password is too short</span>
1282                                                     [% END %]
1283                                                     [% IF ( ERROR_password_too_weak ) %]
1284                                                         <span class="required">Password is too weak</span>
1285                                                     [% END %]
1286                                                     [% IF ( ERROR_password_has_whitespaces ) %]
1287                                                         <span class="required">Password has leading or trailing whitespaces</span>
1288                                                     [% END %]
1289                                                     <div class="hint">Minimum password length: [% patron.category.effective_min_password_length | html %]</div>
1290                                                 </li>
1291
1292                                                 <li>
1293                                                     [% IF ( mandatorypassword ) %]
1294                                                         <label for="password2" class="required">
1295                                                     [% ELSE %]
1296                                                         <label for="password2">
1297                                                     [% END %]
1298                                                         Confirm password:
1299                                                     </label>
1300                                                     [% IF ( opadd ) %]
1301                                                         [% IF ( NoUpdateLogin ) %]
1302                                                             [% IF ( opduplicate ) %]
1303                                                                 <input type="password" id="password2" name="password2" size="20"  disabled="disabled" />
1304                                                             [% ELSE %]
1305                                                                 <input type="password" id="password2" name="password2" size="20"  disabled="disabled" value="[% borrower_data.password | html %]" />
1306                                                             [% END %]
1307                                                         [% ELSE %]
1308                                                             [% IF ( opduplicate ) %]
1309                                                                 <input type="password" id="password2" name="password2" size="20" />
1310                                                             [% ELSE %]
1311                                                                 <input type="password" id="password2" name="password2" size="20" value="[% borrower_data.password | html %]" />
1312                                                             [% END %]
1313                                                         [% END %]
1314                                                     [% ELSE # IF ( opadd ) %]
1315                                                         [% IF ( borrower_data.password ) %]
1316                                                             [% IF ( NoUpdateLogin ) %]
1317                                                                 <input type="password" id="password2" name="password2" size="20"  disabled="disabled" value="****" />
1318                                                             [% ELSE %]
1319                                                                 [% IF ( opduplicate ) %]
1320                                                                     <input type="password" id="password2" name="password2" size="20" />
1321                                                                 [% ELSE %]
1322                                                                     <input type="password" id="password2" name="password2" size="20" value="****" />
1323                                                                 [% END %]
1324                                                             [% END %]
1325                                                         [% ELSE %]
1326                                                             [% IF ( NoUpdateLogin ) %]
1327                                                                 <input type="password" id="password2" name="password2" size="20"  disabled="disabled" value="" />
1328                                                             [% ELSE %]
1329                                                                 <input type="password" id="password2" name="password2" size="20" value="" />
1330                                                             [% END %]
1331                                                         [% END %]
1332                                                     [% END # /IF ( opadd ) %]
1333
1334                                                     [% IF ( mandatorypassword ) %]
1335                                                         <span class="required">Required</span>
1336                                                     [% END %]
1337                                                     [% IF ( ERROR_password_mismatch ) %]
1338                                                         <span class="required">Passwords do not match</span>
1339                                                     [% END %]
1340                                                 </li>
1341                                             [% END # /UNLESS nopassword %]
1342                                             [% UNLESS ( !CanUpdatePasswordExpiration ) %]
1343                                                 <li>
1344                                                     <label for="password_expiration_date">Password expiration date:</label>
1345                                                     <input type="text" id="password_expiration_date" name="password_expiration_date" maxlength="10" size="10" value="[% password_expiration_date | html %]" class="flatpickr" />
1346                                                 </li>
1347                                             [% END %]
1348                                         </ol>
1349                                     </fieldset> <!-- /#memberentry_userid -->
1350                                 [% END # UNLESS nouserid && nopassword && !CanUpdatePasswordExpiration %]
1351
1352                                 <!--this zones are not necessary in modif mode -->
1353                                 [% UNLESS ( opadd || opduplicate || ( nogonenoaddress && nolost ) ) %]
1354                                     <fieldset class="rows" id="memberentry_account_flags">
1355                                         <legend id="account_flags_lgd">Patron account flags</legend>
1356                                         <p>Setting a value here will prevent patron from circulating materials and placing holds on the OPAC</p>
1357                                         <ol class="radio">
1358                                             [% UNLESS nogonenoaddress %]
1359                                                 <li>
1360                                                     [% IF mandatorygonenoaddress %]
1361                                                         <label class="radio required" for="yesgonenoaddress">
1362                                                     [% ELSE %]
1363                                                         <label class="radio" for="yesgonenoaddress">
1364                                                     [% END %]
1365                                                         Gone no address:
1366                                                     </label>
1367                                                     [% IF CAN_user_circulate_manage_restrictions %]
1368                                                         <label for="yesgonenoaddress">
1369                                                             [% IF ( borrower_data.gonenoaddress ) %]
1370                                                                 <input type="radio" id="yesgonenoaddress" name="gonenoaddress" value="1" checked="checked" />
1371                                                             [% ELSE %]
1372                                                                 <input type="radio" id="yesgonenoaddress" name="gonenoaddress" value="1" />
1373                                                             [% END %]
1374                                                                 Yes
1375                                                         </label>
1376                                                         <label for="nogonenoaddress">
1377                                                             [% IF ( borrower_data.gonenoaddress ) %]
1378                                                                 <input type="radio" id="nogonenoaddress" name="gonenoaddress" value="0" />
1379                                                             [% ELSE %]
1380                                                                 <input type="radio" id="nogonenoaddress" name="gonenoaddress" value="0" checked="checked"/>
1381                                                             [% END %]
1382                                                                 No
1383                                                         </label>
1384                                                     [% ELSE %]
1385                                                         [% IF borrower_data.gonenoaddress %]<span>Yes</span>[% ELSE %]<span>No</span>[% END %]
1386                                                     [% END # /IF CAN_user_circulate_manage_restrictions %]
1387                                                     [% IF mandatorygonenoaddress %]
1388                                                         <span class="required">Required</span>
1389                                                     [% END %]
1390                                                 </li>
1391
1392                                             [% END # /UNLESS nogonenoaddress %]
1393                                             [% UNLESS nolost %]
1394                                                 <li>
1395                                                     [% IF mandatorylost %]
1396                                                         <label class="radio required" for="yeslost">
1397                                                     [% ELSE %]
1398                                                         <label class="radio" for="yeslost">
1399                                                     [% END %]
1400                                                         Lost card:
1401                                                     </label>
1402                                                     [% IF CAN_user_circulate_manage_restrictions %]
1403                                                         <label for="yeslost">
1404                                                             [% IF ( borrower_data.lost ) %]
1405                                                                 <input type="radio" id="yeslost" name="lost" value="1" checked="checked" />
1406                                                             [% ELSE %]
1407                                                                 <input type="radio" id="yeslost" name="lost" value="1" />
1408                                                             [% END %]
1409                                                                 Yes
1410                                                         </label>
1411                                                         <label for="nolost">
1412                                                             [% IF ( borrower_data.lost ) %]
1413                                                                 <input type="radio" id="nolost" name="lost" value="0" />
1414                                                             [% ELSE %]
1415                                                                 <input type="radio" id="nolost" name="lost" value="0" checked="checked"/>
1416                                                             [% END %]
1417                                                                 No
1418                                                         </label>
1419                                                     [% ELSE %]
1420                                                         [% IF borrower_data.lost %]<span>Yes</span>[% ELSE %]<span>No</span>[% END %]
1421                                                     [% END # /IF CAN_user_circulate_manage_restrictions %]
1422                                                     [% IF mandatorylost %]
1423                                                         <span class="required">Required</span>
1424                                                     [% END %]
1425                                                 </li>
1426                                             [% END # /UNLESS nogonenoaddress %]
1427                                         </ol>
1428                                     </fieldset> <!-- /#memberentry_account_flags -->
1429                                 [% END %]
1430                                     <fieldset class="rows" id="memberentry_restrictions">
1431                                         <legend id="restrictions_lgd">Patron restrictions</legend>
1432                                         [% IF ( patron.restrictions.count ) %]
1433                                             <table>
1434                                                 <thead>
1435                                                     <tr>
1436                                                          <th>Type</th>
1437                                                          <th>Comment</th>
1438                                                          <th>Expiration</th>
1439                                                          <th>[% tp('patron restriction created on', 'Created') | html %]</th>
1440                                                          [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
1441                                                            <th>Remove?</th>
1442                                                          [% END %]
1443                                                     </tr>
1444                                                 </thead>
1445                                                 <tbody>
1446                                                     [% FOREACH restriction IN patron.restrictions %]
1447                                                         <tr>
1448                                                             <td>[% PROCESS restriction_type_description restriction_type=restriction.type %]</td>
1449                                                             <td>
1450                                                                 [% IF restriction.comment.search('OVERDUES_PROCESS') %]
1451                                                                     Restriction added by overdues process [% restriction.comment.remove('OVERDUES_PROCESS ') | $raw %]
1452                                                                 [% ELSE %]
1453                                                                     [% restriction.comment | $raw %]
1454                                                                 [% END %]
1455                                                             </td>
1456                                                             <td>
1457                                                                 [% IF restriction.expiration %]
1458                                                                     [% restriction.expiration | $KohaDates %]
1459                                                                 [% ELSE %]
1460                                                                     <em>Indefinite</em>
1461                                                                 [% END %]
1462                                                             </td>
1463                                                             <td>[% restriction.created | $KohaDates %]</td>
1464                                                             [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
1465                                                                 <td>
1466                                                                     <input type="checkbox" id="debarment_[% restriction.borrower_debarment_id | html %]" name="remove_debarment" value="[% restriction.borrower_debarment_id | html %]" />
1467                                                                 </td>
1468                                                             [% END %]
1469                                                         </tr>
1470                                                     [% END # /FOREACH d %]
1471                                                 </tbody>
1472                                             </table>
1473                                         [% ELSE %]
1474                                             <p>Patron is currently unrestricted.</p>
1475                                         [% END # /IF ( patron.restrictions.count ) %]
1476
1477                                         [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
1478                                         <p><a href="#" id="add_manual_restriction"><i class="fa fa-plus"></i> Add manual restriction</a></p>
1479                                             <fieldset id="manual_restriction_form">
1480                                                 <input type="hidden" id="add_debarment" name="add_debarment" value="0" />
1481                                                 <legend id="manual_restriction_lgd">Add manual restriction</legend>
1482                                                 <ol>
1483                                                     [% IF Koha.Preference('PatronRestrictionTypes') %]
1484                                                     <li>
1485                                                         <label for="debarred_type">Type:</label>
1486                                                         <select name="debarred_type">
1487                                                             [% FOREACH restriction_type IN restriction_types %]
1488                                                                 [% IF !restriction_type.is_system %]
1489                                                                     [% IF restriction_type.is_default %]
1490                                                                     <option value="[% restriction_type.code | html %]" selected>[% PROCESS restriction_type_description %]</option>
1491                                                                     [% ELSE %]
1492                                                                     <option value="[% restriction_type.code | html %]">[% PROCESS restriction_type_description %]</option>
1493                                                                     [% END %]
1494                                                                 [% END %]
1495                                                             [% END %]
1496                                                         </select>
1497                                                     </li>
1498                                                     [% END %]
1499                                                     <li>
1500                                                         <label for="debarred_comment">Comment: </label>
1501                                                         <input type="text" id="debarred_comment" name="debarred_comment" />
1502                                                     </li>
1503                                                     <li>
1504                                                         <label for="debarred_expiration">Expiration: </label>
1505                                                         <input name="debarred_expiration" id="debarred_expiration" size="10" value="" class="flatpickr" type="text" />
1506                                                         <a href="#" id="clear_debarred_expiration">Clear date</a>
1507                                                     </li>
1508                                                 </ol>
1509                                                 <p>
1510                                                     <a class="cancel" id="cancel_manual_restriction" href="#">Cancel</a>
1511                                                 </p>
1512                                             </fieldset> <!-- /#manual_restriction_form -->
1513                                         [% END # /IF CAN_user_borrowers_edit_borrowers %]
1514                                     </fieldset> <!-- /#memberentry_restrictions -->
1515                             [% END # /IF ( step_3 ) %]
1516
1517                             [% IF ( step_7 ) %]
1518                                 [% IF Koha.Preference('HouseboundModule') %]
1519                                     <fieldset class="rows" id="memberentry_housebound_roles">
1520                                         <legend id="housebound_roles">Housebound roles</legend>
1521                                         <ol class="radio">
1522                                             <li>
1523                                                 <label class="radio" for="housebound_chooser">
1524                                                     Chooser:
1525                                                 </label>
1526                                                 [% IF ( housebound_role.housebound_chooser == 1 ) %]
1527                                                     <label for="yes_housebound_chooser">Yes </label>
1528                                                     <input type="radio" id="yes_housebound_chooser" name="housebound_chooser" value="1" checked="checked" />
1529                                                     <label for="no_housebound_chooser">No </label>
1530                                                     <input type="radio" id="no_housebound_chooser" name="housebound_chooser" value="0" />
1531                                                 [% ELSE %]
1532                                                     <label for="yes_housebound_chooser">Yes </label>
1533                                                     <input type="radio" id="yes_housebound_chooser" name="housebound_chooser" value="1" />
1534                                                     <label for="no_housebound_chooser">No </label>
1535                                                     <input type="radio" id="no_housebound_chooser" name="housebound_chooser" value="0" checked="checked" />
1536                                                 [% END %]
1537                                             </li>
1538                                             <li>
1539                                                 <label class="radio" for="housebound_deliverer">Deliverer:</label>
1540                                                 [% IF ( housebound_role.housebound_deliverer == 1 ) %]
1541                                                     <label for="yes_housebound_deliverer">Yes </label>
1542                                                     <input type="radio" id="yes_housebound_deliverer" name="housebound_deliverer" value="1" checked="checked" />
1543                                                     <label for="no_housebound_deliverer">No </label>
1544                                                     <input type="radio" id="no_housebound_deliverer" name="housebound_deliverer" value="0" />
1545                                                 [% ELSE %]
1546                                                     <label for="yes_housebound_deliverer">Yes </label>
1547                                                     <input type="radio" id="yes_housebound_deliverer" name="housebound_deliverer" value="1" />
1548                                                     <label for="no_housebound_deliverer">No </label>
1549                                                     <input type="radio" id="no_housebound_deliverer" name="housebound_deliverer" value="0" checked="checked" />
1550                                                 [% END %]
1551                                             </li>
1552                                         </ol> <!-- /ol.radio -->
1553                                     </fieldset> <!-- /#memberentry_housebound_roles -->
1554                                 [% END # hide fieldset %]
1555                             [% END # IF step_7 %]
1556
1557                             [% IF ( step_4 ) %]
1558                                 [% IF Koha.Preference('ExtendedPatronAttributes') %]
1559                                     [% UNLESS ( no_patron_attribute_types ) %]
1560                                         <fieldset class="rows" id="memberentry_patron_attributes">
1561                                             <legend id="patron_attributes_lgd">Additional attributes and identifiers</legend>
1562                                             <input type="hidden" name="setting_extended_patron_attributes" value="1" />
1563                                             [% FOREACH pa_loo IN patron_attributes %]
1564                                                 <ol class="attributes_table">
1565                                                     [% IF pa_loo.class %]
1566                                                         <div id="aai_[% pa_loo.class | html %]">
1567                                                         <h3 id="[% pa_loo.class | html %]_lgd">[% pa_loo.lib | html %]</h3>
1568                                                     [% END %]
1569                                                     [% FOREACH patron_attribute IN pa_loo.items %]
1570                                                         <li data-category_code="[% patron_attribute.category_code | html %]" data-pa_code="[% patron_attribute.code | replace('[^a-zA-Z0-9_-]', '') %]">
1571                                                             [% IF patron_attribute.mandatory %]
1572                                                                 <label for="[% patron_attribute.form_id | html %]" class="required" required="required">[% patron_attribute.description | html %]: </label>
1573                                                             [% ELSE %]
1574                                                                 <label for="[% patron_attribute.form_id | html %]">[% patron_attribute.description | html %]: </label>
1575                                                             [% END %]
1576                                                             [% IF ( patron_attribute.use_dropdown ) %]
1577                                                                 [% IF patron_attribute.mandatory %]
1578                                                                     <select id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]" required="required">
1579                                                                 [% ELSE %]
1580                                                                     <select id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]">
1581                                                                 [% END %]
1582                                                                     <option value=""></option>
1583                                                                     [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
1584                                                                         [% IF auth_val_loo.authorised_value == patron_attribute.value %]
1585                                                                             <option value="[% auth_val_loo.authorised_value | html %]" selected="selected">
1586                                                                                 [% auth_val_loo.lib | html %]
1587                                                                             </option>
1588                                                                         [% ELSE %]
1589                                                                             <option value="[% auth_val_loo.authorised_value | html %]" >
1590                                                                                 [% auth_val_loo.lib | html %]
1591                                                                             </option>
1592                                                                         [% END %]
1593                                                                     [% END %]
1594                                                                 </select>
1595                                                             [% ELSE %]
1596                                                                 [% IF patron_attribute.mandatory %]
1597                                                                 <textarea rows="2" cols="30" id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]" required="required">[% patron_attribute.value | html %]</textarea>
1598                                                                 [% ELSE %]
1599                                                                 <textarea rows="2" cols="30" id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]">[% patron_attribute.value | html %]</textarea>
1600                                                                 [% END %]
1601                                                             [% END # /IF ( patron_attribute.use_dropdown ) %]
1602                                                             <input type="hidden" id="[% patron_attribute.form_id | html %]_code" name="[% patron_attribute.form_id | html %]_code" value="[% patron_attribute.code | html %]" />
1603                                                             <a href="#" class="clear_attribute"><i class="fa fa-fw fa-trash-can"></i> Clear</a>
1604                                                             [% IF ( patron_attribute.repeatable ) %]
1605                                                                 <a href="#" class="clone_attribute"><i class="fa fa-fw fa-plus"></i> New</a>
1606                                                             [% END %]
1607                                                             [% IF patron_attribute.mandatory %]<span class="required">Required</span>[% END %]
1608                                                         </li>
1609                                                     [% END # /FOREACH patron_attribute %]
1610                                                     [% IF pa_loo.class %]</div>[% END %]
1611                                                 </ol>
1612                                             [% END # /FOREACH pa_loo %]
1613                                         </fieldset> <!-- /#memberentry_patron_attributes -->
1614                                     [% END # UNLESS ( no_patron_attribute_types ) %]
1615                                 [% END # IF Koha.Preference('ExtendedPatronAttributes') %]
1616                             [% END # IF ( step_4 ) %]
1617
1618                             [% IF ( step_5 ) %]
1619                                 [% IF ( EnhancedMessagingPreferences ) %]
1620                                     <fieldset class="rows" id="memberentry_messaging_prefs">
1621                                         <legend id="patron_messaging_prefs_lgd">Patron messaging preferences</legend>
1622                                         <div id="messaging_prefs_loading" class="form-message" style="display:none">
1623                                             <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading new messaging defaults
1624                                         </div>
1625                                         <input type="hidden" name="setting_messaging_prefs" value="1" />
1626                                         [% INCLUDE 'messaging-preference-form.inc' %]
1627                                         [% IF ( SMSSendDriver ) %]
1628                                             [% IF !nosmsalertnumber %]
1629                                                 <p>
1630                                                     <label for="SMSnumber">SMS number:</label>
1631                                                     <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber | html %]" />
1632                                                     <span class="hint sms_number_help">Please enter numbers only. Prefix the number with + or 00 if including the country code.</span>
1633                                                 </p>
1634                                             [% END %]
1635                                             [% IF SMSSendDriver == 'Email' && !nosms_provider_id %]
1636                                                 <p>
1637                                                     <label for="sms_provider_id">SMS provider:</label>
1638                                                     <select id="sms_provider_id" name="sms_provider_id">
1639                                                         <option value="">Unknown</option>
1640                                                         [% FOREACH s IN sms_providers %]
1641                                                             [% IF s.id == borrower_data.sms_provider_id %]
1642                                                                 <option value="[% s.id | html %]" selected="selected">[% s.name | html %]</option>
1643                                                             [% ELSE %]
1644                                                                 <option value="[% s.id | html %]">[% s.name | html %]</option>
1645                                                             [% END %]
1646                                                         [% END %]
1647                                                     </select>
1648                                                 </p>
1649                                             [% END # /UNLESS nosms_provider_id %]
1650                                         [% END # IF ( SMSSendDriver ) %]
1651                                     </fieldset>
1652                                 [% END # IF ( EnhancedMessagingPreferences ) %]
1653                             [% END # /IF step_5 %]
1654                         </form> <!-- /#entryform -->
1655
1656                         [% IF quickadd && opadd  && !check_member %]
1657                             <form id="quick_add_form" class="toggler">
1658                                 <fieldset class="rows quick_add"><legend>Quick add</legend>
1659                                     <ol id="quick_add_list">
1660                                     </ol>
1661                                 </fieldset>
1662                             </form>
1663                         [% END %]
1664
1665                     [% END # /UNLESS ( no_add ) %]
1666                 </main>
1667             </div> <!-- /.col-sm-10.col-sm-push-2 -->
1668
1669             [% UNLESS ( opadd ) %]
1670                 <div class="col-sm-2 col-sm-pull-10">
1671                     <aside>
1672                         [% INCLUDE 'circ-menu.inc' %]
1673                     </aside>
1674                 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1675             [% END %]
1676         </div> <!-- /.row -->
1677
1678 [% MACRO jsinclude BLOCK %]
1679     [% Asset.js("lib/hc-sticky.js") | $raw %]
1680     [% INCLUDE 'calendar.inc' %]
1681     [% INCLUDE 'str/members-menu.inc' %]
1682     [% Asset.js("js/members-menu.js") | $raw %]
1683     <script>
1684         function update_cardnumber_warning(size){
1685             var max_len = [% maxlength_cardnumber | html %];
1686             if ( size >= max_len ) {
1687                 $("#cn_max").show();
1688             } else {
1689                 $("#cn_max").hide();
1690             }
1691         }
1692         var Sticky;
1693         function showHideFields(){
1694             [% UNLESS step == 1 %]
1695                 [% IF fieldstohide.match('identity') %]
1696                     $("#memberentry_identity").find('legend').nextAll().toggle();
1697                 [% END %]
1698                 [% IF show_guarantor || guarantor %]
1699                     [% IF fieldstohide.match('guarantor') %]
1700                         $("#memberentry_guarantor").find('legend').nextAll().toggle();
1701                         $("#guarantor_template").toggle();
1702                     [% END %]
1703                 [% END %]
1704                 [% IF fieldstohide.match('primary_address') %]
1705                     $("#memberentry_mainaddress").find('legend').nextAll().toggle();
1706                 [% END %]
1707                 [% IF fieldstohide.match('primary_contact') %]
1708                     $("#memberentry_contact").find('legend').nextAll().toggle();
1709                 [% END %]
1710             [% END %]
1711             [% UNLESS step == 6 %]
1712                 [% IF fieldstohide.match('alt_address') %]
1713                     $("#memberentry_address").find('legend').nextAll().toggle();
1714                 [% END %]
1715             [% END %]
1716             [% UNLESS step == 2 %]
1717                 [% IF fieldstohide.match('alt_contact') %]
1718                     $("#memberentry_altaddress").find('legend').nextAll().toggle();
1719                 [% END %]
1720             [% END %]
1721             [% UNLESS step == 3 %]
1722                 [% IF fieldstohide.match('lib_mgmt') %]
1723                         $("#memberentry_library_management").find('legend').nextAll().toggle();
1724                 [% END %]
1725                 [% UNLESS nodateenrolled && noopacnote && noborrowernotes %]
1726                     [% IF fieldstohide.match('lib_setup') %]
1727                         $("#memberentry_subscription").find('legend').nextAll().toggle();
1728                     [% END %]
1729                 [% END %]
1730                 [% UNLESS nouserid && nopassword %]
1731                     [% IF fieldstohide.match('login') %]
1732                         $("#memberentry_userid").find('legend').nextAll().toggle();
1733                     [% END %]
1734                 [% END %]
1735                 [% UNLESS ( opadd || opduplicate ) %]
1736                     [% IF fieldstohide.match('flags') %]
1737                         $("#memberentry_account_flags").find('legend').nextAll().toggle();
1738                     [% END %]
1739                 [% END %]
1740                 [% IF fieldstohide.match('debarments') %]
1741                     $("#memberentry_restrictions").find('legend').nextAll().toggle();
1742                 [% END %]
1743             [% END %]
1744             [% UNLESS step == 7 %]
1745                 [% IF Koha.Preference('HouseboundModule') %]
1746                     [% IF fieldstohide.match('housebound') %]
1747                         $("#memberentry_housebound_roles").find('legend').nextAll().toggle();
1748                     [% END %]
1749                 [% END %]
1750             [% END %]
1751             [% UNLESS step == 4 %]
1752                 [% IF Koha.Preference('ExtendedPatronAttributes') %]
1753                     [% IF fieldstohide.match('additional') %]
1754                         $("#memberentry_patron_attributes").find('legend').nextAll().toggle();
1755                     [% END %]
1756                 [% END %]
1757             [% END %]
1758             [% UNLESS step == 5 %]
1759                 [% IF Koha.Preference('EnhancedMessagingPreferences') %]
1760                     [% IF fieldstohide.match('messaging') %]
1761                         $("#memberentry_messaging_prefs").find('legend').nextAll().toggle();
1762                         $("#messaging_prefs_loading").toggle();
1763                     [% END %]
1764                 [% END %]
1765             [% END %]
1766         }
1767
1768         $(document).ready(function() {
1769             showHideFields();
1770             $("#toggle_hidden_fields").change(function(){
1771                 showHideFields();
1772             });
1773
1774             $("legend").click(function(){
1775                 $(this).nextAll().toggle();
1776                 $("#messaging_prefs_loading").hide();
1777                 $("#guarantor_template").hide();
1778             });
1779
1780             $("#saverecord").css({ 'margin-left': 0 });
1781
1782             Sticky = $("#toolbar");
1783             Sticky.hcSticky({
1784                 stickTo: "main",
1785                 stickyClass: "floating"
1786             });
1787
1788             [% IF borrower_data.categorycode %]
1789                 update_category_code( "[% borrower_data.categorycode | html %]" );
1790             [% ELSE %]
1791                 if ( $("#categorycode_entry").length > 0 ){
1792                     var category_code = $("#categorycode_entry").find("option:selected").val();
1793                     update_category_code( category_code );
1794                 }
1795             [% END %]
1796
1797             [% IF new_guarantors %]
1798                 [% FOREACH g IN new_guarantors %]
1799                     select_user( '[% g.patron.borrowernumber | html %]', [% To.json( g.patron.unblessed ) | $raw %], '[% g.relationship | html %]' );
1800                 [% END %]
1801             [% END %]
1802
1803             $("#cn_max").hide();
1804             var content;
1805             $("#cardnumber").on("keydown", function(e){
1806                 content = $(this).val();
1807             });
1808             $("#cardnumber").on("keyup", function(e){
1809                 // .val() will return the value of the input after the key has been released
1810                 var l = $(this).val().length;
1811                 if ( l == content.length + 1 ) { l--; }
1812                 update_cardnumber_warning(l);
1813             });
1814             $("#cardnumber").bind("paste", function(e){
1815                 var pastedData = e.originalEvent.clipboardData.getData('text');
1816                 update_cardnumber_warning(pastedData.length - 1);
1817             } );
1818             var toggle_quick_add = $(".toggle_quick_add");
1819             $(toggle_quick_add).click(function(e){
1820                 toggle_quick_add.toggle();
1821                 e.preventDefault();
1822                 var toggle_to = '';
1823                 var toggle_from = '';
1824                 if( $("#entryform:visible").length ) {
1825                     toggle_to = "#quick_add_form label";
1826                     toggle_from = "#entryform label";
1827                     $("#memberentry_guarantor").appendTo("#quick_add_form");
1828                 } else {
1829                     toggle_to="#entryform label";
1830                     toggle_from = "#quick_add_form label";
1831                     $("#memberentry_guarantor").appendTo("#memberentry_guarantor_anchor");
1832                 }
1833                 $(toggle_from).each(function() {
1834                     var input_label = $(this).attr('for');
1835                     if ( input_label == 'sex-male' || input_label == 'sex-none' || input_label == 'sex-female' || input_label == 'sex-other' ) {
1836                         $(toggle_to+"[for='"+input_label+"']").next().prop('checked', $(this).next().prop('checked') );
1837                         return;
1838                     }
1839                     $(toggle_to+"[for='"+input_label+"']").next().val(  $(this).next().val() );
1840                 });
1841
1842                 $(".toggler").toggle();
1843             });
1844
1845             $("#save_quick_add").click(function(){
1846                 $("#quick_add_form").validate();
1847                 if( $("#quick_add_form").valid()){
1848                     $('.toggle_quick_add').click();
1849                     $("#memberentry_guarantor").appendTo("#memberentry_guarantor_anchor");
1850                     $('#saverecord').click();
1851                 }
1852                 else {return false;}
1853             });
1854
1855             $("#saverecord").click(function(){
1856                 if( check_form_borrowers() ){
1857                     $("#entryform").submit();
1858                 }
1859             });
1860
1861             $('#duplicate').on('click', function() {
1862                 $("input[name='op']").val('modify');
1863                 $("input[name='borrowernumber']").val('[% check_member | html %]');
1864                 $("input[name='check_member']").val('');
1865                 $('#entryform').submit();
1866             });
1867
1868             $('#not-duplicate').on('click', function() {
1869                 $("input[name='nodouble']").val('1');
1870                 $('#entryform').submit();
1871             });
1872
1873             $(".popup_patronview").on("click", function(e){
1874                 e.preventDefault();
1875                 var url = $(this).attr("href");
1876                 openWindow( url, "patronview" );
1877             });
1878
1879             $("#dateofbirth").on("change", function(){
1880                  write_age();
1881             });
1882
1883             $("#debarred_comment, #debarred_expiration").on("change", function(){
1884                 $("#add_debarment").val(1);
1885             });
1886
1887             $("#clear_debarred_expiration").on("click", function(e){
1888                 e.preventDefault();
1889                 $('#debarred_expiration').val("");
1890             });
1891
1892             $("#memberentry_patron_attributes").on("click", ".clear_attribute", function(e){
1893                 e.preventDefault();
1894                 clear_entry( this );
1895             });
1896
1897             $("#memberentry_patron_attributes").on("click", ".clone_attribute", function(e){
1898                 e.preventDefault();
1899                 clone_entry( this );
1900             });
1901
1902             $("#categorycode_entry").on("change", function(){
1903                 update_category_code(this);
1904             });
1905
1906             [% IF logged_in_user.borrowernumber == borrowernumber %]
1907                 $("#userid").on("change", function(){
1908                     $(this).parent().find("div.hint").remove();
1909                     if ( "[% borrower_data.userid | html %]" != $(this).val() ) {
1910                         $(this).parent().append('<div class="hint">%s</div>'.format(_("You will be logged out if you modify your username")));
1911                     }
1912                 });
1913             [% END %]
1914
1915         });
1916
1917         [% IF quickadd && opadd  && !check_member %]
1918             $(document).ready(function () {
1919
1920                 $("#entryform,#saverecord").hide();
1921                 [% q_add_f = Koha.Preference('PatronQuickAddFields').split('\|') %]
1922                 var qaddfields = [[% FOREACH field IN q_add_f.unique %]"[% field | html %]",[% END %]];
1923                 $("#entryform label").each(function () {
1924                     var input_label = $(this).attr('for');
1925                     if ( input_label == 'sex-female' ) {
1926                         input_label='sex';
1927                     }
1928                     else if ( input_label == 'btitle' ) {
1929                         input_label='title';
1930                     }
1931                     if( qaddfields.indexOf( input_label ) != -1 || $(this).attr('class') == 'required' ){
1932                        let orig_li = $(this).parent();
1933                        if( orig_li.attr('class') == 'radio' ){
1934                            let new_field = orig_li.clone();
1935                            new_field.children('label').each(function(){
1936                                 let child_input = $(this).children('input');
1937                                 child_input.attr("id",child_input.attr("id") + "_quick_add");
1938                             });
1939                            new_field.appendTo("#quick_add_list");
1940                        } else {
1941                            let orig_input_id = orig_li.children("input,textarea,select").attr("id");
1942                            let new_field = orig_li.clone();
1943                            new_field.children("#"+orig_input_id).attr("id",orig_input_id + "_quick_add");
1944                            new_field.appendTo("#quick_add_list");
1945                            [% UNLESS mandatorypassword %]
1946                                  if( input_label == 'password' ){
1947                                      let orig_p2 = $("#entryform label[for='password2']").parent();
1948                                      let new_p2  = orig_p2.clone();
1949                                      new_p2.find('input[id="password2"]').attr("id","password2_quick_add");
1950                                      new_p2.appendTo("#quick_add_list");
1951                                  }
1952                            [% END %]
1953                        }
1954                     }
1955                 });
1956                 if ( $("#memberentry_guarantor").length ) {
1957                     $("#memberentry_guarantor").appendTo("#quick_add_form");
1958                 }
1959                 $("#quick_add_form").show();
1960                 $("#quick_add_form").find(".flatpickr:hidden").each( (i, input) => {
1961                     $(input).siblings(".flatpickr_wrapper").remove(); // Remove leftover from the previous flatpickr that has been cloned
1962                     apply_flatpickr(input);
1963                 } );
1964             });
1965         [% END %]
1966         $("#guarantor_template").hide();
1967
1968         var TalkingTechItivaPhoneNotification = [% Koha.Preference('TalkingTechItivaPhoneNotification') || 0 | html %];
1969         var PhoneNotification = [% Koha.Preference('PhoneNotification') || 0 | html %];
1970
1971     </script>
1972     [% Asset.js("js/members.js") | $raw %]
1973     [% Asset.js("js/messaging-preference-form.js") | $raw %]
1974     [% PROCESS 'password_check.inc' new_password => 'password', category_selector => '#categorycode_entry', minPasswordLength => patron.category.effective_min_password_length, RequireStrongPassword => patron.category.effective_require_strong_password %]
1975 [% END %]
1976
1977 [% INCLUDE 'intranet-bottom.inc' %]