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