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