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