1 [% PROCESS 'i18n.inc' %]
8 [% PROCESS 'member-main-address-style.inc' %]
9 [% PROCESS 'member-alt-address-style.inc' %]
10 [% PROCESS 'member-alt-contact-style.inc' %]
11 [% PROCESS 'patron_restrictions.inc' %]
12 [% SET footerjs = 1 %]
13 [% INCLUDE 'doc-head-open.inc' %]
15 [% UNLESS blocking_error %]
18 [% ELSIF ( opduplicate ) %]
23 [% INCLUDE 'patron-title.inc' no_html = 1 %]
24 [% IF patron_category %]([% patron_category.description | html %])[% END %]
25 [% END %] › Patrons › Koha
32 [% INCLUDE 'doc-head-close.inc' %]
35 <body id="pat_memberentrygen" class="pat">
36 [% INCLUDE 'header.inc' %]
37 [% INCLUDE 'patron-search-header.inc' %]
39 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
42 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
45 [% IF blocking_error %]
47 <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
51 <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
53 [% IF (borrower_data.firstname || borrower_data.surname ) %]
55 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber | uri %]">
56 [% INCLUDE 'patron-title.inc' %]
61 <a href="#" aria-current="page">
63 <span>Add patron</span>
64 [% ELSIF ( opduplicate ) %]
65 <span>Duplicate patron</span>
67 <span>Modify patron</span>
69 [% IF patron_category %]
70 ([% patron_category.description | html %])
76 </nav> <!-- /#breadcrumbs -->
78 <div class="main container-fluid">
80 [% IF borrower_data.messages %]
81 [% FOR message IN borrower_data.messages %]
82 [% SWITCH message.error %]
83 [% CASE 'error_on_insert_patron' %]
84 <div class="dialog alert">Something went wrong when creating the patron. Check the logs.</div>
85 [% CASE 'error_on_update_patron' %]
86 <div class="dialog alert">Something went wrong when updating the patron. Check the logs.</div>
87 [% CASE %]<div class="dialog alert">Unhandled error: [% message.error | html %]</div>
92 <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
94 <div class="col-sm-10 col-sm-push-2">
96 <main class="clearfix">
97 [% INCLUDE 'blocking_errors.inc' %]
100 [% IF ( error_alert == "no_email" ) %]
101 <div class="dialog alert">This member has no email</div>
103 <div class="dialog alert">[% error_alert | html %]</div>
107 <div class="dialog message">Email has been sent.</div>
110 [% INCLUDE 'noadd-warnings.inc' %]
112 [% UNLESS ( no_add ) %]
115 <span>Add patron</span>
116 [% ELSIF ( opduplicate ) %]
117 <span>Duplicate patron</span>
119 <span>Modify patron</span>
121 [% INCLUDE 'patron-title.inc' %]
122 [% IF patron_category %]([% patron_category.description | html %])[% END %]
125 [% IF quickadd && opadd && !check_member %]
126 <a href="#" class="toggle_quick_add"><i class="fa fa-plus-square"></i> Show full form</a>
127 <a href="#" class="toggle_quick_add" style="display:none"><i class="fa fa-minus-square"></i> Show brief form</a>
130 [% IF ( check_member ) %]
131 <div class="dialog alert">
132 <h3>Duplicate patron record?</h3>
133 <p><a class="popup_patronview" href="/cgi-bin/koha/members/moremember.pl?print=brief&borrowernumber=[% check_member | uri %]"><i class="fa fa-window-restore"></i> View existing record</a></p>
134 <button id="duplicate" type="submit" class="new"> <i class="fa fa-pencil"></i> It is a duplicate. Edit existing record </button>
135 <button type="submit" id="not-duplicate" class="new"> <i class="fa fa-plus"></i> Not a duplicate. Save as new record </button>
140 <div class="dialog alert">
141 <p>The following fields are wrong. Please fix them.</p>
143 [% IF ( ERROR_login_exist ) %]
144 <li id="ERROR_login_exist">Username/password already exists.</li>
146 [% IF ERROR_cardnumber_already_exists %]
147 <li id="ERROR_cardnumber">Cardnumber already in use.</li>
149 [% IF ERROR_cardnumber_length %]
150 <li id="ERROR_cardnumber">Cardnumber length is incorrect.</li>
152 [% IF ( ERROR_age_limitations ) %]
153 <li id="ERROR_age_limitations">Patron's age is incorrect for their category.
154 Ages allowed are [% age_low | html %]-[% age_high | html %].</li>
156 [% IF ( ERROR_branch ) %]
157 <li id="ERROR_branch">Library is invalid.</li>
159 [% IF ( ERROR_dateofbirth ) %]
160 <li id="ERROR_dateofbirth">Date of birth is invalid.</li>
162 [% IF ( ERROR_dateenrolled ) %]
163 <li id="ERROR_dateenrolled">Date of enrollment is invalid.</li>
165 [% IF ( ERROR_dateexpiry ) %]
166 <li id="ERROR_dateexpiry">Date of expiration is invalid.</li>
168 [% IF ( ERROR_password_too_short ) %]
169 <li id="ERROR_short_password">Password must be at least [% minPasswordLength | html %] characters long.</li>
171 [% IF ( ERROR_password_too_weak ) %]
172 <li id="ERROR_weak_password">Password must contain at least one digit, one lowercase and one uppercase.</li>
174 [% IF ( ERROR_password_has_whitespaces ) %]
175 <li id="ERROR_weak_password">Password must not contain leading or trailing whitespaces.</li>
177 [% IF ( ERROR_password_mismatch ) %]
178 <li id="ERROR_password_mismatch">Passwords do not match.</li>
180 [% IF ( ERROR_password_expiration_date ) %]
181 <li id="ERROR_dateexpiry">Password expiration date is invalid.</li>
183 [% IF ( ERROR_extended_unique_id_failed ) %]
184 <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>
186 [% IF ERROR_bad_email %]
187 <li id="ERROR_bad_email">The primary email is invalid.</li>
189 [% IF ERROR_bad_email_secondary %]
190 <li id="ERROR_bad_email_secondary">The secondary email is invalid.</li>
192 [% IF ERROR_bad_email_alternative %]
193 <li id="ERROR_bad_email_alternative">The alternative email is invalid.</li>
199 [% SET fieldstohide = Koha.Preference('CollapseFieldsPatronAddForm') %]
200 [% IF Koha.Preference('CollapseFieldsPatronAddForm') %][% UNLESS step %]
202 <input type="checkbox" id="toggle_hidden_fields" title="These fields are collapsed by default by the CollapseFieldsPatronAddForm system preference"><strong>Show collapsed fields:</strong>
203 [% FOREACH field IN fieldstohide.split(',') %]
205 [% CASE 'identity' %] <span>Patron identity</span> |
206 [% CASE 'guarantor' %] <span>Guarantor information</span> |
207 [% CASE 'primary_address' %] <span>Main address</span> |
208 [% CASE 'primary_contact' %] <span>Contact information</span> |
209 [% CASE 'alt_address' %] <span>Alternate address</span> |
210 [% CASE 'alt_contact' %] <span>Alternate contact</span> |
211 [% CASE 'lib_mgmt' %] <span>Library management</span> |
212 [% CASE 'lib_setup' %] <span>Library setup</span> |
213 [% CASE 'login' %] <span>OPAC/Staff interface login</span> |
214 [% CASE 'flags' %] <span>Patron account flags</span> |
215 [% CASE 'debarments' %] <span>Patron restrictions</span> |
216 [% CASE 'housebound' %] <span>Housebound roles</span> |
217 [% CASE 'additional' %] <span>Additional attributes and identifiers</span> |
218 [% CASE 'messaging' %] <span>Patron messaging preferences</span> |
224 [% UNLESS ( check_member ) %]
225 <div id="toolbar" class="btn-toolbar">
226 [% IF quickadd && opadd %]
227 <button class="btn btn-default toggler" id="save_quick_add" name="save"><i class="fa fa-save"></i> Save</button>
229 <button class="btn btn-default toggler" id="saverecord" name="save" ><i class="fa fa-save"></i> Save</button>
231 <a class="btn btn-default" href="/cgi-bin/koha/members/member.pl" class="toggler save_entryform">
233 <a class="btn btn-default" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber | html %]">
235 <i class="fa fa-times"></i> Cancel
240 <form name="form" id="entryform" action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off" class="toggler">
241 [% UNLESS ( check_member ) %]
242 <input type="hidden" name="nodouble" value="[% nodouble | html %]" />
244 <!-- field always hidden in different form (1,2,3) -->
245 <input type="hidden" name="BorrowerMandatoryField" value="[% BorrowerMandatoryField | html %]" />
246 <input type="hidden" name="updtype" value="[% updtype | html %]" />
247 <input type="hidden" name="destination" value="[% destination | html %]" />
248 <input type="hidden" name="check_member" value="[% check_member | html %]" />
249 <input type="hidden" name="borrowernumber" value="[% borrowernumber | html UNLESS opduplicate %]" />
250 <input type="hidden" name="nodouble" value="[% nodouble | html UNLESS opduplicate %]" />
251 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
253 <input type="hidden" name="step" value="[% step | html %]" />
256 <input type="hidden" name="op" value="insert" />
257 [% ELSIF ( opduplicate ) %]
258 <input type="hidden" name="op" value="insert" />
260 <input type="hidden" name="op" value="save" />
261 [% IF step == 4 || step == 5 || step == 6 || step == 2 || step == 1 || step == 7 %]
262 [%# Only put the card number if we arent showing it in the form later %]
263 [% IF borrower_data.cardnumber %]
264 <input type="hidden" name="cardnumber" value="[% borrower_data.cardnumber | html %]" />
270 [% UNLESS notitle && nosurname && nofirstname && nomiddle_name && nodateofbirth && noinitials && noothernames &&nosex %]
271 <fieldset class="rows" id="memberentry_identity">
272 <legend id="identity_lgd">[% IF ( patron_category.category_type == 'I' ) %]<span>Organization</span> [% ELSE %]<span>Patron</span> [% END %]<span>identity</span></legend>
274 [% UNLESS ( patron_category.category_type == 'I' ) %]
276 [% IF Koha.Preference('BorrowersTitles') %]
278 [% IF ( mandatorytitle ) %]
279 <label for="btitle" class="required">
284 <select id="btitle" name="title">
285 <option value=""></option>
286 [% FOREACH t IN Koha.Preference('BorrowersTitles').split('\|') %]
288 <option value="[% t | html %]" selected="selected">[% t | html %]</option>
290 <option value="[% t | html %]">[% t | html %]</option>
294 [% IF ( mandatorytitle ) %]
295 <span class="required">Required</span>
298 [% END # /IF Koha.Preference('BorrowersTitles') %]
299 [% END # /UNLESS notitle %]
300 [% END # /UNLESS ( I ) %]
302 [% UNLESS nosurname %]
304 [% IF ( patron_category.category_type == 'I' ) %]
305 <label for="surname" class="required">
309 [% IF ( mandatorysurname ) %]
310 <label for="surname" class="required">
312 <label for="surname">
317 [% IF ( uppercasesurnames ) %]
318 <input style="text-transform:uppercase;" type="text" id="surname" name="surname" size="20" value="[% borrower_data.surname | html %]" />
320 <input type="text" id="surname" name="surname" size="20" value="[% borrower_data.surname | html %]" />
322 [% IF ( mandatorysurname ) %]
323 <span class="required">Required</span>
326 [% END # /UNLESS nosurname %]
328 [% UNLESS ( patron_category.category_type == 'I' ) %]
329 [% UNLESS nofirstname %]
331 [% IF ( mandatoryfirstname ) %]
332 <label for="firstname" class="required">
334 <label for="firstname">
338 <input type="text" id="firstname" name="firstname" size="20" value="[% borrower_data.firstname | html UNLESS opduplicate %]" />
339 [% IF ( mandatoryfirstname ) %]
340 <span class="required">Required</span>
343 [% END #/UNLESS nofirstname %]
344 [% UNLESS nomiddle_name %]
346 [% IF ( mandatorymiddle_name ) %]
347 <label for="middle_name" class="required">
349 <label for="middle_name">
353 <input type="text" id="middle_name" name="middle_name" size="20" value="[% borrower_data.middle_name | html UNLESS opduplicate %]" />
354 [% IF ( mandatorymiddle_name ) %]
355 <span class="required">Required</span>
358 [% END #/UNLESS nomiddle_name %]
359 [% UNLESS nodateofbirth %]
361 [% IF ( mandatorydateofbirth ) %]
362 <label for="dateofbirth" class="required">
364 <label for="dateofbirth">
368 <input type="text" id="dateofbirth" name="dateofbirth" size="20" value="[% borrower_data.dateofbirth | html UNLESS opduplicate %]" class="flatpickr" data-flatpickr-pastinclusive="true" />
369 [% IF ( mandatorydateofbirth ) %]
370 <span class="required">Required</span>
372 [% IF ( ERROR_dateofbirth ) %]
373 <span class="required">(Error)</span>
375 <div id="dateofbirth_hint" class="hint">[% INCLUDE 'date-format.inc' %]</div>
377 [% END # /UNLESS nodateofbirth %]
378 [% UNLESS noinitials %]
380 [% IF ( mandatoryinitials ) %]
381 <label for="initials" class="required">
383 <label for="initials">
387 <input type="text" id="initials" name="initials" size="20" value="[% borrower_data.initials | html UNLESS opduplicate %]" />
388 [% IF ( mandatoryinitials ) %]
389 <span class="required">Required</span>
392 [% END # /UNLESS noinitials %]
393 [% END #/UNLESS ( I ) %]
394 [% UNLESS noothernames %]
396 [% IF ( mandatoryothernames ) %]
397 <label for="othernames" class="required">
399 <label for="othernames">
403 <input type="text" id="othernames" name="othernames" size="20" value="[% borrower_data.othernames | html UNLESS opduplicate %]" />
404 [% IF ( mandatoryothernames ) %]
405 <span class="required">Required</span>
407 [% IF ( patron_category.category_type == 'I' ) %]<input type="hidden" name="sex" value="N" />[% END %]
409 [% END #/UNLESS noothernames %]
411 [% UNLESS ( patron_category.category_type == 'I' ) %]
414 [% UNLESS ( opduplicate ) %]
416 <label for="sex-female"><input type="radio" name="sex" id="sex-female" value="F" checked="checked" /><span class="patronsex-female"> Female</span></label>
418 <label for="sex-female"><input type="radio" name="sex" id="sex-female" value="F" /><span class="patronsex-female"> Female</span></label>
421 <label for="sex-male"><input type="radio" name="sex" id="sex-male" value="M" checked="checked" /><span class="patronsex-male"> Male</span></label>
423 <label for="sex-male"><input type="radio" name="sex" id="sex-male" value="M" /><span class="patronsex-male"> Male</span></label>
426 <label for="sex-other"><input type="radio" name="sex" id="sex-other" value="O" checked="checked" /><span class="patronsex-other"> Other</span></label>
428 <label for="sex-other"><input type="radio" name="sex" id="sex-other" value="O" /><span class="patronsex-other"> Other</span></label>
431 <label for="sex-none"><input type="radio" name="sex" id="sex-none" value="" checked="checked" /><span class="patronsex-none"> None specified</span></label>
433 <label for="sex-none"><input type="radio" name="sex" id="sex-none" value="" /><span class="patronsex-none"> None specified</span></label>
436 <label for="sex-female"><span class="patronsex-female">Female </span></label><input type="radio" name="sex" id="sex-female" value="F" />
437 <label for="sex-male"><span class="patronsex-male">Male </span></label><input type="radio" name="sex" id="sex-male" value="M" />
438 <label for="sex-other"><span class="patronsex-other">Other </span></label><input type="radio" name="sex" id="sex-other" value="O" />
439 <label for="sex-none"><span class="patronsex-none">None specified </span></label><input type="radio" name="sex" id="sex-none" value="" checked="checked" />
440 [% END # /UNLESS ( opduplicate )%]
442 [% END # /UNLESS nosex %]
443 [% END # /UNLESS ( I ) %]
445 </fieldset> <!-- /#memberentry_identity -->
446 [% END # hide fieldset %]
448 [% IF show_guarantor || guarantor %]
449 [% SET possible_relationships = Koha.Preference('borrowerRelationship') %]
450 <div id="memberentry_guarantor_anchor">
451 <fieldset id="memberentry_guarantor" class="rows">
452 <legend>Patron guarantor</legend>
454 <div id="guarantor_relationships">
455 [% FOREACH r IN relationships %]
458 [% IF patron_category.category_type == 'I' %]
459 <li class="guarantor-details" data-borrowernumber="[% r.guarantor_id | $raw %]">
460 <span class="label">Organization:</span>
461 [% INCLUDE 'patron-title.inc' patron=r.guarantor hide_patron_infos_if_needed=1 %]
464 <span class="label">Relationship:</span>
465 <span>[% r.relationship | html %]</span>
468 <li class="guarantor-details" data-borrowernumber="[% r.guarantor_id | $raw %]">
469 <span class="label">Guarantor:</span>
470 [% INCLUDE 'patron-title.inc' patron=r.guarantor hide_patron_infos_if_needed=1 %]
473 <span class="label">Relationship:</span>
474 <span>[% r.relationship | html %]</span>
478 <label for="delete_guarantor-[% r.id | uri %]">Remove: </label>
479 <input type="checkbox" id="delete_guarantor-[% r.id | uri %]" name="delete_guarantor" value="[% r.id | html %]" />
484 [% END # END relationships foreach %]
485 [% IF guarantor && (!relationships) %]
486 <fieldset class="guarantor">
488 <li class="guarantor-details" data-borrowernumber="0">
489 <span class="label">Guarantor:</span>
490 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantor.borrowernumber | uri %]" target="blank">[% guarantor.firstname | html %] [% guarantor.surname | html %] ([% guarantor.cardnumber | html %])</a>
491 <input type="hidden" class="new_guarantor_id" name="new_guarantor_id" value="[% guarantor.borrowernumber | html %]"/>
494 [% IF possible_relationships %]
496 [% UNLESS empty_relationship_allowed %]
497 <label for="guarantor_relationship" class="required">Relationship: </label>
498 <select class="new_guarantor_relationship" name="new_guarantor_relationship" required="required">
500 <label for="guarantor_relationship">Relationship: </label>
501 <select class="new_guarantor_relationship" name="new_guarantor_relationship">
503 <option value="" selected>Empty option</option>
504 [% FOREACH pr IN possible_relationships.split('\|') %]
506 <option value="[% pr | html %]">[% pr | html %]</option>
510 [% UNLESS empty_relationship_allowed %]
511 <span class="required">Required</span>
515 <input type="hidden" name="new_guarantor_relationship" value="" />
519 <label for="guarantor_cancel"> </label>
520 <span><a href="#" class="guarantor_cancel"><i class="fa fa-trash" aria-hidden="true"></i> Remove</a></span>
525 </div> <!-- #/guarantor_relationships -->
527 <fieldset class="guarantor" id="guarantor_template">
529 <li class="guarantor-details" data-borrowernumber="0">
530 <span class="label">Guarantor:</span>
531 <a class="new_guarantor_link" href="#" target="blank">
532 <span class="new_guarantor_firstname_text"></span> <span class="new_guarantor_surname_text"></span>
533 (<span class="new_guarantor_id_text"></span>)
535 <input type="hidden" class="new_guarantor_id" name="new_guarantor_id" value=""/>
538 [% IF possible_relationships %]
540 [% UNLESS empty_relationship_allowed %]
541 <label for="guarantor_relationship" class="required">Relationship: </label>
542 <select class="new_guarantor_relationship" name="new_guarantor_relationship" required="required">
544 <label for="guarantor_relationship">Relationship: </label>
545 <select class="new_guarantor_relationship" name="new_guarantor_relationship">
547 <option value="" selected></option>
548 [% FOREACH pr IN possible_relationships.split('\|') %]
550 <option value="[% pr | html %]">[% pr | html %]</option>
554 [% UNLESS empty_relationship_allowed %]
555 <span class="required">Required</span>
559 <input type="hidden" name="new_guarantor_relationship" value="" />
563 <label for="guarantor_cancel"> </label>
564 <span><a href="#" class="guarantor_cancel"><i class="fa fa-trash"></i> Remove</a></span>
570 <input type="hidden" id="guarantor_id" value="" />
571 <input name="guarantor_surname" id="guarantor_surname" type="hidden" />
572 <input name="guarantor_firstname" id="guarantor_firstname" type="hidden" />
575 <a href="#" id="guarantor_search" class="btn btn-default"><i class="fa fa-plus"></i> Add guarantor</a>
578 [% IF Koha.Preference('AllowStaffToSetCheckoutsVisibilityForGuarantor') %]
580 <label for="privacy_guarantor_checkouts">Show checkouts to guarantors</label>
581 <select name="privacy_guarantor_checkouts" id="privacy_guarantor_checkouts">
582 [% IF borrower_data.privacy_guarantor_checkouts %]
583 <option value="0">No</option>
584 <option value="1" selected>Yes</option>
586 <option value="0" selected>No</option>
587 <option value="1">Yes</option>
590 <div class="hint">Allow guarantors of this patron to view this patron's checkouts from the OPAC</div>
593 [% IF Koha.Preference('AllowStaffToSetFinesVisibilityForGuarantor') %]
595 <label for="privacy_guarantor_fines">Show fines to guarantors</label>
596 <select name="privacy_guarantor_fines" id="privacy_guarantor_fines">
597 [% IF borrower_data.privacy_guarantor_fines %]
598 <option value="0">No</option>
599 <option value="1" selected>Yes</option>
601 <option value="0" selected>No</option>
602 <option value="1">Yes</option>
605 <div class="hint">Allow guarantors of this patron to view this patron's fines from the OPAC</div>
609 </fieldset> <!-- /#memberentry_guarantor -->
610 </div> <!-- #/memberentry_guarantor_anchor -->
612 [% UNLESS nocontactname && nocontactfirstname && norelationship %]
613 <fieldset class="rows" id="non_patron_guarantor">
614 <legend>Non-patron guarantor</legend>
616 [% UNLESS nocontactname %]
618 [% IF ( mandatorycontactname ) %]
619 <label for="contactname" class="required">
621 <label for="contactname">
625 <input type="text" id="contactname" name="contactname" value="[% patron.contactname | html %]" />
626 [% IF ( mandatorycontactname ) %]
627 <span class="required">Required</span>
629 <div class="hint">Non-patron guarantor surname</div>
631 [% END # /UNLESS nocontactname %]
633 [% UNLESS nocontactfirstname %]
635 [% IF ( mandatorycontactfirstname ) %]
636 <label for="contactfirstname" class="required">
638 <label for="contactfirstname">
640 Guarantor first name:
642 <input type="text" id="contactfirstname" name="contactfirstname" value="[% patron.contactfirstname | html %]" />
643 [% IF ( mandatorycontactfirstname ) %]
644 <span class="required">Required</span>
646 <div class="hint">Non-patron guarantor first name</div>
648 [% END # /UNLESS noaltcontactfirstname %]
650 [% UNLESS norelationship %]
651 [% IF possible_relationships %]
653 <label for="relationship">Relationship: </label>
654 <select class="relationship" name="relationship">
655 <option value=""></option>
656 [% FOREACH pr IN possible_relationships.split('\|') %]
657 [% IF pr == borrower_data.relationship %]
658 <option value="[% pr | html %]" selected="selected">[% pr | html %]</option>
660 <option value="[% pr | html %]">[% pr | html %]</option>
665 [% END #/IF possible_relationships %]
666 [% END # /UNLESS norelationship %]
668 </fieldset> <!-- /#non_patron_guarantor -->
669 [% END # /UNLESS nocontactname && nocontactfirstname && norelationship %]
670 [% END # /IF show_guarantor || guarantor %]
672 [% UNLESS noaddress && noaddress2 && nocity && nostate && nozipcode && nocountry %]
673 [% PROCESS 'main-address-style' %]
674 [% END # /UNLESS nostreet && nocity etc group%]
676 [% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %]
677 <fieldset class="rows" id="memberentry_contact">
678 <legend id="contact_lgd">Contact information</legend>
682 [% IF ( mandatoryphone ) %]
683 <label for="phone" class="required">
689 <input type="text" id="phone" name="phone" value="[% patron.phone | html %]" />
690 [% IF ( mandatoryphone ) %]
691 <span class="required">Required</span>
693 <div class="hint">Shows on transit slips</div>
695 [% END # /UNLESS nophone %]
697 [% UNLESS nophonepro %]
699 [% IF ( mandatoryphonepro ) %]
700 <label for="phonepro" class="required">
702 <label for="phonepro">
706 <input type="text" id="phonepro" name="phonepro" value="[% patron.phonepro | html %]" />
707 [% IF ( mandatoryphonepro ) %]
708 <span class="required">Required</span>
711 [% END # /UNLESS nophonepro %]
713 [% UNLESS nomobile %]
715 [% IF ( mandatorymobile ) %]
716 <label for="mobile" class="required">
722 <input type="text" id="mobile" name="mobile" value="[% patron.mobile | html %]" />
723 [% IF ( mandatorymobile ) %]
724 <span class="required">Required</span>
727 [% END # /UNLESS nomobile %]
731 [% IF ( mandatoryemail ) %]
732 <label for="email" class="required">
738 [% IF ( NoUpdateEmail ) %]
739 <input type="text" id="email" name="email" size="45" value="[% patron.email | html %]" disabled="disabled" />
741 <input type="text" id="email" name="email" size="45" value="[% patron.email | html %]" />
743 [% IF ( mandatoryemail ) %]
744 <span class="required">Required</span>
746 <div class="hint">Shows on transit slips</div>
748 [% END #/UNLESS noemail %]
750 [% UNLESS noemailpro %]
752 [% IF ( mandatoryemailpro ) %]
753 <label for="emailpro" class="required">
755 <label for="emailpro">
759 [% IF ( NoUpdateEmail ) %]
760 <input type="text" id="emailpro" name="emailpro" size="45" value="[% patron.emailpro | html %]" disabled="disabled"/>
762 <input type="text" id="emailpro" name="emailpro" size="45" value="[% patron.emailpro | html %]" />
764 [% IF ( mandatoryemailpro ) %]
765 <span class="required">Required</span>
768 [% END #/UNLESS noemailpro %]
772 [% IF ( mandatoryfax ) %]
773 <label for="fax" class="required">
779 <input type="text" id="fax" name="fax" value="[% patron.fax | html %]" />
780 [% IF ( mandatoryfax ) %]
781 <span class="required">Required</span>
784 [% END #/UNLESS nofax %]
786 [% UNLESS noprimary_contact_method %]
788 [% IF mandatoryprimary_contact_method %]
789 <label for="primary_contact_method" class="required">
791 <label for="primary_contact_method">
793 Main contact method: </label>
795 <select id="primary_contact_method" name="primary_contact_method">
796 <option value=""></option>
798 [% IF ( borrower_data.primary_contact_method == 'phone' ) %]
799 <option value="phone" selected="selected">Primary phone</option>
801 <option value="phone">Primary phone</option>
804 [% UNLESS nophonepro %]
805 [% IF ( borrower_data.primary_contact_method == 'phonepro' ) %]
806 <option value="phonepro" selected="selected">Secondary phone</option>
808 <option value="phonepro">Secondary phone</option>
811 [% UNLESS nomobile %]
812 [% IF ( borrower_data.primary_contact_method == 'mobile' ) %]
813 <option value="mobile" selected="selected">Other phone</option>
815 <option value="mobile">Other phone</option>
819 [% IF ( borrower_data.primary_contact_method == 'email' ) %]
820 <option value="email" selected="selected">Primary email</option>
822 <option value="email">Primary email</option>
825 [% UNLESS noemailpro %]
826 [% IF ( borrower_data.primary_contact_method == 'emailpro' ) %]
827 <option value="emailpro" selected="selected">Secondary email</option>
829 <option value="emailpro">Secondary email</option>
833 [% IF ( borrower_data.primary_contact_method == 'fax' ) %]
834 <option value="fax" selected="selected">Fax</option>
836 <option value="fax">Fax</option>
840 [% IF mandatoryprimary_contact_method %]
841 <span class="required">Required</span>
846 </fieldset> <!-- /#memberentry_contact -->
847 [% END # hide fieldset %]
849 <!-- ************************ STEP_1 *********************** -->
850 [% END # /IF ( step_1 ) %]
853 [% UNLESS noB_address && noB_address2 && noB_city && noB_zipcode && noB_state && noB_country &&nocontactnote && noB_phone && noB_email %]
854 [% PROCESS 'alt-address-style' %]
855 [% END # UNLESS noB_address && noB_city && noB_state && noB_phone && noB_email %]
856 [% END # /IF ( step_6 ) %]
859 [% UNLESS noaltcontactsurname && noaltcontactfirstname && noaltcontactaddress1 && noaltcontactaddress2 && noaltcontactaddress3 && noaltcontactstate && noaltcontactzipcode && noaltcontactcountry && noaltcontactphone %]
860 [% PROCESS 'alt-contact-style' %]
861 [% END # UNLESS noaltcontactsurname && noaltcontactfirstname etc %]
862 [% END # /IF ( step_2 ) %]
865 [% SET autoMemberNum = Koha.Preference('autoMemberNum') %]
866 <fieldset class="rows" id="memberentry_library_management">
867 <legend id="library_management_lgd">Library management</legend>
869 [% UNLESS nocardnumber %]
871 [% IF mandatorycardnumber %]
872 <label for="cardnumber" class="required">
874 <label for="cardnumber" class="validated">
879 <!-- NOTE: div.hint closing tag isn't on the same line -->
880 [% IF minlength_cardnumber == maxlength_cardnumber %]
881 <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% borrower_data.cardnumber | html %]" minlength="[% minlength_cardnumber | html %]" maxlength="[% maxlength_cardnumber | html %]" />
882 [% IF mandatorycardnumber %]
883 <span class="required">Required</span>
885 <span id="cn_max" class="required">Card number must not be more than [% maxlength_cardnumber | html %] characters.</span>
886 <div class="hint">Card number must be exactly [% minlength_cardnumber | html %] characters.
887 [% ELSIF minlength_cardnumber && maxlength_cardnumber %]
888 <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% borrower_data.cardnumber | html %]" minlength="[% minlength_cardnumber | html %]" maxlength="[% maxlength_cardnumber | html %]" />
889 [% IF mandatorycardnumber %]
890 <span class="required">Required</span>
892 <span id="cn_max" class="required">Card number must not be more than [% maxlength_cardnumber | html %] characters.</span>
893 <div class="hint">Card number must be between [% minlength_cardnumber | html %] and [% maxlength_cardnumber | html %] characters.
894 [% ELSIF maxlength_cardnumber %]
895 <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% borrower_data.cardnumber | html %]" maxlength="[% maxlength_cardnumber | html %]" />
896 [% IF mandatorycardnumber %]
897 <span class="required">Required</span>
899 <span id="cn_max" class="required">Card number must not be more than [% maxlength_cardnumber | html %] characters.</span>
900 <div class="hint">Card number can be up to [% maxlength_cardnumber | html %] characters.
902 <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% borrower_data.cardnumber | html %]" />
903 [% IF mandatorycardnumber %]
904 <span class="required">Required</span>
906 <div class="hint">There is no minimum or maximum character length.
908 [% IF autoMemberNum %]
909 [% IF mandatorycardnumber %]
910 <br/><span class="error">AutoMemberNum is set to enabled, but card number is marked as mandatory in BorrowerMandatoryField: auto calc has been disabled.</span>
912 <br/>Leave blank for auto calc during registration
915 </div><!--/div.hint -->
917 [% END # /UNLESS nocardnumber %]
919 [% UNLESS nobranchcode %]
921 <label for="libraries" class="required">Library:</label>
922 <select name="branchcode" id="libraries">
923 [% PROCESS options_for_libraries libraries => Branches.all( selected => userbranch, only_from_group => 1 ) %]
925 <span class="required">Required</span>
930 <label for="categorycode_entry" class="required">Category: </label>
931 <select id="categorycode_entry" name="categorycode">
932 [% FOREACH category_type IN patron_categories.keys %]
933 [% SWITCH category_type %]
935 <optgroup label="Child">
937 <optgroup label="Adult">
939 <optgroup label="Staff">
941 <optgroup label="Organization">
943 <optgroup label="Professional">
945 <optgroup label="Statistical">
947 <optgroup label="Unknown">
949 [% FOREACH category IN patron_categories.$category_type %]
950 [% IF category.categorycode == patron_category.categorycode %]
951 <option value="[% category.categorycode | html %]" selected="selected" data-pwd-length="[% category.effective_min_password_length | html %]" data-pwd-strong="[% category.effective_require_strong_password | html %]" data-typename="[% category_type | html %]">[% category.description | html %]</option>
953 <option value="[% category.categorycode | html %]" data-pwd-length="[% category.effective_min_password_length | html %]" data-pwd-strong="[% category.effective_require_strong_password | html %]" data-typename="[% category_type | html %]">[% category.description | html %]</option>
959 <span class="required">Required</span>
964 [% IF ( mandatorysort1 ) %]
965 <label for="sort1" class="required">
971 [% PROCESS 'av-build-dropbox.inc' name="sort1", category="Bsort1", default=borrower_data.sort1, empty=1, size = 20 %]
972 [% IF ( mandatorysort1 ) %]
973 <span class="required">Required</span>
976 [% END # /UNLESS nosort1 %]
980 [% IF ( mandatorysort2 ) %]
981 <label for="sort2" class="required">
987 [% PROCESS 'av-build-dropbox.inc' name="sort2", category="Bsort2", default=borrower_data.sort2, empty=1, size = 20 %]
988 [% IF ( mandatorysort2 ) %]
989 <span class="required">Required</span>
992 [% END # /UNLESS nosort2 %]
994 [% UNLESS noautorenew_checkouts %]
996 <label for="yes-autorenew_checkouts">
997 Allow auto-renewal of items:
999 [% IF ( borrower_data.autorenew_checkouts || opadd ) %]
1000 <label for="yes-autorenew_checkouts">
1002 <input type="radio" id="yes-autorenew_checkouts" name="autorenew_checkouts" value="1" checked="checked" />
1004 <label for="no-autorenew_checkouts">
1006 <input type="radio" id="no-autorenew_checkouts" name="autorenew_checkouts" value="0" />
1009 <label for="yes-autorenew_checkouts">
1011 <input type="radio" id="yes-autorenew_checkouts" name="autorenew_checkouts" value="1" />
1013 <label for="no-autorenew_checkouts">
1015 <input type="radio" id="no-autorenew_checkouts" name="autorenew_checkouts" value="0" checked="checked" />
1021 [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
1023 <label for="checkprevcheckout">Check for previous checkouts: </label>
1024 <select name="checkprevcheckout" id="checkprevcheckout">
1025 [% IF ( borrower_data.checkprevcheckout == 'yes' ) %]
1026 <option value="yes" selected="selected">Yes if settings allow it</option>
1027 <option value="no">No if settings allow it</option>
1028 <option value="inherit">Inherit from settings</option>
1029 [% ELSIF ( borrower_data.checkprevcheckout == 'no' ) %]
1030 <option value="yes">Yes if settings allow it</option>
1031 <option value="no" selected="selected">No if settings allow it</option>
1032 <option value="inherit">Inherit from settings</option>
1034 <option value="yes">Yes if settings allow it</option>
1035 <option value="no">No if settings allow it</option>
1036 <option value="inherit" selected="selected">Inherit from settings</option>
1040 [% END # /IF ( Koha.Preference('CheckPrevCheckout') %]
1042 [% IF Koha.Preference('TranslateNotices') %]
1044 <label for="lang">Preferred language for notices: </label>
1045 <select id="lang" name="lang">
1046 <option value="default">Default</option>
1047 [% FOR language IN languages %]
1048 [% FOR sublanguage IN language.sublanguages_loop %]
1049 [% IF language.plural %]
1050 [% IF sublanguage.rfc4646_subtag == borrower_data.lang %]
1051 <option value="[% sublanguage.rfc4646_subtag | html %]" selected="selected">[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
1053 <option value="[% sublanguage.rfc4646_subtag | html %]">[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
1056 [% IF sublanguage.rfc4646_subtag == borrower_data.lang %]
1057 <option value="[% sublanguage.rfc4646_subtag | html %]" selected="selected">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
1059 <option value="[% sublanguage.rfc4646_subtag | html %]">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
1061 [% END # /IF language.plural %]
1062 [% END # /FOR sublanguage %]
1063 [% END #/FOR language %]
1064 </select> <!-- /#lang -->
1066 [% END #/IF Koha.Preference('TranslateNotices') %]
1068 </fieldset> <!-- /#memberentry_library_management -->
1070 [% UNLESS nodateenrolled && noopacnote && noborrowernotes %]
1071 <fieldset class="rows" id="memberentry_subscription">
1072 <legend id="library_setup_lgd">Library setup</legend><ol>
1073 [% UNLESS nodateenrolled %]
1075 [% IF ( mandatorydateenrolled ) %]
1076 <label for="from" class="required">
1082 <input type="text" id="from" name="dateenrolled" maxlength="10" size="10" value="[% borrower_data.dateenrolled | html %]" class="flatpickr" data-date_to="to" />
1083 [% IF ( mandatorydateenrolled ) %]
1084 <span class="required">Required</span>
1086 [% IF ( ERROR_dateenrolled ) %]
1087 <span class="required">(Error)</span>
1089 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
1091 [% END # /UNLESS nodateenrolled %]
1093 [% UNLESS nodateexpiry %]
1096 <li style="display:none">
1098 [% IF ( mandatorydateexpiry ) %]
1099 <label for="to" class="required">
1103 Expiry date (leave blank for auto calc):
1105 [% UNLESS ( opadd ) %]
1106 <input type="text" id="to" name="dateexpiry" maxlength="10" size="10" value="[% borrower_data.dateexpiry | html UNLESS opduplicate %]" class="flatpickr" />
1108 <input type="text" id="to" name="dateexpiry" maxlength="10" size="10" value="[% borrower_data.dateexpiry | html %]" class="flatpickr" />
1110 [% IF ( mandatorydateexpiry ) %]
1111 <span class="required">Required</span>
1113 [% IF ( ERROR_dateexpiry ) %]
1114 <span class="required">(Error)</span>
1116 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
1119 [% UNLESS noopacnote %]
1121 [% IF ( mandatoryopacnote ) %]
1122 <label for="opacnote" class="required">
1124 <label for="opacnote">
1128 <textarea id="opacnote" name="opacnote" cols="55" rows="5">[% borrower_data.opacnote | html UNLESS opduplicate %]</textarea>
1129 <div class="hint">This message appears on this patron's user page in the OPAC</div>
1130 [% IF ( mandatoryopacnote ) %]
1131 <span class="required">Required</span>
1134 [% END # /UNLESS noopacnote %]
1136 [% UNLESS noborrowernotes %]
1138 [% IF ( mandatoryborrowernotes ) %]
1139 <label for="borrowernotes" class="required">
1141 <label for="borrowernotes">
1145 <textarea id="borrowernotes" name="borrowernotes" cols="55" rows="5">[% borrower_data.borrowernotes | html UNLESS opduplicate %]</textarea>
1146 <div class="hint">This message displays when checking out to this patron</div>
1147 [% IF ( mandatoryborrowernotes ) %]
1148 <span class="required">Required</span>
1151 [% END # /UNLESS noborrowernotes %]
1153 </fieldset> <!-- /#memberentry_subscription -->
1154 [% END # hide fieldset %]
1156 [% UNLESS nouserid && nopassword && !CanUpdatePasswordExpiration %]
1157 <fieldset class="rows" id="memberentry_userid">
1158 <legend id="opac_staff_login_lgd">OPAC/Staff interface login</legend>
1160 [% UNLESS nouserid %]
1162 [% IF ( mandatoryuserid ) %]
1163 <label for="userid" class="required">
1165 <label for="userid">
1170 [% IF ( NoUpdateLogin ) %]
1171 [% IF ( opduplicate ) %]
1172 <input type="text" id="userid" name="userid" size="20" disabled="disabled" />
1174 <input type="text" id="userid" name="userid" size="20" disabled="disabled" value="[% borrower_data.userid | html %]" />
1177 [% IF ( opduplicate ) %]
1178 <input type="text" id="userid" name="userid" size="20" value="" />
1180 <input type="text" id="userid" name="userid" size="20" value="[% borrower_data.userid | html %]" />
1182 [% END # /IF ( NoUpdateLogin ) %]
1184 [%# Dummy input to avoid Firefox from using userid/password saved for authentication %]
1185 <input type="text" disabled="disabled" style="display:none" />
1187 [% IF ( mandatoryuserid ) %]
1188 <span class="required">Required</span>
1191 [% END # /UNLESS nouserid %]
1193 [% UNLESS nopassword %]
1195 [% IF ( mandatorypassword ) %]
1196 <label for="password" class="required">
1198 <label for="password">
1203 [% IF ( NoUpdateLogin ) %]
1204 [% IF ( opduplicate ) %]
1205 <input type="password" id="password" name="password" size="20" disabled="disabled" />
1207 <input type="password" id="password" name="password" size="20" disabled="disabled" value="[% borrower_data.password | html %]" />
1210 [% IF ( opduplicate ) %]
1211 <input type="password" id="password" name="password" size="20" autocomplete="new-password" />
1213 <input type="password" id="password" name="password" size="20" autocomplete="new-password" value="[% borrower_data.password | html %]" />
1215 [% END # /IF ( NoUpdateLogin ) %]
1216 [% ELSE # IF ( opadd ) %]
1218 [% IF ( borrower_data.password ) %]
1219 [% IF ( NoUpdateLogin ) %]
1220 <input type="password" id="password" name="password" size="20" disabled="disabled" value="****" />
1222 [% IF ( opduplicate ) %]
1223 <input type="password" id="password" name="password" autocomplete="new-password" size="20" />
1225 <input type="password" id="password" name="password" size="20" value="****" />
1229 [% IF ( NoUpdateLogin ) %]
1230 <input type="password" id="password" name="password" size="20" disabled="disabled" value="" />
1232 <input type="password" id="password" name="password" size="20" autocomplete="new-password" value="" />
1234 [% END # /IF ( password ) %]
1235 [% END # /IF ( opadd ) %]
1236 [% IF ( mandatorypassword ) %]
1237 <span class="required">Required</span>
1239 [% IF ( ERROR_password_too_short ) %]
1240 <span class="required">Password is too short</span>
1242 [% IF ( ERROR_password_too_weak ) %]
1243 <span class="required">Password is too weak</span>
1245 [% IF ( ERROR_password_has_whitespaces ) %]
1246 <span class="required">Password has leading or trailing whitespaces</span>
1248 <div class="hint">Minimum password length: [% patron.category.effective_min_password_length | html %]</div>
1252 [% IF ( mandatorypassword ) %]
1253 <label for="password2" class="required">
1255 <label for="password2">
1260 [% IF ( NoUpdateLogin ) %]
1261 [% IF ( opduplicate ) %]
1262 <input type="password" id="password2" name="password2" size="20" disabled="disabled" />
1264 <input type="password" id="password2" name="password2" size="20" disabled="disabled" value="[% borrower_data.password | html %]" />
1267 [% IF ( opduplicate ) %]
1268 <input type="password" id="password2" name="password2" size="20" />
1270 <input type="password" id="password2" name="password2" size="20" value="[% borrower_data.password | html %]" />
1273 [% ELSE # IF ( opadd ) %]
1274 [% IF ( borrower_data.password ) %]
1275 [% IF ( NoUpdateLogin ) %]
1276 <input type="password" id="password2" name="password2" size="20" disabled="disabled" value="****" />
1278 [% IF ( opduplicate ) %]
1279 <input type="password" id="password2" name="password2" size="20" />
1281 <input type="password" id="password2" name="password2" size="20" value="****" />
1285 [% IF ( NoUpdateLogin ) %]
1286 <input type="password" id="password2" name="password2" size="20" disabled="disabled" value="" />
1288 <input type="password" id="password2" name="password2" size="20" value="" />
1291 [% END # /IF ( opadd ) %]
1293 [% IF ( mandatorypassword ) %]
1294 <span class="required">Required</span>
1296 [% IF ( ERROR_password_mismatch ) %]
1297 <span class="required">Passwords do not match</span>
1300 [% END # /UNLESS nopassword %]
1301 [% UNLESS ( !CanUpdatePasswordExpiration ) %]
1303 <label for="password_expiration_date">Password expiration date:</label>
1304 <input type="text" id="password_expiration_date" name="password_expiration_date" maxlength="10" size="10" value="[% password_expiration_date | html %]" class="flatpickr" />
1308 </fieldset> <!-- /#memberentry_userid -->
1309 [% END # UNLESS nouserid && nopassword && !CanUpdatePasswordExpiration %]
1311 <!--this zones are not necessary in modif mode -->
1312 [% UNLESS ( opadd || opduplicate ) %]
1313 <fieldset class="rows" id="memberentry_account_flags">
1314 <legend id="account_flags_lgd">Patron account flags</legend>
1316 [% FOREACH flagloo IN flagloop %]
1318 <label class="radio" for="yes[% flagloo.name | html %]">
1319 [% IF ( flagloo.key == 'gonenoaddress' ) %]Gone no address:[% END %]
1320 [% IF ( flagloo.key == 'lost' ) %]Lost card:[% END %]
1322 [% IF CAN_user_circulate_manage_restrictions %]
1323 <label for="yes[% flagloo.name | html %]">
1324 [% IF ( flagloo.yes ) %]
1325 <input type="radio" id="yes[% flagloo.name | html %]" name="[% flagloo.name | html %]" value="1" checked="checked" />
1327 <input type="radio" id="yes[% flagloo.name | html %]" name="[% flagloo.name | html %]" value="1" />
1331 <label for="no[% flagloo.name | html %]">
1332 [% IF ( flagloo.no ) %]
1333 <input type="radio" id="no[% flagloo.name | html %]" name="[% flagloo.name | html %]" value="0" checked="checked"/>
1335 <input type="radio" id="no[% flagloo.name | html %]" name="[% flagloo.name | html %]" value="0" />
1340 [% IF flagloo.yes %]<span>Yes</span>[% ELSE %]<span>No</span>[% END %]
1341 [% END # /IF CAN_user_circulate_manage_restrictions %]
1343 [% END # /FOREACH flagloo %]
1345 </fieldset> <!-- /#memberentry_account_flags -->
1347 <fieldset class="rows" id="memberentry_restrictions">
1348 <legend id="restrictions_lgd">Patron restrictions</legend>
1349 [% IF ( debarments ) %]
1356 <th>[% tp('patron restriction created on', 'Created') | html %]</th>
1357 [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
1363 [% FOREACH d IN debarments %]
1364 [% dtype = d.type %]
1366 <td>[% restriction_types.$dtype.display_text | html %]</td>
1368 [% IF d.comment.search('OVERDUES_PROCESS') %]
1369 Restriction added by overdues process [% d.comment.remove('OVERDUES_PROCESS ') | $raw %]
1371 [% d.comment | $raw %]
1375 [% IF d.expiration %]
1376 [% d.expiration | $KohaDates %]
1381 <td>[% d.created | $KohaDates %]</td>
1382 [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
1384 <input type="checkbox" id="debarment_[% d.borrower_debarment_id | html %]" name="remove_debarment" value="[% d.borrower_debarment_id | html %]" />
1388 [% END # /FOREACH d %]
1392 <p>Patron is currently unrestricted.</p>
1393 [% END # /IF ( debarments ) %]
1395 [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
1396 <p><a href="#" id="add_manual_restriction">Add manual restriction</a></p>
1397 <fieldset id="manual_restriction_form">
1398 <input type="hidden" id="add_debarment" name="add_debarment" value="0" />
1399 <legend id="manual_restriction_lgd">Add manual restriction</legend>
1401 [% IF Koha.Preference('PatronRestrictionTypes') %]
1403 <label for="debarred_type">Type:</label>
1404 <select name="debarred_type">
1405 [% FOREACH code IN restriction_types.keys %]
1406 [% IF !restriction_types.$code.is_system %]
1407 [% IF restriction_types.$code.is_default %]
1408 <option value="[% code | html %]" selected>[% PROCESS restriction_type_description restriction=restriction_types.$code %]</option>
1410 <option value="[% code | html %]">[% PROCESS restriction_type_description restriction=restriction_types.$code %]</option>
1418 <label for="debarred_comment">Comment: </label>
1419 <input type="text" id="debarred_comment" name="debarred_comment" />
1422 <label for="debarred_expiration">Expiration: </label>
1423 <input name="debarred_expiration" id="debarred_expiration" size="10" value="" class="flatpickr" type="text" />
1424 <a href="#" id="clear_debarred_expiration">Clear date</a>
1428 <a class="cancel" id="cancel_manual_restriction" href="#">Cancel</a>
1430 </fieldset> <!-- /#manual_restriction_form -->
1431 [% END # /IF CAN_user_borrowers_edit_borrowers %]
1432 </fieldset> <!-- /#memberentry_restrictions -->
1433 [% END # /UNLESS ( opadd || opduplicate ) %]
1434 [% END # /IF ( step_3 ) %]
1437 [% IF Koha.Preference('HouseboundModule') %]
1438 <fieldset class="rows" id="memberentry_housebound_roles">
1439 <legend id="housebound_roles">Housebound roles</legend>
1442 <label class="radio" for="housebound_chooser">
1445 [% IF ( housebound_role.housebound_chooser == 1 ) %]
1446 <label for="yes_housebound_chooser">Yes </label>
1447 <input type="radio" id="yes_housebound_chooser" name="housebound_chooser" value="1" checked="checked" />
1448 <label for="no_housebound_chooser">No </label>
1449 <input type="radio" id="no_housebound_chooser" name="housebound_chooser" value="0" />
1451 <label for="yes_housebound_chooser">Yes </label>
1452 <input type="radio" id="yes_housebound_chooser" name="housebound_chooser" value="1" />
1453 <label for="no_housebound_chooser">No </label>
1454 <input type="radio" id="no_housebound_chooser" name="housebound_chooser" value="0" checked="checked" />
1458 <label class="radio" for="housebound_deliverer">Deliverer:</label>
1459 [% IF ( housebound_role.housebound_deliverer == 1 ) %]
1460 <label for="yes_housebound_deliverer">Yes </label>
1461 <input type="radio" id="yes_housebound_deliverer" name="housebound_deliverer" value="1" checked="checked" />
1462 <label for="no_housebound_deliverer">No </label>
1463 <input type="radio" id="no_housebound_deliverer" name="housebound_deliverer" value="0" />
1465 <label for="yes_housebound_deliverer">Yes </label>
1466 <input type="radio" id="yes_housebound_deliverer" name="housebound_deliverer" value="1" />
1467 <label for="no_housebound_deliverer">No </label>
1468 <input type="radio" id="no_housebound_deliverer" name="housebound_deliverer" value="0" checked="checked" />
1471 </ol> <!-- /ol.radio -->
1472 </fieldset> <!-- /#memberentry_housebound_roles -->
1473 [% END # hide fieldset %]
1474 [% END # IF step_7 %]
1477 [% IF Koha.Preference('ExtendedPatronAttributes') %]
1478 [% UNLESS ( no_patron_attribute_types ) %]
1479 <fieldset class="rows" id="memberentry_patron_attributes">
1480 <legend id="patron_attributes_lgd">Additional attributes and identifiers</legend>
1481 <input type="hidden" name="setting_extended_patron_attributes" value="1" />
1482 [% FOREACH pa_loo IN patron_attributes %]
1483 <ol class="attributes_table">
1484 [% IF pa_loo.class %]
1485 <fieldset id="aai_[% pa_loo.class | html %]">
1486 <legend id="[% pa_loo.class | html %]_lgd">[% pa_loo.lib | html %]</legend>
1488 [% FOREACH patron_attribute IN pa_loo.items %]
1489 <li data-category_code="[% patron_attribute.category_code | html %]">
1490 [% IF patron_attribute.mandatory %]
1491 <label for="[% patron_attribute.form_id | html %]" class="required" required="required">[% patron_attribute.description | html %]: </label>
1493 <label for="[% patron_attribute.form_id | html %]">[% patron_attribute.description | html %]: </label>
1495 [% IF ( patron_attribute.use_dropdown ) %]
1496 [% IF patron_attribute.mandatory %]
1497 <select id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]" required="required">
1499 <select id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]">
1501 <option value=""></option>
1502 [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
1503 [% IF auth_val_loo.authorised_value == patron_attribute.value %]
1504 <option value="[% auth_val_loo.authorised_value | html %]" selected="selected">
1505 [% auth_val_loo.lib | html %]
1508 <option value="[% auth_val_loo.authorised_value | html %]" >
1509 [% auth_val_loo.lib | html %]
1515 [% IF patron_attribute.mandatory %]
1516 <textarea rows="2" cols="30" id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]" required="required">[% patron_attribute.value | html %]</textarea>
1518 <textarea rows="2" cols="30" id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]">[% patron_attribute.value | html %]</textarea>
1520 [% END # /IF ( patron_attribute.use_dropdown ) %]
1521 <input type="hidden" id="[% patron_attribute.form_id | html %]_code" name="[% patron_attribute.form_id | html %]_code" value="[% patron_attribute.code | html %]" />
1522 <a href="#" class="clear_attribute"><i class="fa fa-fw fa-trash"></i> Clear</a>
1523 [% IF ( patron_attribute.repeatable ) %]
1524 <a href="#" class="clone_attribute"><i class="fa fa-fw fa-plus"></i> New</a>
1526 [% IF patron_attribute.mandatory %]<span class="required">Required</span>[% END %]
1528 [% END # /FOREACH patron_attribute %]
1529 [% IF pa_loo.class %]</fieldset>[% END %]
1531 [% END # /FOREACH pa_loo %]
1532 </fieldset> <!-- /#memberentry_patron_attributes -->
1533 [% END # UNLESS ( no_patron_attribute_types ) %]
1534 [% END # IF Koha.Preference('ExtendedPatronAttributes') %]
1535 [% END # IF ( step_4 ) %]
1538 [% IF ( EnhancedMessagingPreferences ) %]
1539 <fieldset class="rows" id="memberentry_messaging_prefs">
1540 <legend id="patron_messaging_prefs_lgd">Patron messaging preferences</legend>
1541 <div id="messaging_prefs_loading" class="form-message" style="display:none">
1542 <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading new messaging defaults
1544 <input type="hidden" name="setting_messaging_prefs" value="1" />
1545 [% INCLUDE 'messaging-preference-form.inc' %]
1546 [% IF ( SMSSendDriver ) %]
1548 <label for="SMSnumber">SMS number:</label>
1549 <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber | html %]" />
1550 <span class="hint sms_number_help">Please enter numbers only. Prefix the number with + or 00 if including the country code.</span>
1552 [% IF SMSSendDriver == 'Email' && !nosms_provider_id %]
1554 <label for="sms_provider_id">SMS provider:</label>
1555 <select id="sms_provider_id" name="sms_provider_id">
1556 <option value="">Unknown</option>
1557 [% FOREACH s IN sms_providers %]
1558 [% IF s.id == borrower_data.sms_provider_id %]
1559 <option value="[% s.id | html %]" selected="selected">[% s.name | html %]</option>
1561 <option value="[% s.id | html %]">[% s.name | html %]</option>
1566 [% END # /UNLESS nosms_provider_id %]
1567 [% END # IF ( SMSSendDriver ) %]
1569 [% END # IF ( EnhancedMessagingPreferences ) %]
1570 [% END # /IF step_5 %]
1571 </form> <!-- /#entryform -->
1573 [% IF quickadd && opadd && !check_member %]
1574 <form id="quick_add_form" class="toggler">
1575 <fieldset class="rows quick_add"><legend>Quick add</legend>
1576 <ol id="quick_add_list">
1582 [% END # /UNLESS ( no_add ) %]
1584 </div> <!-- /.col-sm-10.col-sm-push-2 -->
1586 [% UNLESS ( opadd ) %]
1587 <div class="col-sm-2 col-sm-pull-10">
1589 [% INCLUDE 'circ-menu.inc' %]
1591 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1593 </div> <!-- /.row -->
1595 [% MACRO jsinclude BLOCK %]
1596 [% Asset.js("lib/hc-sticky.js") | $raw %]
1597 [% INCLUDE 'calendar.inc' %]
1598 [% INCLUDE 'str/members-menu.inc' %]
1599 [% Asset.js("js/members-menu.js") | $raw %]
1601 function update_cardnumber_warning(size){
1602 var max_len = [% maxlength_cardnumber | html %];
1603 if ( size >= max_len ) {
1604 $("#cn_max").show();
1606 $("#cn_max").hide();
1610 function showHideFields(){
1611 [% UNLESS step == 1 %]
1612 [% IF fieldstohide.match('identity') %]
1613 $("#memberentry_identity").find('legend').nextAll().toggle();
1615 [% IF show_guarantor || guarantor %]
1616 [% IF fieldstohide.match('guarantor') %]
1617 $("#memberentry_guarantor").find('legend').nextAll().toggle();
1618 $("#guarantor_template").toggle();
1621 [% IF fieldstohide.match('primary_address') %]
1622 $("#memberentry_mainaddress").find('legend').nextAll().toggle();
1624 [% IF fieldstohide.match('primary_contact') %]
1625 $("#memberentry_contact").find('legend').nextAll().toggle();
1628 [% UNLESS step == 6 %]
1629 [% IF fieldstohide.match('alt_address') %]
1630 $("#memberentry_address").find('legend').nextAll().toggle();
1633 [% UNLESS step == 2 %]
1634 [% IF fieldstohide.match('alt_contact') %]
1635 $("#memberentry_altaddress").find('legend').nextAll().toggle();
1638 [% UNLESS step == 3 %]
1639 [% IF fieldstohide.match('lib_mgmt') %]
1640 $("#memberentry_library_management").find('legend').nextAll().toggle();
1642 [% UNLESS nodateenrolled && noopacnote && noborrowernotes %]
1643 [% IF fieldstohide.match('lib_setup') %]
1644 $("#memberentry_subscription").find('legend').nextAll().toggle();
1647 [% UNLESS nouserid && nopassword %]
1648 [% IF fieldstohide.match('login') %]
1649 $("#memberentry_userid").find('legend').nextAll().toggle();
1652 [% UNLESS ( opadd || opduplicate ) %]
1653 [% IF fieldstohide.match('flags') %]
1654 $("#memberentry_account_flags").find('legend').nextAll().toggle();
1657 [% IF fieldstohide.match('debarments') %]
1658 $("#memberentry_restrictions").find('legend').nextAll().toggle();
1661 [% UNLESS step == 7 %]
1662 [% IF Koha.Preference('HouseboundModule') %]
1663 [% IF fieldstohide.match('housebound') %]
1664 $("#memberentry_housebound_roles").find('legend').nextAll().toggle();
1668 [% UNLESS step == 4 %]
1669 [% IF Koha.Preference('ExtendedPatronAttributes') %]
1670 [% IF fieldstohide.match('additional') %]
1671 $("#memberentry_patron_attributes").find('legend').nextAll().toggle();
1675 [% UNLESS step == 5 %]
1676 [% IF Koha.Preference('EnhancedMessagingPreferences') %]
1677 [% IF fieldstohide.match('messaging') %]
1678 $("#memberentry_messaging_prefs").find('legend').nextAll().toggle();
1679 $("#messaging_prefs_loading").toggle();
1685 $(document).ready(function() {
1687 $("#toggle_hidden_fields").change(function(){
1691 $("legend").click(function(){
1692 $(this).nextAll().toggle();
1693 $("#messaging_prefs_loading").hide();
1694 $("#guarantor_template").hide();
1697 $("#saverecord").css({ 'margin-left': 0 });
1699 Sticky = $("#toolbar");
1702 stickyClass: "floating"
1705 [% IF borrower_data.categorycode %]
1706 update_category_code( "[% borrower_data.categorycode | html %]" );
1708 if ( $("#categorycode_entry").length > 0 ){
1709 var category_code = $("#categorycode_entry").find("option:selected").val();
1710 update_category_code( category_code );
1714 [% IF new_guarantors %]
1715 [% FOREACH g IN new_guarantors %]
1716 select_user( '[% g.patron.borrowernumber | html %]', [% To.json( g.patron.unblessed ) | $raw %], '[% g.relationship | html %]' );
1720 $("#cn_max").hide();
1722 $("#cardnumber").on("keydown", function(e){
1723 content = $(this).val();
1725 $("#cardnumber").on("keyup", function(e){
1726 // .val() will return the value of the input after the key has been released
1727 var l = $(this).val().length;
1728 if ( l == content.length + 1 ) { l--; }
1729 update_cardnumber_warning(l);
1731 $("#cardnumber").bind("paste", function(e){
1732 var pastedData = e.originalEvent.clipboardData.getData('text');
1733 update_cardnumber_warning(pastedData.length - 1);
1735 var toggle_quick_add = $(".toggle_quick_add");
1736 $(toggle_quick_add).click(function(e){
1737 toggle_quick_add.toggle();
1740 var toggle_from = '';
1741 if( $("#entryform:visible").length ) {
1742 toggle_to = "#quick_add_form label";
1743 toggle_from = "#entryform label";
1744 $("#memberentry_guarantor").appendTo("#quick_add_form");
1746 toggle_to="#entryform label";
1747 toggle_from = "#quick_add_form label";
1748 $("#memberentry_guarantor").appendTo("#memberentry_guarantor_anchor");
1750 $(toggle_from).each(function() {
1751 var input_label = $(this).attr('for');
1752 if ( input_label == 'sex-male' || input_label == 'sex-none' || input_label == 'sex-female' || input_label == 'sex-other' ) {
1753 $(toggle_to+"[for='"+input_label+"']").next().prop('checked', $(this).next().prop('checked') );
1756 $(toggle_to+"[for='"+input_label+"']").next().val( $(this).next().val() );
1759 $(".toggler").toggle();
1762 $("#save_quick_add").click(function(){
1763 $("#quick_add_form").validate();
1764 if( $("#quick_add_form").valid()){
1765 $('.toggle_quick_add').click();
1766 $("#memberentry_guarantor").appendTo("#memberentry_guarantor_anchor");
1767 $('#saverecord').click();
1769 else {return false;}
1772 $("#saverecord").click(function(){
1773 if( check_form_borrowers() ){
1774 $("#entryform").submit();
1778 $('#duplicate').on('click', function() {
1779 $("input[name='op']").val('modify');
1780 $("input[name='borrowernumber']").val('[% check_member | html %]');
1781 $("input[name='check_member']").val('');
1782 $('#entryform').submit();
1785 $('#not-duplicate').on('click', function() {
1786 $("input[name='nodouble']").val('1');
1787 $('#entryform').submit();
1790 $(".popup_patronview").on("click", function(e){
1792 var url = $(this).attr("href");
1793 openWindow( url, "patronview" );
1796 $("#dateofbirth").on("change", function(){
1800 $("#debarred_comment, #debarred_expiration").on("change", function(){
1801 $("#add_debarment").val(1);
1804 $("#clear_debarred_expiration").on("click", function(e){
1806 $('#debarred_expiration').val("");
1809 $("#memberentry_patron_attributes").on("click", ".clear_attribute", function(e){
1811 clear_entry( this );
1814 $("#memberentry_patron_attributes").on("click", ".clone_attribute", function(e){
1816 clone_entry( this );
1819 $("#categorycode_entry").on("change", function(){
1820 update_category_code(this);
1824 [% IF quickadd && opadd && !check_member %]
1825 $(document).ready(function () {
1827 $("#entryform,#saverecord").hide();
1828 [% q_add_f = Koha.Preference('PatronQuickAddFields').split('\|') %]
1829 var qaddfields = [[% FOREACH field IN q_add_f.unique %]"[% field | html %]",[% END %]];
1830 $("#entryform label").each(function () {
1831 var input_label = $(this).attr('for');
1832 if ( input_label == 'sex-female' ) {
1835 else if ( input_label == 'btitle' ) {
1836 input_label='title';
1838 if( qaddfields.indexOf( input_label ) != -1 || $(this).attr('class') == 'required' ){
1839 let orig_li = $(this).parent();
1840 if( orig_li.attr('class') == 'radio' ){
1841 let new_field = orig_li.clone();
1842 new_field.children('label').each(function(){
1843 let child_input = $(this).children('input');
1844 child_input.attr("id",child_input.attr("id") + "_quick_add");
1846 new_field.appendTo("#quick_add_list");
1848 let orig_input_id = orig_li.children("input,textarea,select").attr("id");
1849 let new_field = orig_li.clone();
1850 new_field.children("#"+orig_input_id).attr("id",orig_input_id + "_quick_add");
1851 new_field.appendTo("#quick_add_list");
1852 [% UNLESS mandatorypassword %]
1853 if( input_label == 'password' ){
1854 let orig_p2 = $("#entryform label[for='password2']").parent();
1855 let new_p2 = orig_p2.clone();
1856 new_p2.find('input[id="password2"]').attr("id","password2_quick_add");
1857 new_p2.appendTo("#quick_add_list");
1863 if ( $("#memberentry_guarantor").length ) {
1864 $("#memberentry_guarantor").appendTo("#quick_add_form");
1866 $("#quick_add_form").show();
1869 $("#guarantor_template").hide();
1872 [% Asset.js("js/members.js") | $raw %]
1873 [% Asset.js("js/messaging-preference-form.js") | $raw %]
1874 [% PROCESS 'password_check.inc' new_password => 'password', category_selector => '#categorycode_entry', minPasswordLength => patron.category.effective_min_password_length, RequireStrongPassword => patron.category.effective_require_strong_password %]
1877 [% INCLUDE 'intranet-bottom.inc' %]