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