Koha-clms/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt

1991 lines
144 KiB
Plaintext

[% USE raw %]
[% USE Asset %]
[% USE To %]
[% USE Koha %]
[% USE KohaDates %]
[% USE HtmlScrubber %]
[% USE Branches %]
[% PROCESS 'member-main-address-style.inc' %]
[% PROCESS 'member-alt-address-style.inc' %]
[% PROCESS 'member-alt-contact-style.inc' %]
[% PROCESS 'restriction-types.inc' %]
[% PROCESS 'i18n.inc' %]
[% SET footerjs = 1 %]
[% PROCESS 'patron-search.inc' %]
[% INCLUDE 'doc-head-open.inc' %]
<title
>[% FILTER collapse %]
[% UNLESS blocking_error %]
[% IF ( op == 'add_form' ) %]
[% t("Add patron") | html %]
[% ELSE %]
[% t("Modify patron") | html %]
[% END %]
[% INCLUDE 'patron-title.inc' no_html = 1 %]
[% IF patron_category %]([% patron_category.description | html %])[% END %]
[% END %]
&rsaquo; [% t("Patrons") | html %] &rsaquo; [% t("Koha") | html %]
[% END %]</title
>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="pat_memberentrygen" class="pat">
[% WRAPPER 'header.inc' %]
[% INCLUDE 'patron-search-header.inc' %]
[% END %]
[% WRAPPER 'sub-header.inc' %]
[% WRAPPER breadcrumbs %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
[% END %]
[% UNLESS blocking_error %]
[% UNLESS op == 'add_form' %]
[% IF (borrower_data.firstname || borrower_data.surname ) %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber | uri %]"> [% INCLUDE 'patron-title.inc' %] </a>
[% END %]
[% END %]
[% END %]
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
[% IF ( op == 'add_form' ) %]
<span>Add patron</span>
[% ELSE %]
<span>Modify patron</span>
[% END %]
[% IF patron_category %]
([% patron_category.description | html %])
[% END %]
[% END %]
[% END #/ WRAPPER breadcrumbs %]
[% END #/ WRAPPER sub-header.inc %]
<div class="main container-fluid">
<div class="row">
[% IF borrower_data.messages %]
[% FOR message IN borrower_data.messages %]
[% SWITCH message.error %]
[% CASE 'error_on_insert_patron' %]
<div class="alert alert-warning">Something went wrong when creating the patron. Check the logs for details.</div>
[% CASE 'error_on_update_patron' %]
<div class="alert alert-warning">Something went wrong when updating the patron. Check the logs for details.</div>
[% CASE %]
<div class="alert alert-warning">Unhandled error: [% message.error | html %]</div>
[% END %]
[% END %]
[% END %]
[% IF ( op == 'add_form' ) %]
[% SET div_class = 'col-md-10 offset-md-1 col-lg-8 offset-lg-2' %]
[% ELSE %]
[% SET div_class = 'col-md-10 order-md-2 order-sm-1' %]
[% END %]
<div class="[% div_class | html %]">
<main class="clearfix">
[% INCLUDE 'messages.inc' %]
[% IF error_alert %]
[% IF ( error_alert == "no_email" ) %]
<div class="alert alert-warning">This member has no email</div>
[% ELSE %]
<div class="alert alert-warning">[% error_alert | html %]</div>
[% END %]
[% END %]
[% IF info_alert %]
<div class="alert alert-info">Email has been sent.</div>
[% END %]
[% INCLUDE 'noadd-warnings.inc' %]
[% UNLESS ( no_add ) %]
<h1>
[% IF ( op == 'add_form' ) %]
<span>Add patron</span>
[% ELSIF ( op == 'duplicate' ) %]
<span>Duplicate patron</span>
[% ELSE %]
<span>Modify patron</span>
[% END %]
[% INCLUDE 'patron-title.inc' %]
[% IF patron_category %]([% patron_category.description | html %])[% END %]
</h1>
[% IF quickadd && op == 'add_form' && !check_member %]
<a href="#" class="toggle_quick_add"><i class="fa fa-plus-square"></i> Show full form</a>
<a href="#" class="toggle_quick_add" style="display:none"><i class="fa fa-minus-square"></i> Show brief form</a>
[% END %]
[% IF ( check_member ) %]
<div class="alert alert-warning">
<h3>Duplicate patron record?</h3>
<p>[%- INCLUDE 'patron-title.inc' patron => check_patron hide_patron_infos_if_needed => 1 -%]</p>
[% IF logged_in_user.can_see_patron_infos( check_patron ) %]
<p
><a class="popup_patronview" href="/cgi-bin/koha/members/moremember.pl?print=brief&amp;borrowernumber=[% check_member | uri %]"><i class="fa-solid fa-window-restore"></i> View existing record</a></p
>
[% END %]
<a href="/cgi-bin/koha/members/memberentry.pl?op=edit_form&borrowernumber=[% check_member | uri %]" class="btn btn-default" id="duplicate">
<i class="fa-solid fa-pencil" aria-hidden="true"></i> It is a duplicate. Edit existing record
</a>
<button type="submit" id="not-duplicate" class="new"> <i class="fa fa-plus"></i> Not a duplicate. Save as new record </button>
</div>
[% END %]
[% IF ( nok ) %]
<div class="alert alert-warning">
<p>The following fields are wrong. Please fix them.</p>
<ul>
[% IF ( ERROR_login_exist ) %]
<li id="ERROR_login_exist">Username already exists or could not create unique new one.</li>
[% END %]
[% IF ERROR_cardnumber_already_exists %]
<li id="ERROR_cardnumber">Card number already in use.</li>
[% END %]
[% IF ERROR_cardnumber_length %]
<li id="ERROR_cardnumber">Card number length is incorrect.</li>
[% END %]
[% IF ( ERROR_age_limitations ) %]
<li id="ERROR_age_limitations">Patron's age is incorrect for their category. Ages allowed are [% age_low | html %]-[% age_high | html %].</li>
[% END %]
[% IF ( ERROR_branch ) %]
<li id="ERROR_branch">Library is invalid.</li>
[% END %]
[% IF ( ERROR_dateofbirth ) %]
<li id="ERROR_dateofbirth">Date of birth is invalid.</li>
[% END %]
[% IF ( ERROR_dateenrolled ) %]
<li id="ERROR_dateenrolled">Date of enrollment is invalid.</li>
[% END %]
[% IF ( ERROR_dateexpiry ) %]
<li id="ERROR_dateexpiry">Date of expiration is invalid.</li>
[% END %]
[% IF ( ERROR_password_too_short ) %]
<li id="ERROR_short_password">Password must be at least [% minPasswordLength | html %] characters long.</li>
[% END %]
[% IF ( ERROR_password_too_weak ) %]
<li id="ERROR_weak_password">Password must contain at least one digit, one lowercase and one uppercase.</li>
[% END %]
[% IF ( ERROR_password_has_whitespaces ) %]
<li id="ERROR_weak_password">Password must not contain leading or trailing whitespaces.</li>
[% END %]
[% IF ( ERROR_password_mismatch ) %]
<li id="ERROR_password_mismatch">Passwords do not match.</li>
[% END %]
[% IF ( ERROR_password_expiration_date ) %]
<li id="ERROR_dateexpiry">Password expiration date is invalid.</li>
[% END %]
[% IF ( ERROR_extended_unique_id_failed ) %]
<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
>
[% END %]
[% IF ERROR_bad_email %]
<li id="ERROR_bad_email">The primary email is invalid.</li>
[% END %]
[% IF ERROR_bad_email_secondary %]
<li id="ERROR_bad_email_secondary">The secondary email is invalid.</li>
[% END %]
[% IF ERROR_bad_email_alternative %]
<li id="ERROR_bad_email_alternative">The alternative email is invalid.</li>
[% END %]
[% IF ( ERROR_child_no_guarantor ) %]
<li id="ERROR_child_no_guarantor">A child patron needs a guarantor.</li>
[% END %]
[% IF ( ERROR_child_is_guarantor ) %]
<li id="ERROR_child_is_guarantor">Child patron cannot be a guarantor.</li>
[% END %]
[% IF ( ERROR_guarantor_is_guarantee ) %]
<li id="ERROR_guarantor_is_guarantee">A guarantor cannot be a guarantee.</li>
[% END %]
[% IF ( ERROR_cannot_delete_guarantor ) %]
<li id="ERROR_cannot_delete_guarantor">Cannot delete guarantor(s). A child patron needs a guarantor.</li>
[% END %]
[% IF ( ERROR_invalid_relationship ) %]
<li id="ERROR_invalid_relationship">Guarantor relationship cannot be left blank according to configuration.</li>
[% END %]
</ul>
</div>
[% END %]
[% SET fieldstohide = Koha.Preference('CollapseFieldsPatronAddForm').split(',') %]
[% IF Koha.Preference('CollapseFieldsPatronAddForm') %][% UNLESS step %]
<p id="selections">
<label><input type="checkbox" id="toggle_hidden_fields" title="These fields are collapsed by default by the CollapseFieldsPatronAddForm system preference" /><strong>Show collapsed fields:</strong></label>
[% FOREACH field IN fieldstohide %]
[% SWITCH field %]
[% CASE 'identity' %]
<span>Patron identity</span> |
[% CASE 'guarantor' %]
<span>Guarantor information</span> |
[% CASE 'nonpatron_guarantor' %]
<span>Non-patron guarantor</span> |
[% CASE 'primary_address' %]
<span>Main address</span> |
[% CASE 'primary_contact' %]
<span>Contact information</span> |
[% CASE 'alt_address' %]
<span>Alternate address</span> |
[% CASE 'alt_contact' %]
<span>Alternate contact</span> |
[% CASE 'lib_mgmt' %]
<span>Library management</span> |
[% CASE 'lib_setup' %]
<span>Library setup</span> |
[% CASE 'login' %]
<span>OPAC/Staff interface login</span> |
[% CASE 'flags' %]
<span>Patron account flags</span> |
[% CASE 'debarments' %]
<span>Patron restrictions</span> |
[% CASE 'housebound' %]
[% IF Koha.Preference('HouseboundModule') %]<span>Housebound roles</span> |[% END %]
[% CASE 'additional' %]
<span>Additional attributes and identifiers</span> |
[% CASE 'messaging' %]
<span>Patron messaging preferences</span> |
[% END %]
[% END %]
</p>
[% END %][% END %]
[% UNLESS ( check_member ) %]
<div id="toolbar" class="btn-toolbar sticky">
[% IF quickadd && op == 'add_form' %]
<button class="btn btn-primary toggler" id="save_quick_add" name="save"><i class="fa fa-save"></i> Save</button>
[% END %]
<button class="btn btn-primary toggler" id="saverecord" name="save"><i class="fa fa-save"></i> Save</button>
[% IF op == 'add_form' %]
<a class="btn btn-link toggler save_entryform" href="/cgi-bin/koha/members/member.pl"> <i class="fa fa-times"></i> Cancel </a>
[% ELSE %]
<a class="btn btn-link" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber | html %]"> <i class="fa fa-times"></i> Cancel </a>
[% END %]
</div>
[% END %]
<form name="form" id="entryform" action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off" class="toggler">
[% UNLESS ( check_member ) %]
<input type="hidden" name="nodouble" value="[% nodouble | html %]" />
[% END %]
<!-- field always hidden in different form (1,2,3) -->
<input type="hidden" name="BorrowerMandatoryField" value="[% BorrowerMandatoryField | html %]" />
<input type="hidden" name="updtype" value="[% updtype | html %]" />
<input type="hidden" name="destination" value="[% destination | html %]" />
<input type="hidden" name="check_member" value="[% check_member | html %]" />
<input type="hidden" name="borrowernumber" value="[% borrowernumber | html UNLESS op == 'duplicate' %]" />
<input type="hidden" name="nodouble" value="[% nodouble | html UNLESS op == 'duplicate' %]" />
[% INCLUDE 'csrf-token.inc' %]
[% IF ( step ) %]
<input type="hidden" name="step" value="[% step | html %]" />
[% END %]
[% IF ( op == 'add_form' ) %]
<input type="hidden" name="op" value="cud-insert" />
[% ELSIF ( op == 'duplicate' ) %]
<input type="hidden" name="op" value="cud-insert" />
[% ELSE %]
<input type="hidden" name="op" value="cud-save" />
[% IF step == 4 || step == 5 || step == 6 || step == 2 || step == 1 || step == 7 %]
[%# Only put the card number if we aren't showing it in the form later %]
[% IF borrower_data.cardnumber %]
<input type="hidden" name="cardnumber" value="[% borrower_data.cardnumber | html %]" />
[% END %]
[% END %]
[% END %]
[% IF ( step_1 ) %]
[% UNLESS notitle && nosurname && nofirstname && nopreferred_name && nomiddle_name && nodateofbirth && noinitials && noothernames &&nosex && nopronouns %]
<fieldset class="rows" id="memberentry_identity">
<legend class="expanded" id="identity_lgd">
<i class="fa fa-caret-down" title="Collapse this section"></i>
[% IF ( patron_category.category_type == 'I' ) %]
<span>Organization identity</span>
[% ELSE %]
<span>Patron identity</span>
[% END %]
</legend>
<ol>
[% UNLESS ( patron_category.category_type == 'I' ) %]
[% UNLESS notitle %]
[% IF Koha.Preference('BorrowersTitles') %]
<li>
<label for="btitle" [% IF mandatorytitle %]class="required"[% END %]> Salutation: </label>
<select id="btitle" name="title">
<option value=""></option>
[% FOREACH patron_title IN Koha.Preference('BorrowersTitles').split('\|') %]
[% IF btitle == patron_title %]
<option value="[% patron_title | html %]" selected="selected">[% patron_title | html %]</option>
[% ELSE %]
<option value="[% patron_title | html %]">[% patron_title | html %]</option>
[% END %]
[% END %]
</select>
[% IF ( mandatorytitle ) %]
<span class="required">Required</span>
[% END %]
</li>
[% END # /IF Koha.Preference('BorrowersTitles') %]
[% END # /UNLESS notitle %]
[% END # /UNLESS ( I ) %]
[% UNLESS nosurname %]
<li>
[% IF ( patron_category.category_type == 'I' ) %]
<label for="surname" class="required"> Name: </label>
[% ELSE %]
<label for="surname" [% IF mandatorysurname %]class="required"[% END %]> Surname: </label>
[% END %]
[% IF ( uppercasesurnames ) %]
<input style="text-transform:uppercase;" type="text" id="surname" name="surname" size="20" value="[% patron.surname | html %]" />
[% ELSE %]
<input type="text" id="surname" name="surname" size="20" value="[% patron.surname | html %]" />
[% END %]
[% IF ( mandatorysurname ) %]
<span class="required">Required</span>
[% END %]
</li>
[% END # /UNLESS nosurname %]
[% UNLESS ( patron_category.category_type == 'I' ) %]
[% UNLESS nofirstname %]
<li>
<label for="firstname" [% IF mandatoryfirstname %]class="required"[% END %]> First name: </label>
<input type="text" id="firstname" name="firstname" size="20" value="[% borrower_data.firstname | html UNLESS op == 'duplicate' %]" />
[% IF ( mandatoryfirstname ) %]
<span class="required">Required</span>
[% END %]
</li>
[% END #/UNLESS nofirstname %]
[% UNLESS nopreferred_name %]
<li>
<label for="preferred_name" [% IF mandatorypreferred_name %]class="required"[% END %]> Preferred name: </label>
<input type="text" id="preferred_name" name="preferred_name" size="20" value="[% borrower_data.preferred_name | html UNLESS op == 'duplicate' %]" />
[% IF ( mandatorypreferred_name ) %]
<span class="required">Required</span>
[% END %]
</li>
[% END #/UNLESS nopreferred_name %]
[% UNLESS nomiddle_name %]
<li>
<label for="middle_name" [% IF mandatorymiddle_name %]class="required"[% END %]> Middle name: </label>
<input type="text" id="middle_name" name="middle_name" size="20" value="[% borrower_data.middle_name | html UNLESS op == 'duplicate' %]" />
[% IF ( mandatorymiddle_name ) %]
<span class="required">Required</span>
[% END %]
</li>
[% END #/UNLESS nomiddle_name %]
[% UNLESS nodateofbirth %]
<li>
<label for="dateofbirth" [% IF mandatorydateofbirth %]class="required"[% END %]> Date of birth: </label>
<input
type="text"
id="dateofbirth"
name="dateofbirth"
size="20"
value="[% borrower_data.dateofbirth | html UNLESS op == 'duplicate' %]"
class="flatpickr"
data-flatpickr-pastinclusive="true"
/>
[% IF ( mandatorydateofbirth ) %]
<span class="required">Required</span>
[% END %]
[% IF ( ERROR_dateofbirth ) %]
<span class="required">(Error)</span>
[% END %]
<div id="dateofbirth_hint" class="hint">[% INCLUDE 'date-format.inc' %]</div>
</li>
[% END # /UNLESS nodateofbirth %]
[% UNLESS noinitials %]
<li>
<label for="initials" [% IF mandatoryinitials %]class="required"[% END %]> Initials: </label>
<input type="text" id="initials" name="initials" size="20" value="[% borrower_data.initials | html UNLESS op == 'duplicate' %]" />
[% IF ( mandatoryinitials ) %]
<span class="required">Required</span>
[% END %]
</li>
[% END # /UNLESS noinitials %]
[% UNLESS nopronouns %]
<li>
<label for="pronouns" [% IF mandatorypronouns %]class="required"[% END %]> Pronouns: </label>
<input type="text" id="pronouns" name="pronouns" size="20" value="[% borrower_data.pronouns | html UNLESS op == 'duplicate' %]" />
[% IF ( mandatorypronouns ) %]
<span class="required">Required</span>
[% END %]
</li>
[% END # /UNLESS nopronouns %]
[% END #/UNLESS ( I ) %]
[% UNLESS noothernames %]
<li>
<label for="othernames" [% IF mandatoryothernames %]class="required"[% END %]> Other name: </label>
<input type="text" id="othernames" name="othernames" size="20" value="[% borrower_data.othernames | html UNLESS op == 'duplicate' %]" />
[% IF ( mandatoryothernames ) %]
<span class="required">Required</span>
[% END %]
[% IF ( patron_category.category_type == 'I' ) %]<input type="hidden" name="sex" value="N" />[% END %]
</li>
[% END #/UNLESS noothernames %]
[% UNLESS ( patron_category.category_type == 'I' ) %]
[% UNLESS nosex %]
<li class="radio">
<label for="gender">Gender:</label>
[% UNLESS ( op == 'duplicate' ) %]
[% IF ( female ) %]
<label for="sex-female"><input type="radio" name="sex" id="sex-female" value="F" checked="checked" /><span class="patronsex-female"> Female</span></label>
[% ELSE %]
<label for="sex-female"><input type="radio" name="sex" id="sex-female" value="F" /><span class="patronsex-female"> Female</span></label>
[% END %]
[% IF ( male ) %]
<label for="sex-male"><input type="radio" name="sex" id="sex-male" value="M" checked="checked" /><span class="patronsex-male"> Male</span></label>
[% ELSE %]
<label for="sex-male"><input type="radio" name="sex" id="sex-male" value="M" /><span class="patronsex-male"> Male</span></label>
[% END %]
[% IF ( other ) %]
<label for="sex-other"><input type="radio" name="sex" id="sex-other" value="O" checked="checked" /><span class="patronsex-other"> [% tp('gender', 'Other') | html %]</span></label>
[% ELSE %]
<label for="sex-other"><input type="radio" name="sex" id="sex-other" value="O" /><span class="patronsex-other"> [% tp('gender', 'Other') | html %]</span></label>
[% END %]
[% IF ( none ) %]
<label for="sex-none"><input type="radio" name="sex" id="sex-none" value="" checked="checked" /><span class="patronsex-none"> None specified</span></label>
[% ELSE %]
<label for="sex-none"><input type="radio" name="sex" id="sex-none" value="" /><span class="patronsex-none"> None specified</span></label>
[% END %]
[% ELSE %]
<label for="sex-female"><span class="patronsex-female">Female </span></label><input type="radio" name="sex" id="sex-female" value="F" />
<label for="sex-male"><span class="patronsex-male">Male </span></label><input type="radio" name="sex" id="sex-male" value="M" />
<label for="sex-other"><span class="patronsex-other">[% tp('gender', 'Other') | html %] </span></label><input type="radio" name="sex" id="sex-other" value="O" />
<label for="sex-none"><span class="patronsex-none">None specified </span></label><input type="radio" name="sex" id="sex-none" value="" checked="checked" />
[% END # /UNLESS ( op == 'duplicate' ) %]
</li>
[% END # /UNLESS nosex %]
[% END # /UNLESS ( I ) %]
</ol>
</fieldset>
<!-- /#memberentry_identity -->
[% END # hide fieldset %]
[% IF show_guarantor || guarantor %]
[% SET possible_relationships = Koha.Preference('borrowerRelationship') %]
<div id="memberentry_guarantor_anchor">
<fieldset id="memberentry_guarantor" class="rows">
<legend class="expanded" id="patron_guarantor_lgd">
<i class="fa fa-caret-down" aria-hidden="true"></i>
Patron guarantor
</legend>
<div id="guarantor_relationships">
[% FOREACH r IN relationships %]
<fieldset>
<ol>
[% IF patron_category.category_type == 'I' %]
<li class="guarantor-details" data-borrowernumber="[% r.guarantor_id | $raw %]">
<span class="label">Organization:</span>
[% INCLUDE 'patron-title.inc' patron=r.guarantor %]
</li>
<li>
<span class="label">Relationship:</span>
<span>[% r.relationship | html %]</span>
</li>
[% ELSE %]
<li class="guarantor-details" data-borrowernumber="[% r.guarantor_id | $raw %]">
<span class="label">Guarantor:</span>
[% INCLUDE 'patron-title.inc' patron=r.guarantor %]
<input type="hidden" class="guarantor_id relation-[% r.id | html %]" name="guarantor_id" value="[% r.guarantor_id | html %]" />
</li>
<li>
<span class="label">Relationship:</span>
<span>[% r.relationship | html %]</span>
<input type="hidden" class="guarantor_relationship relation-[% r.id | html %]" name="guarantor_relationship" value="[% r.relationship | html %]" />
</li>
<li>
<label for="delete_guarantor-[% r.id | uri %]">Remove: </label>
<input type="checkbox" id="delete_guarantor-[% r.id | uri %]" name="delete_guarantor" value="[% r.id | html %]" onclick="toggle_guarantor_field([% r.id | html %])" />
</li>
[% END %]
</ol>
</fieldset>
[% END # END relationships foreach %]
[% IF guarantor && (!relationships) %]
<fieldset class="guarantor">
<ol>
<li class="guarantor-details" data-borrowernumber="0">
<span class="label">Guarantor:</span>
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantor.borrowernumber | uri %]" target="blank"
>[% guarantor.firstname | html %] [% guarantor.surname | html %] ([% guarantor.cardnumber | html %])</a
>
<input type="hidden" class="new_guarantor_id" name="new_guarantor_id" value="[% guarantor.borrowernumber | html %]" />
</li>
[% UNLESS norelationship %]
<li>
<label for="guarantor_relationship" [% IF mandatoryrelationship %]class="required"[% END %]>Relationship: </label>
<select class="new_guarantor_relationship" name="new_guarantor_relationship" [% IF mandatoryrelationship %]required="required"[% END %]>
<option value=""></option>
[% FOREACH pr IN possible_relationships.split('\|') %]
[% IF pr != "" %]
<option value="[% pr | html %]">[% pr | html %]</option>
[% END %]
[% END %]
</select>
[% IF mandatoryrelationship %]
<span class="required">Required</span>
[% END %]
</li>
[% ELSE %]
<input type="hidden" name="new_guarantor_relationship" value="" />
[% END %]
<li>
<label for="guarantor_cancel">&nbsp;</label>
<span
><a href="#" class="guarantor_cancel"><i class="fa fa-trash-can" aria-hidden="true"></i> Remove</a></span
>
</li>
</ol>
</fieldset>
[% END %]
</div>
<!-- #/guarantor_relationships -->
<fieldset class="guarantor" id="guarantor_template">
<ol>
<li class="guarantor-details" data-borrowernumber="0">
<span class="label">Guarantor:</span>
<a class="new_guarantor_link" href="#" target="blank">
<span class="new_guarantor_firstname_text"></span> <span class="new_guarantor_surname_text"></span> (<span class="new_guarantor_id_text"></span>)
</a>
<input type="hidden" class="new_guarantor_id" name="new_guarantor_id" value="" />
</li>
[% UNLESS norelationship %]
<li>
<label for="guarantor_relationship" [% IF mandatoryrelationship %]class="required"[% END %]>Relationship: </label>
<select class="new_guarantor_relationship" name="new_guarantor_relationship" [% IF mandatoryrelationship %]required="required"[% END %]>
<option value="" selected></option>
[% FOREACH pr IN possible_relationships.split('\|') %]
[% IF pr != "" %]
<option value="[% pr | html %]">[% pr | html %]</option>
[% END %]
[% END %]
</select>
[% IF mandatoryrelationship %]
<span class="required">Required</span>
[% END %]
</li>
[% ELSE %]
<input type="hidden" name="new_guarantor_relationship" value="" />
[% END %]
<li>
<label for="guarantor_cancel">&nbsp;</label>
<span
><a href="#" class="guarantor_cancel"><i class="fa fa-trash-can"></i> Remove</a></span
>
</li>
</ol>
</fieldset>
<ol>
<input type="hidden" id="guarantor_id" value="" />
<input name="guarantor_surname" id="guarantor_surname" type="hidden" />
<input name="guarantor_firstname" id="guarantor_firstname" type="hidden" />
<li>
<a href="#patron_search_modal" class="btn btn-default" data-bs-toggle="modal"><i class="fa fa-plus"></i> Add guarantor</a>
</li>
[% IF Koha.Preference('AllowStaffToSetCheckoutsVisibilityForGuarantor') %]
<li>
<label for="privacy_guarantor_checkouts">Show checkouts to guarantors:</label>
<select name="privacy_guarantor_checkouts" id="privacy_guarantor_checkouts">
[% IF borrower_data.privacy_guarantor_checkouts %]
<option value="0">No</option>
<option value="1" selected>Yes</option>
[% ELSE %]
<option value="0" selected>No</option>
<option value="1">Yes</option>
[% END %]
</select>
<div class="hint">Allow guarantors of this patron to view this patron's checkouts from the OPAC</div>
</li>
[% END %]
[% IF Koha.Preference('AllowStaffToSetFinesVisibilityForGuarantor') %]
<li>
<label for="privacy_guarantor_fines">Show charges to guarantors:</label>
<select name="privacy_guarantor_fines" id="privacy_guarantor_fines">
[% IF borrower_data.privacy_guarantor_fines %]
<option value="0">No</option>
<option value="1" selected>Yes</option>
[% ELSE %]
<option value="0" selected>No</option>
<option value="1">Yes</option>
[% END %]
</select>
<div class="hint">Allow guarantors of this patron to view this patron's charges from the OPAC</div>
</li>
[% END %]
</ol>
</fieldset>
<!-- /#memberentry_guarantor -->
</div>
<!-- #/memberentry_guarantor_anchor -->
[% UNLESS nocontactname && nocontactfirstname && norelationship %]
<fieldset class="rows" id="non_patron_guarantor">
<legend class="expanded" id="non_patron_guarantor_lgd">
<i class="fa fa-caret-down" aria-hidden="true"></i>
Non-patron guarantor
</legend>
<ol>
[% UNLESS nocontactname %]
<li>
<label for="contactname" [% IF mandatorycontactname %]class="required"[% END %]> Guarantor surname: </label>
<input type="text" id="contactname" name="contactname" value="[% patron.contactname | html %]" />
[% IF ( mandatorycontactname ) %]
<span class="required">Required</span>
[% END %]
<div class="hint">Non-patron guarantor surname</div>
</li>
[% END # /UNLESS nocontactname %]
[% UNLESS nocontactfirstname %]
<li>
<label for="contactfirstname" [% IF mandatorycontactfirstname %]class="required"[% END %]> Guarantor first name: </label>
<input type="text" id="contactfirstname" name="contactfirstname" value="[% patron.contactfirstname | html %]" />
[% IF ( mandatorycontactfirstname ) %]
<span class="required">Required</span>
[% END %]
<div class="hint">Non-patron guarantor first name</div>
</li>
[% END # /UNLESS noaltcontactfirstname %]
[% UNLESS norelationship %]
<li>
<label for="relationship" [% IF mandatoryrelationship %]class="required"[% END %]>Relationship: </label>
<select class="relationship" name="relationship" id="relationship" [% IF mandatoryrelationship %]required="required"[% END %]>
<option value=""></option>
[% FOREACH pr IN possible_relationships.split('\|') %]
[% IF pr == borrower_data.relationship %]
<option value="[% pr | html %]" selected="selected">[% pr | html %]</option>
[% ELSE %]
<option value="[% pr | html %]">[% pr | html %]</option>
[% END %]
[% END %]
</select>
[% IF mandatoryrelationship %]
<span class="required">Required</span>
[% END %]
</li>
[% END # /UNLESS norelationship %]
</ol>
</fieldset>
<!-- /#non_patron_guarantor -->
[% END # /UNLESS nocontactname && nocontactfirstname && norelationship %]
[% END # /IF show_guarantor || guarantor %]
[% UNLESS noaddress && noaddress2 && nocity && nostate && nozipcode && nocountry %]
[% PROCESS 'main-address-style' %]
[% END # /UNLESS nostreet && nocity etc group %]
[% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %]
<fieldset class="rows" id="memberentry_contact">
<legend class="expanded" id="contact_lgd">
<i class="fa fa-caret-down" aria-hidden="true"></i>
Contact information
</legend>
<ol>
[% UNLESS nophone %]
<li>
<label for="phone" [% IF mandatoryphone %]class="required"[% END %]> Primary phone: </label>
<input type="text" id="phone" name="phone" value="[% patron.phone | html %]" />
[% IF ( mandatoryphone ) %]
<span class="required">Required</span>
[% END %]
<div class="hint">Shows on transit slips</div>
</li>
[% END # /UNLESS nophone %]
[% UNLESS nophonepro %]
<li>
<label for="phonepro" [% IF mandatoryphonepro %]class="required"[% END %]> Secondary phone: </label>
<input type="text" id="phonepro" name="phonepro" value="[% patron.phonepro | html %]" />
[% IF ( mandatoryphonepro ) %]
<span class="required">Required</span>
[% END %]
</li>
[% END # /UNLESS nophonepro %]
[% UNLESS nomobile %]
<li>
<label for="mobile" [% IF mandatorymobile %]class="required"[% END %]> Other phone: </label>
<input type="text" id="mobile" name="mobile" value="[% patron.mobile | html %]" />
[% IF ( mandatorymobile ) %]
<span class="required">Required</span>
[% END %]
</li>
[% END # /UNLESS nomobile %]
[% UNLESS noemail %]
<li>
<label for="email" [% IF mandatoryemail %]class="required"[% END %]> Primary email: </label>
[% IF ( NoUpdateEmail ) %]
<input type="text" id="email" name="email" size="45" value="[% patron.email | html %]" disabled="disabled" />
[% ELSE %]
<input type="text" id="email" name="email" size="45" value="[% patron.email | html %]" />
[% END %]
[% IF ( mandatoryemail ) %]
<span class="required">Required</span>
[% END %]
<div class="hint">Shows on transit slips</div>
</li>
[% END #/UNLESS noemail %]
[% UNLESS noemailpro %]
<li>
<label for="emailpro" [% IF mandatoryemailpro %]class="required"[% END %]> Secondary email: </label>
[% IF ( NoUpdateEmail ) %]
<input type="text" id="emailpro" name="emailpro" size="45" value="[% patron.emailpro | html %]" disabled="disabled" />
[% ELSE %]
<input type="text" id="emailpro" name="emailpro" size="45" value="[% patron.emailpro | html %]" />
[% END %]
[% IF ( mandatoryemailpro ) %]
<span class="required">Required</span>
[% END %]
</li>
[% END #/UNLESS noemailpro %]
[% UNLESS nofax %]
<li>
<label for="fax" [% IF mandatoryfax %]class="required"[% END %]> Fax: </label>
<input type="text" id="fax" name="fax" value="[% patron.fax | html %]" />
[% IF ( mandatoryfax ) %]
<span class="required">Required</span>
[% END %]
</li>
[% END #/UNLESS nofax %]
[% UNLESS noprimary_contact_method %]
<li>
<label for="primary_contact_method" [% IF mandatoryprimary_contact_method %]class="required"[% END %]> Main contact method: </label>
<select id="primary_contact_method" name="primary_contact_method">
<option value=""></option>
[% UNLESS nophone %]
[% IF ( borrower_data.primary_contact_method == 'phone' ) %]
<option value="phone" selected="selected">Primary phone</option>
[% ELSE %]
<option value="phone">Primary phone</option>
[% END %]
[% END %]
[% UNLESS nophonepro %]
[% IF ( borrower_data.primary_contact_method == 'phonepro' ) %]
<option value="phonepro" selected="selected">Secondary phone</option>
[% ELSE %]
<option value="phonepro">Secondary phone</option>
[% END %]
[% END %]
[% UNLESS nomobile %]
[% IF ( borrower_data.primary_contact_method == 'mobile' ) %]
<option value="mobile" selected="selected">Other phone</option>
[% ELSE %]
<option value="mobile">Other phone</option>
[% END %]
[% END %]
[% UNLESS noemail %]
[% IF ( borrower_data.primary_contact_method == 'email' ) %]
<option value="email" selected="selected">Primary email</option>
[% ELSE %]
<option value="email">Primary email</option>
[% END %]
[% END %]
[% UNLESS noemailpro %]
[% IF ( borrower_data.primary_contact_method == 'emailpro' ) %]
<option value="emailpro" selected="selected">Secondary email</option>
[% ELSE %]
<option value="emailpro">Secondary email</option>
[% END %]
[% END %]
[% UNLESS nofax %]
[% IF ( borrower_data.primary_contact_method == 'fax' ) %]
<option value="fax" selected="selected">Fax</option>
[% ELSE %]
<option value="fax">Fax</option>
[% END %]
[% END %]
</select>
[% IF mandatoryprimary_contact_method %]
<span class="required">Required</span>
[% END %]
</li>
[% END %]
</ol>
</fieldset>
<!-- /#memberentry_contact -->
[% END # hide fieldset %]
<!-- ************************ STEP_1 *********************** -->
[% END # /IF ( step_1 ) %]
[% IF ( step_6 ) %]
[% UNLESS noB_address && noB_address2 && noB_city && noB_zipcode && noB_state && noB_country &&nocontactnote && noB_phone && noB_email %]
[% PROCESS 'alt-address-style' %]
[% END # UNLESS noB_address && noB_city && noB_state && noB_phone && noB_email %]
[% END # /IF ( step_6 ) %]
[% IF ( step_2 ) %]
[% UNLESS noaltcontactsurname && noaltcontactfirstname && noaltcontactaddress1 && noaltcontactaddress2 && noaltcontactaddress3 && noaltcontactstate && noaltcontactzipcode && noaltcontactcountry && noaltcontactphone %]
[% PROCESS 'alt-contact-style' %]
[% END # UNLESS noaltcontactsurname && noaltcontactfirstname etc %]
[% END # /IF ( step_2 ) %]
[% IF ( step_3 ) %]
[% SET autoMemberNum = Koha.Preference('autoMemberNum') %]
<fieldset class="rows" id="memberentry_library_management">
<legend class="expanded" id="library_management_lgd">
<i class="fa fa-caret-down" aria-hidden="true"></i>
Library management
</legend>
<ol>
[% UNLESS nocardnumber %]
<li>
<label for="cardnumber" class="[% mandatorycardnumber ? 'required' : 'validated' | html %]"> Card number: </label>
[% IF minlength_cardnumber == maxlength_cardnumber %]
<input
type="text"
id="cardnumber"
name="cardnumber"
size="20"
value="[% borrower_data.cardnumber | html %]"
minlength="[% minlength_cardnumber | html %]"
maxlength="[% maxlength_cardnumber | html %]"
/>
[% IF mandatorycardnumber %]
<span class="required">Required</span>
[% END %]
<span id="cn_max" class="required">Card number must not be more than [% maxlength_cardnumber | html %] characters.</span>
<div class="hint">Card number must be exactly [% minlength_cardnumber | html %] characters.</div>
[% ELSIF minlength_cardnumber && maxlength_cardnumber %]
<input
type="text"
id="cardnumber"
name="cardnumber"
size="20"
value="[% borrower_data.cardnumber | html %]"
minlength="[% minlength_cardnumber | html %]"
maxlength="[% maxlength_cardnumber | html %]"
/>
[% IF mandatorycardnumber %]
<span class="required">Required</span>
[% END %]
<span id="cn_max" class="required">Card number must not be more than [% maxlength_cardnumber | html %] characters.</span>
<div class="hint">Card number must be between [% minlength_cardnumber | html %] and [% maxlength_cardnumber | html %] characters.</div>
[% ELSIF maxlength_cardnumber %]
<input type="text" id="cardnumber" name="cardnumber" size="20" value="[% borrower_data.cardnumber | html %]" maxlength="[% maxlength_cardnumber | html %]" />
[% IF mandatorycardnumber %]
<span class="required">Required</span>
[% END %]
<span id="cn_max" class="required">Card number must not be more than [% maxlength_cardnumber | html %] characters.</span>
<div class="hint">Card number can be up to [% maxlength_cardnumber | html %] characters.</div>
[% ELSE %]
<input type="text" id="cardnumber" name="cardnumber" size="20" value="[% borrower_data.cardnumber | html %]" />
[% IF mandatorycardnumber %]
<span class="required">Required</span>
[% END %]
<div class="hint">There is no minimum or maximum character length.</div>
[% END %]
[% IF autoMemberNum %]
[% IF mandatorycardnumber %]
<div class="hint"><span class="error">autoMemberNum is set to enabled, but card number is marked as mandatory in BorrowerMandatoryField: auto calc has been disabled.</span></div>
[% ELSE %]
<div class="hint">Leave blank for auto calc during registration</div>
[% END %]
[% END %]
</li>
[% END # /UNLESS nocardnumber %]
[% UNLESS nobranchcode %]
<li>
<label for="libraries" class="required">Library:</label>
<select name="branchcode" id="libraries">
[% PROCESS options_for_libraries libraries => Branches.all( selected => userbranch, only_from_group => 1 ) %]
</select>
<span class="required">Required</span>
</li>
[% END %]
<li>
<label for="categorycode_entry" class="required">Category: </label>
<select id="categorycode_entry" name="categorycode">
[% FOREACH category_type IN patron_categories.keys.sort %]
[% SET optgroup_label = t("Unknown") %]
[% SWITCH category_type %]
[% CASE 'C' %]
[% optgroup_label = t("Child") %]
[% CASE 'A' %]
[% optgroup_label = t("Adult") %]
[% CASE 'S' %]
[% optgroup_label = t("Staff") %]
[% CASE 'I' %]
[% optgroup_label = t("Organization") %]
[% CASE 'P' %]
[% optgroup_label = t("Professional") %]
[% CASE 'X' %]
[% optgroup_label = t("Statistical") %]
[% END %]
<optgroup label="[% optgroup_label | html %]">
[% FOREACH category IN patron_categories.$category_type %]
[% IF category.categorycode == patron_category.categorycode %]
<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 %]"
data-expiry-date="[% category.get_expiry_date | html %]"
>[% category.description | html %]</option
>
[% ELSE %]
<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 %]"
data-expiry-date="[% category.get_expiry_date | html %]"
>[% category.description | html %]</option
>
[% END %]
[% END %]
</optgroup>
[% END %]
</select>
[% IF limited_category %]
<span title="The patron's current category ([% patron_category.description | html %]) is limited to other libraries"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i></span>
[% END %]
</li>
[% UNLESS nosort1 %]
<li>
<label for="sort1" [% IF mandatorysort1 %]class="required"[% END %]> Sort 1: </label>
[% PROCESS 'av-build-dropbox.inc' name="sort1", category="Bsort1", default=borrower_data.sort1, empty=1, size = 20 %]
[% IF ( mandatorysort1 ) %]
<span class="required">Required</span>
[% END %]
</li>
[% END # /UNLESS nosort1 %]
[% UNLESS nosort2 %]
<li>
<label for="sort2" [% IF mandatorysort2 %]class="required"[% END %]> Sort 2: </label>
[% PROCESS 'av-build-dropbox.inc' name="sort2", category="Bsort2", default=borrower_data.sort2, empty=1, size = 20 %]
[% IF ( mandatorysort2 ) %]
<span class="required">Required</span>
[% END %]
</li>
[% END # /UNLESS nosort2 %]
[% UNLESS noautorenew_checkouts %]
<li class="radio">
<label for="yes-autorenew_checkouts"> Allow auto-renewal of items: </label>
[% IF ( borrower_data.autorenew_checkouts || op == 'add_form' ) %]
<label for="yes-autorenew_checkouts">
Yes
<input type="radio" id="yes-autorenew_checkouts" name="autorenew_checkouts" value="1" checked="checked" />
</label>
<label for="no-autorenew_checkouts">
No
<input type="radio" id="no-autorenew_checkouts" name="autorenew_checkouts" value="0" />
</label>
[% ELSE %]
<label for="yes-autorenew_checkouts">
Yes
<input type="radio" id="yes-autorenew_checkouts" name="autorenew_checkouts" value="1" />
</label>
<label for="no-autorenew_checkouts">
No
<input type="radio" id="no-autorenew_checkouts" name="autorenew_checkouts" value="0" checked="checked" />
</label>
[% END %]
</li>
[% END %]
[% UNLESS noprotected || !CanUpdateProtectPatron %]
<li class="radio">
<label for="protected">Protected:</label>
[% IF ( patron.protected == 1 ) %]
<label for="yes-protected">
Yes
<input type="radio" id="yes-protected" name="protected" value="1" checked="checked" />
</label>
<label for="no-protected">
No
<input type="radio" id="no-protected" name="protected" value="0" />
</label>
[% ELSE %]
<label for="yes-protected">
Yes
<input type="radio" id="yes-protected" name="protected" value="1" />
</label>
<label for="no-protected">
No
<input type="radio" id="no-protected" name="protected" value="0" checked="checked" />
</label>
[% END %]
</li>
[% END %]
[% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
<li>
<label for="checkprevcheckout">Check for previous checkouts: </label>
<select name="checkprevcheckout" id="checkprevcheckout">
[% IF ( borrower_data.checkprevcheckout == 'yes' ) %]
<option value="yes" selected="selected">Yes if settings allow it</option>
<option value="no">No if settings allow it</option>
<option value="inherit">Inherit from settings</option>
[% ELSIF ( borrower_data.checkprevcheckout == 'no' ) %]
<option value="yes">Yes if settings allow it</option>
<option value="no" selected="selected">No if settings allow it</option>
<option value="inherit">Inherit from settings</option>
[% ELSE %]
<option value="yes">Yes if settings allow it</option>
<option value="no">No if settings allow it</option>
<option value="inherit" selected="selected">Inherit from settings</option>
[% END %]
</select>
</li>
[% END # /IF ( Koha.Preference('CheckPrevCheckout') %]
[% IF Koha.Preference('TranslateNotices') %]
<li>
<label for="lang">Preferred language for notices: </label>
<select id="lang" name="lang">
<option value="default">Default</option>
[% FOR language IN languages %]
[% FOR sublanguage IN language.sublanguages_loop %]
[% IF language.plural %]
[% IF sublanguage.rfc4646_subtag == borrower_data.lang %]
<option value="[% sublanguage.rfc4646_subtag | html %]" selected="selected"
>[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option
>
[% ELSE %]
<option value="[% sublanguage.rfc4646_subtag | html %]"
>[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option
>
[% END %]
[% ELSE %]
[% IF sublanguage.rfc4646_subtag == borrower_data.lang %]
<option value="[% sublanguage.rfc4646_subtag | html %]" selected="selected">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
[% ELSE %]
<option value="[% sublanguage.rfc4646_subtag | html %]">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
[% END %]
[% END # /IF language.plural %]
[% END # /FOR sublanguage %]
[% END #/FOR language %]
</select>
<!-- /#lang -->
</li>
[% END #/IF Koha.Preference('TranslateNotices') %]
</ol>
</fieldset>
<!-- /#memberentry_library_management -->
[% UNLESS nodateenrolled && noopacnote && noborrowernotes %]
<fieldset class="rows" id="memberentry_subscription">
<legend class="expanded" id="library_setup_lgd">
<i class="fa fa-caret-down" aria-hidden="true"></i>
Library setup
</legend>
<ol>
[% UNLESS nodateenrolled %]
<li>
<label for="from" [% IF mandatorydateenrolled %]class="required"[% END %]> Registration date: </label>
<input type="text" id="from" name="dateenrolled" maxlength="10" size="10" value="[% borrower_data.dateenrolled | html %]" class="flatpickr" data-date_to="to" />
[% IF ( mandatorydateenrolled ) %]
<span class="required">Required</span>
[% END %]
[% IF ( ERROR_dateenrolled ) %]
<span class="required">(Error)</span>
[% END %]
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
</li>
[% END # /UNLESS nodateenrolled %]
<li [% IF nodateexpiry %]style="display:none"[% END %]>
<label for="to" [% IF mandatorydateexpiry %]class="required"[% END %]> Expiry date (leave blank for auto calc): </label>
[% UNLESS ( op == 'add_form' ) %]
<input type="text" id="to" name="dateexpiry" maxlength="10" size="10" value="[% borrower_data.dateexpiry | html UNLESS op == 'duplicate' %]" class="flatpickr" />
[% ELSE %]
<input type="text" id="to" name="dateexpiry" maxlength="10" size="10" value="[% borrower_data.dateexpiry | html %]" class="flatpickr" />
[% END %]
[% IF ( mandatorydateexpiry ) %]
<span class="required">Required</span>
[% END %]
[% IF ( ERROR_dateexpiry ) %]
<span class="required">(Error)</span>
[% END %]
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
</li>
[% UNLESS noopacnote %]
<li>
<label for="opacnote" [% IF mandatoryopacnote %]class="required"[% END %]> OPAC note: </label>
<textarea id="opacnote" name="opacnote" cols="55" rows="5">[% borrower_data.opacnote | html UNLESS op == 'duplicate' %]</textarea>
<div class="hint">This message appears on this patron's user page in the OPAC</div>
[% IF ( mandatoryopacnote ) %]
<span class="required">Required</span>
[% END %]
</li>
[% END # /UNLESS noopacnote %]
[% UNLESS noborrowernotes %]
<li>
<label for="borrowernotes" [% IF mandatoryborrowernotes %]class="required"[% END %]> Circulation note: </label>
<textarea id="borrowernotes" name="borrowernotes" cols="55" rows="5">[% borrower_data.borrowernotes | $raw UNLESS op == 'duplicate' %]</textarea>
<div class="hint">This message displays when checking out to this patron</div>
[% IF ( mandatoryborrowernotes ) %]
<span class="required">Required</span>
[% END %]
</li>
[% END # /UNLESS noborrowernotes %]
</ol>
</fieldset>
<!-- /#memberentry_subscription -->
[% END # hide fieldset %]
[% UNLESS nouserid && nopassword && !CanUpdatePasswordExpiration %]
<fieldset class="rows" id="memberentry_userid">
<legend class="expanded" id="opac_staff_login_lgd">
<i class="fa fa-caret-down" aria-hidden="true"></i>
OPAC/Staff interface login
</legend>
<ol>
[% UNLESS nouserid %]
<li>
<label for="userid" [% IF mandatoryuserid %]class="required"[% END %]> Username: </label>
[%# Dummy input to avoid Firefox from using userid/password saved for authentication %]
<input type="text" disabled="disabled" style="display:none" />
[% IF ( NoUpdateLogin ) %]
[% IF ( op == 'duplicate' ) %]
<input type="text" id="userid" name="userid" size="20" disabled="disabled" />
[% ELSE %]
<input type="text" id="userid" name="userid" size="20" disabled="disabled" value="[% borrower_data.userid | html %]" />
[% END %]
[% ELSE %]
[% IF ( op == 'duplicate' ) %]
<input type="text" id="userid" name="userid" size="20" value="" />
[% ELSE %]
<input type="text" id="userid" name="userid" size="20" value="[% borrower_data.userid | html %]" />
[% END %]
[% END # /IF ( NoUpdateLogin ) %]
[% IF ( mandatoryuserid ) %]
<span class="required">Required</span>
[% END %]
</li>
[% END # /UNLESS nouserid %]
[% UNLESS nopassword %]
<li>
<label for="password" [% IF mandatorypassword %]class="required"[% END %]> Password: </label>
[% IF ( op == 'add_form' ) %]
[% IF ( NoUpdateLogin ) %]
[% IF ( op == 'duplicate' ) %]
<input type="password" id="password" name="password" size="20" disabled="disabled" />
[% ELSE %]
<input type="password" id="password" name="password" size="20" disabled="disabled" value="[% borrower_data.password | html %]" />
[% END %]
[% ELSE %]
[% IF ( op == 'duplicate' ) %]
<input type="password" id="password" name="password" size="20" autocomplete="new-password" />
[% ELSE %]
<input type="password" id="password" name="password" size="20" autocomplete="new-password" value="[% borrower_data.password | html %]" />
[% END %]
[% END # /IF ( NoUpdateLogin ) %]
[% ELSE # IF ( op == 'add_form' ) %]
[% IF ( borrower_data.password ) %]
[% IF ( NoUpdateLogin ) %]
<input type="password" id="password" name="password" size="20" disabled="disabled" value="****" />
[% ELSE %]
[% IF ( op == 'duplicate' ) %]
<input type="password" id="password" name="password" autocomplete="new-password" size="20" />
[% ELSE %]
<input type="password" id="password" name="password" size="20" value="****" />
[% END %]
[% END %]
[% ELSE %]
[% IF ( NoUpdateLogin ) %]
<input type="password" id="password" name="password" size="20" disabled="disabled" value="" />
[% ELSE %]
<input type="password" id="password" name="password" size="20" autocomplete="new-password" value="" />
[% END %]
[% END # /IF ( password ) %]
[% END # /IF ( op == 'add_form' ) %]
[% IF ( mandatorypassword ) %]
<span class="required">Required</span>
[% END %]
[% IF ( ERROR_password_too_short ) %]
<span class="required">Password is too short</span>
[% END %]
[% IF ( ERROR_password_too_weak ) %]
<span class="required">Password is too weak</span>
[% END %]
[% IF ( ERROR_password_has_whitespaces ) %]
<span class="required">Password has leading or trailing whitespaces</span>
[% END %]
<div class="hint">Minimum password length: [% patron.category.effective_min_password_length | html %]</div>
</li>
<li>
<label for="password2" [% IF mandatorypassword %]class="required"[% END %]> Confirm password: </label>
[% IF ( op == 'add_form' ) %]
[% IF ( NoUpdateLogin ) %]
[% IF ( op == 'duplicate' ) %]
<input type="password" id="password2" name="password2" size="20" disabled="disabled" />
[% ELSE %]
<input type="password" id="password2" name="password2" size="20" disabled="disabled" value="[% borrower_data.password | html %]" />
[% END %]
[% ELSE %]
[% IF ( op == 'duplicate' ) %]
<input type="password" id="password2" name="password2" size="20" />
[% ELSE %]
<input type="password" id="password2" name="password2" size="20" value="[% borrower_data.password | html %]" />
[% END %]
[% END %]
[% ELSE # IF ( op == 'add_form' ) %]
[% IF ( borrower_data.password ) %]
[% IF ( NoUpdateLogin ) %]
<input type="password" id="password2" name="password2" size="20" disabled="disabled" value="****" />
[% ELSE %]
[% IF ( op == 'duplicate' ) %]
<input type="password" id="password2" name="password2" size="20" />
[% ELSE %]
<input type="password" id="password2" name="password2" size="20" value="****" />
[% END %]
[% END %]
[% ELSE %]
[% IF ( NoUpdateLogin ) %]
<input type="password" id="password2" name="password2" size="20" disabled="disabled" value="" />
[% ELSE %]
<input type="password" id="password2" name="password2" size="20" value="" />
[% END %]
[% END %]
[% END # /IF ( op == 'add_form' ) %]
[% IF ( mandatorypassword ) %]
<span class="required">Required</span>
[% END %]
[% IF ( ERROR_password_mismatch ) %]
<span class="required">Passwords do not match</span>
[% END %]
</li>
[% END # /UNLESS nopassword %]
[% UNLESS ( !CanUpdatePasswordExpiration ) %]
<li>
<label for="password_expiration_date">Password expiration date:</label>
<input type="text" id="password_expiration_date" name="password_expiration_date" maxlength="10" size="10" value="[% borrower_data.password_expiration_date | html %]" class="flatpickr" />
</li>
[% END %]
</ol>
</fieldset>
<!-- /#memberentry_userid -->
[% END # UNLESS nouserid && nopassword && !CanUpdatePasswordExpiration %]
<!--this zones are not necessary in modif mode -->
[% UNLESS ( op == 'add_form' || op == 'duplicate' || ( nogonenoaddress && nolost ) ) %]
<fieldset class="rows" id="memberentry_account_flags">
<legend class="expanded" id="account_flags_lgd">
<i class="fa fa-caret-down" aria-hidden="true"></i>
Patron account flags
</legend>
<div class="patron_account_flags">
<p>Setting a value here will prevent patron from circulating materials and placing holds on the OPAC</p>
<ol class="radio">
[% UNLESS nogonenoaddress %]
<li>
<label class="radio [% IF mandatorygonenoaddress %]required[% END %]" for="yesgonenoaddress"> Address correction needed: </label>
[% IF CAN_user_circulate_manage_restrictions %]
<label for="yesgonenoaddress">
[% IF ( borrower_data.gonenoaddress ) %]
<input type="radio" id="yesgonenoaddress" name="gonenoaddress" value="1" checked="checked" />
[% ELSE %]
<input type="radio" id="yesgonenoaddress" name="gonenoaddress" value="1" />
[% END %]
Yes
</label>
<label for="nogonenoaddress">
[% IF ( borrower_data.gonenoaddress ) %]
<input type="radio" id="nogonenoaddress" name="gonenoaddress" value="0" />
[% ELSE %]
<input type="radio" id="nogonenoaddress" name="gonenoaddress" value="0" checked="checked" />
[% END %]
No
</label>
[% ELSE %]
[% IF borrower_data.gonenoaddress %]<span>Yes</span>[% ELSE %]<span>No</span>[% END %]
[% END # /IF CAN_user_circulate_manage_restrictions %]
[% IF mandatorygonenoaddress %]
<span class="required">Required</span>
[% END %]
</li>
[% END # /UNLESS nogonenoaddress %]
[% UNLESS nolost %]
<li>
<label class="radio [% IF mandatorylost %]required[% END %]" for="yeslost"> Lost card: </label>
[% IF CAN_user_circulate_manage_restrictions %]
<label for="yeslost">
[% IF ( borrower_data.lost ) %]
<input type="radio" id="yeslost" name="lost" value="1" checked="checked" />
[% ELSE %]
<input type="radio" id="yeslost" name="lost" value="1" />
[% END %]
Yes
</label>
<label for="nolost">
[% IF ( borrower_data.lost ) %]
<input type="radio" id="nolost" name="lost" value="0" />
[% ELSE %]
<input type="radio" id="nolost" name="lost" value="0" checked="checked" />
[% END %]
No
</label>
[% ELSE %]
[% IF borrower_data.lost %]<span>Yes</span>[% ELSE %]<span>No</span>[% END %]
[% END # /IF CAN_user_circulate_manage_restrictions %]
[% IF mandatorylost %]
<span class="required">Required</span>
[% END %]
</li>
[% END # /UNLESS nogonenoaddress %]
</ol>
</div>
<!-- /.patron_account_flags -->
</fieldset>
<!-- /#memberentry_account_flags -->
[% END %]
<fieldset class="rows" id="memberentry_restrictions">
<legend class="expanded" id="restrictions_lgd">
<i class="fa fa-caret-down" aria-hidden="true"></i>
Patron restrictions
</legend>
<div class="patron_restrictions">
[% IF ( patron.restrictions.count ) %]
<table>
<thead>
<tr>
<th>Type</th>
<th>Comment</th>
<th>Expiration</th>
<th>[% tp('patron restriction created on', 'Created') | html %]</th>
[% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
<th>Remove?</th>
[% END %]
</tr>
</thead>
<tbody>
[% FOREACH restriction IN patron.restrictions %]
<tr>
<td>[% PROCESS restriction_type_description restriction_type=restriction.type %]</td>
<td>
[% IF restriction.comment.search('OVERDUES_PROCESS') %]
Restriction added by overdues process [% restriction.comment.remove('OVERDUES_PROCESS ') | scrub_html type => 'comment' | $raw %]
[% ELSE %]
[% restriction.comment | scrub_html type => 'comment' | $raw %]
[% END %]
</td>
<td>
[% IF restriction.expiration %]
[% restriction.expiration | $KohaDates %]
[% ELSE %]
<em>Indefinite</em>
[% END %]
</td>
<td>[% restriction.created | $KohaDates %]</td>
[% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
<td>
<input type="checkbox" id="debarment_[% restriction.borrower_debarment_id | html %]" name="remove_debarment" value="[% restriction.borrower_debarment_id | html %]" />
</td>
[% END %]
</tr>
[% END # /FOREACH d %]
</tbody>
</table>
[% ELSE %]
<p>Patron is currently unrestricted.</p>
[% END # /IF ( patron.restrictions.count ) %]
[% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
<p
><a href="#" id="add_manual_restriction"><i class="fa fa-plus"></i> Add manual restriction</a></p
>
<fieldset id="manual_restriction_form">
<input type="hidden" id="add_debarment" name="add_debarment" value="0" />
<legend id="manual_restriction_lgd">Add manual restriction</legend>
<ol>
[% IF Koha.Preference('PatronRestrictionTypes') %]
<li>
<label for="debarred_type">Type:</label>
<select name="debarred_type">
[% FOREACH restriction_type IN restriction_types %]
[% IF !restriction_type.is_system %]
[% IF restriction_type.is_default %]
<option value="[% restriction_type.code | html %]" selected>[% PROCESS restriction_type_description %]</option>
[% ELSE %]
<option value="[% restriction_type.code | html %]">[% PROCESS restriction_type_description %]</option>
[% END %]
[% END %]
[% END %]
</select>
</li>
[% END %]
<li>
<label for="debarred_comment">Comment: </label>
<input type="text" id="debarred_comment" name="debarred_comment" />
</li>
<li>
<label for="debarred_expiration">Expiration: </label>
<input name="debarred_expiration" id="debarred_expiration" size="10" value="" class="flatpickr" type="text" />
<a href="#" id="clear_debarred_expiration">Clear date</a>
</li>
</ol>
<p>
<a class="cancel" id="cancel_manual_restriction" href="#">Cancel</a>
</p>
</fieldset>
<!-- /#manual_restriction_form -->
[% END # /IF CAN_user_borrowers_edit_borrowers %]
</div>
</fieldset>
<!-- /#memberentry_restrictions -->
[% END # /IF ( step_3 ) %]
[% IF ( step_7 ) %]
[% IF Koha.Preference('HouseboundModule') %]
<fieldset class="rows" id="memberentry_housebound_roles">
<legend class="expanded" id="housebound_roles">
<i class="fa fa-caret-down" aria-hidden="true"></i>
Housebound roles
</legend>
<ol class="radio">
<li>
<label class="radio" for="housebound_chooser"> Chooser: </label>
[% IF ( housebound_role.housebound_chooser == 1 ) %]
<label for="yes_housebound_chooser">Yes </label>
<input type="radio" id="yes_housebound_chooser" name="housebound_chooser" value="1" checked="checked" />
<label for="no_housebound_chooser">No </label>
<input type="radio" id="no_housebound_chooser" name="housebound_chooser" value="0" />
[% ELSE %]
<label for="yes_housebound_chooser">Yes </label>
<input type="radio" id="yes_housebound_chooser" name="housebound_chooser" value="1" />
<label for="no_housebound_chooser">No </label>
<input type="radio" id="no_housebound_chooser" name="housebound_chooser" value="0" checked="checked" />
[% END %]
</li>
<li>
<label class="radio" for="housebound_deliverer">Deliverer:</label>
[% IF ( housebound_role.housebound_deliverer == 1 ) %]
<label for="yes_housebound_deliverer">Yes </label>
<input type="radio" id="yes_housebound_deliverer" name="housebound_deliverer" value="1" checked="checked" />
<label for="no_housebound_deliverer">No </label>
<input type="radio" id="no_housebound_deliverer" name="housebound_deliverer" value="0" />
[% ELSE %]
<label for="yes_housebound_deliverer">Yes </label>
<input type="radio" id="yes_housebound_deliverer" name="housebound_deliverer" value="1" />
<label for="no_housebound_deliverer">No </label>
<input type="radio" id="no_housebound_deliverer" name="housebound_deliverer" value="0" checked="checked" />
[% END %]
</li>
</ol>
<!-- /ol.radio -->
</fieldset>
<!-- /#memberentry_housebound_roles -->
[% END # hide fieldset %]
[% END # IF step_7 %]
[% IF ( step_4 ) %]
[% IF Koha.Preference('ExtendedPatronAttributes') %]
[% UNLESS ( no_patron_attribute_types ) %]
<fieldset class="rows" id="memberentry_patron_attributes">
<legend class="expanded" id="patron_attributes_lgd">
<i class="fa fa-caret-down" aria-hidden="true"></i>
Additional attributes and identifiers
</legend>
<div class="attributes_tables">
<input type="hidden" name="setting_extended_patron_attributes" value="1" />
[% FOREACH pa_loo IN patron_attributes %]
<ol class="attributes_table">
<div id="aai_[% pa_loo.class | html %]">
[% IF pa_loo.class %]
<h3 id="[% pa_loo.class | html %]_lgd">[% pa_loo.lib | html %]</h3>
[% END %]
[% FOREACH patron_attribute IN pa_loo.items %]
<li data-category_code="[% patron_attribute.category_code | html %]" data-pa_code="[% patron_attribute.code | replace('[^a-zA-Z0-9_-]', '') %]">
[% IF patron_attribute.mandatory %]
<label for="[% patron_attribute.form_id | html %]" class="required" required="required">[% patron_attribute.description | html %]: </label>
[% ELSE %]
<label for="[% patron_attribute.form_id | html %]">[% patron_attribute.description | html %]: </label>
[% END %]
[% IF ( patron_attribute.use_dropdown ) %]
<select id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]" [% IF patron_attribute.mandatory %]required="required"[% END %]>
<option value=""></option>
[% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
[% IF auth_val_loo.authorised_value == patron_attribute.value %]
<option value="[% auth_val_loo.authorised_value | html %]" selected="selected"> [% auth_val_loo.lib | html %] </option>
[% ELSE %]
<option value="[% auth_val_loo.authorised_value | html %]"> [% auth_val_loo.lib | html %] </option>
[% END %]
[% END %]
</select>
[% ELSE %]
[% IF patron_attribute.mandatory %]
[% IF patron_attribute.is_date %]
<input
type="text"
id="[% patron_attribute.form_id | html %]"
name="[% patron_attribute.form_id | html %]"
maxlength="10"
size="10"
value="[% patron_attribute.value | html %]"
required="required"
class="flatpickr"
/>
[% ELSE %]
<textarea rows="2" cols="30" id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]" required="required">
[% patron_attribute.value | html %]</textarea
>
[% END %]
[% ELSE %]
[% IF patron_attribute.is_date %]
<input
type="text"
id="[% patron_attribute.form_id | html %]"
name="[% patron_attribute.form_id | html %]"
maxlength="10"
size="10"
value="[% patron_attribute.value | html %]"
class="flatpickr"
/>
[% ELSE %]
<textarea rows="2" cols="30" id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]">[% patron_attribute.value | html %]</textarea>
[% END %]
[% END %]
[% END # /IF ( patron_attribute.use_dropdown ) %]
<input type="hidden" id="[% patron_attribute.form_id | html %]_code" name="[% patron_attribute.form_id | html %]_code" value="[% patron_attribute.code | html %]" />
[% IF ( !patron_attribute.is_date ) %]
<a href="#" class="clear_attribute"><i class="fa fa-fw fa-trash-can"></i> Clear</a>
[% END %]
[% IF ( patron_attribute.repeatable ) %]
<a href="#" class="clone_attribute"><i class="fa fa-fw fa-plus"></i> New</a>
[% END %]
[% IF patron_attribute.mandatory %]<span class="required">Required</span>[% END %]
</li>
[% END # /FOREACH patron_attribute %]
</div>
</ol>
[% END # /FOREACH pa_loo %]
</div>
<!-- /.attributes_tables -->
</fieldset>
<!-- /#memberentry_patron_attributes -->
[% END # UNLESS ( no_patron_attribute_types ) %]
[% END # IF Koha.Preference('ExtendedPatronAttributes') %]
[% END # IF ( step_4 ) %]
[% IF ( step_5 ) %]
[% IF ( EnhancedMessagingPreferences ) %]
<fieldset class="rows" id="memberentry_messaging_prefs">
<legend class="expanded" id="patron_messaging_prefs_lgd">
<i class="fa fa-caret-down" aria-hidden="true"></i>
Patron messaging preferences
</legend>
<div class="messaging_prefs">
<div id="messaging_prefs_loading" class="form-message" style="display:none"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading new messaging defaults </div>
<input type="hidden" name="setting_messaging_prefs" value="1" />
[% INCLUDE 'messaging-preference-form.inc' %]
[% IF ( SMSSendDriver ) %]
[% IF !nosmsalertnumber %]
<p>
<label for="SMSnumber">SMS number:</label>
<input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber | html %]" />
<span class="hint sms_number_help">Please enter numbers only. Prefix the number with + or 00 if including the country code.</span>
</p>
[% END %]
[% IF SMSSendDriver == 'Email' && !nosms_provider_id %]
<p>
<label for="sms_provider_id">SMS provider:</label>
<select id="sms_provider_id" name="sms_provider_id">
<option value="">Unknown</option>
[% FOREACH s IN sms_providers %]
[% IF s.id == borrower_data.sms_provider_id %]
<option value="[% s.id | html %]" selected="selected">[% s.name | html %]</option>
[% ELSE %]
<option value="[% s.id | html %]">[% s.name | html %]</option>
[% END %]
[% END %]
</select>
</p>
[% END # /UNLESS nosms_provider_id %]
[% END # IF ( SMSSendDriver ) %]
</div>
<!-- /.messaging_prefs -->
</fieldset>
[% END # IF ( EnhancedMessagingPreferences ) %]
[% END # /IF step_5 %]
</form>
<!-- /#entryform -->
[% IF quickadd && op == 'add_form' && !check_member %]
<form method="get" id="quick_add_form" class="toggler">
<fieldset class="rows quick_add"
><legend>Quick add</legend>
<ol id="quick_add_list"> </ol>
</fieldset>
</form>
[% END %]
[% END # /UNLESS ( no_add ) %]
</main>
</div>
<!-- /.col-md-10.order-md-2 -->
[% UNLESS ( op == 'add_form' ) %]
<div class="col-md-2 order-sm-2 order-md-1">
<aside> [% INCLUDE 'circ-menu.inc' %] </aside>
</div>
<!-- /.col-md-2.order-md-1 -->
[% END %]
</div>
<!-- /.row -->
</div>
<!-- /.main.container-fluid -->
<!-- Expiration date modal-->
<div id="expirationDateModal" class="modal" tabindex="-1" role="dialog" aria-labelledby="expirationDateModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title" id="expirationDateModalLabel">Confirm expiration date</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>Change expiration date to default for this category?</p>
</div>
<div class="modal-footer">
<button id="expirationDateConfirmBtn" class="btn btn-primary"><i class="fa fa-check" aria-hidden="true"></i> Yes</button>
<button id="expirationDateCancelBtn" data-bs-dismiss="modal" class="btn btn-secondary"><i class="fa fa-times" aria-hidden="true"></i> No</button>
</div>
</div>
</div>
</div>
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'calendar.inc' %]
[% INCLUDE 'str/members-menu.inc' %]
[% Asset.js("js/members-menu.js") | $raw %]
<script>
function update_cardnumber_warning(size){
var max_len = [% maxlength_cardnumber | html %];
if ( size >= max_len ) {
$("#cn_max").show();
} else {
$("#cn_max").hide();
}
}
function toggle_guarantor_field(rel_number){
$(".relation-"+rel_number).prop('disabled', (i, v) => !v);
}
function showHideFields(){
$("#messaging_prefs_loading, #guarantor_template").hide();
[% UNLESS step == 1 %]
[% IF fieldstohide.grep('^identity$').size %]
togglePanel( $("#identity_lgd") );
[% END %]
[% IF show_guarantor || guarantor %]
[% IF fieldstohide.grep('^guarantor$').size %]
togglePanel( $("#patron_guarantor_lgd") );
[% END %]
[% IF fieldstohide.grep('^nonpatron_guarantor$').size %]
togglePanel( $("#non_patron_guarantor_lgd") );
[% END %]
[% END %]
[% IF fieldstohide.grep('^primary_address$').size %]
togglePanel( $("#main_address_lgd") );
[% END %]
[% IF fieldstohide.grep('^primary_contact$').size %]
togglePanel( $("#contact_lgd") );
[% END %]
[% END %]
[% UNLESS step == 6 %]
[% IF fieldstohide.grep('^alt_address$').size %]
togglePanel( $("#alt_address_lgd") );
[% END %]
[% END %]
[% UNLESS step == 2 %]
[% IF fieldstohide.grep('^alt_contact$').size %]
togglePanel( $("#alt_contact_lgd") );
[% END %]
[% END %]
[% UNLESS step == 3 %]
[% IF fieldstohide.grep('^lib_mgmt$').size %]
togglePanel( $("#library_management_lgd") );
[% END %]
[% UNLESS nodateenrolled && noopacnote && noborrowernotes %]
[% IF fieldstohide.grep('^lib_setup$').size %]
togglePanel( $("#library_setup_lgd") );
[% END %]
[% END %]
[% UNLESS nouserid && nopassword %]
[% IF fieldstohide.grep('^login$').size %]
togglePanel( $("#opac_staff_login_lgd") );
[% END %]
[% END %]
[% UNLESS ( op == 'add_form' || op == 'duplicate' ) %]
[% IF fieldstohide.grep('^flags$').size %]
togglePanel( $("#account_flags_lgd") );
[% END %]
[% END %]
[% IF fieldstohide.grep('^debarments$').size %]
togglePanel( $("#restrictions_lgd") );
[% END %]
[% END %]
[% UNLESS step == 7 %]
[% IF Koha.Preference('HouseboundModule') %]
[% IF fieldstohide.grep('^housebound$').size %]
togglePanel( $("#housebound_roles") );
[% END %]
[% END %]
[% END %]
[% UNLESS step == 4 %]
[% IF Koha.Preference('ExtendedPatronAttributes') %]
[% IF fieldstohide.grep('^additional$').size %]
togglePanel( $("#patron_attributes_lgd") );
[% END %]
[% END %]
[% END %]
[% UNLESS step == 5 %]
[% IF Koha.Preference('EnhancedMessagingPreferences') %]
[% IF fieldstohide.grep('^messaging$').size %]
togglePanel( $("#patron_messaging_prefs_lgd") );
$("#messaging_prefs_loading").toggle();
[% END %]
[% END %]
[% END %]
}
$(document).ready(function() {
showHideFields();
$("#toggle_hidden_fields").change(function(){
showHideFields();
});
$(".collapsed,.expanded").on("click",function(){
$("#messaging_prefs_loading").hide();
$("#guarantor_template").hide();
});
$("#saverecord").css({ 'margin-left': 0 });
[% IF borrower_data.categorycode %]
update_category_code( "[% borrower_data.categorycode | html %]" );
[% ELSE %]
if ( $("#categorycode_entry").length > 0 ){
var category_code = $("#categorycode_entry").find("option:selected").val();
update_category_code( category_code );
}
[% END %]
[% IF new_guarantors %]
[% FOREACH g IN new_guarantors %]
select_user( '[% g.patron.borrowernumber | html %]', [% To.json( g.patron.unblessed ) | $raw %], '[% g.relationship | html %]' );
[% END %]
[% END %]
$("#cn_max").hide();
var content;
$("#cardnumber").on("keydown", function(e){
content = $(this).val();
});
$("#cardnumber").on("keyup", function(e){
// .val() will return the value of the input after the key has been released
var l = $(this).val().length;
if ( l == content.length + 1 ) { l--; }
update_cardnumber_warning(l);
});
$("#cardnumber").bind("paste", function(e){
var pastedData = e.originalEvent.clipboardData.getData('text');
update_cardnumber_warning(pastedData.length - 1);
} );
var toggle_quick_add = $(".toggle_quick_add");
$(toggle_quick_add).click(function(e){
toggle_quick_add.toggle();
e.preventDefault();
var toggle_to = '';
var toggle_from = '';
if( $("#entryform:visible").length ) {
toggle_to = "#quick_add_form label";
toggle_from = "#entryform label";
$("#memberentry_guarantor").appendTo("#quick_add_form");
} else {
toggle_to="#entryform label";
toggle_from = "#quick_add_form label";
$("#memberentry_guarantor").appendTo("#memberentry_guarantor_anchor");
}
$(toggle_from).each(function() {
var input_label = $(this).attr('for');
if ( input_label == 'sex-male' || input_label == 'sex-none' || input_label == 'sex-female' || input_label == 'sex-other' ) {
$(toggle_to+"[for='"+input_label+"']").next().prop('checked', $(this).next().prop('checked') );
return;
}
var source_input = $(this).nextAll(":input[name]").first();
var target_input = $(toggle_to+"[for='"+input_label+"']").nextAll(":input[name]").first();
target_input.val( source_input.val() );
});
$(".toggler").toggle();
});
$("#save_quick_add").click(function(){
$("#quick_add_form").validate();
if( $("#quick_add_form").valid()){
$('.toggle_quick_add').click();
$("#memberentry_guarantor").appendTo("#memberentry_guarantor_anchor");
$('#saverecord').click();
}
else {return false;}
});
$("#saverecord").click(function(){
if( check_form_borrowers() ){
$("#entryform").submit();
}
});
$('#not-duplicate').on('click', function() {
$("input[name='nodouble']").val('1');
$('#entryform').submit();
});
$(".popup_patronview").on("click", function(e){
e.preventDefault();
var url = $(this).attr("href");
openWindow( url, "patronview" );
});
$("#dateofbirth").on("change", function(){
write_age();
});
$("#debarred_comment, #debarred_expiration").on("change", function(){
$("#add_debarment").val(1);
});
$("#clear_debarred_expiration").on("click", function(e){
e.preventDefault();
$('#debarred_expiration').val("");
});
$("#memberentry_patron_attributes").on("click", ".clear_attribute", function(e){
e.preventDefault();
clear_entry( this );
});
$("#memberentry_patron_attributes").on("click", ".clone_attribute", function(e){
e.preventDefault();
clone_entry( this );
});
$("#categorycode_entry").on("change", function(){
update_category_code(this);
});
[% IF logged_in_user.borrowernumber == borrowernumber %]
$("#userid").on("change", function(){
$(this).parent().find("div.hint").remove();
if ( "[% borrower_data.userid | html %]" != $(this).val() ) {
$(this).parent().append('<div class="hint">%s</div>'.format(_("You will be logged out if you modify your username")));
}
});
[% END %]
});
[% IF quickadd && op == 'add_form' && !check_member %]
$(document).ready(function () {
$("#entryform,#saverecord").hide();
[% q_add_f = Koha.Preference('PatronQuickAddFields').split('\|') %]
var qaddfields = [[% FOREACH field IN q_add_f.unique %]"[% field | html %]",[% END %]];
$("#entryform label").each(function () {
var input_label = $(this).attr('for');
if ( input_label == 'sex-female' ) {
input_label='sex';
}
else if ( input_label == 'btitle' ) {
input_label='title';
}
if( qaddfields.indexOf( input_label ) != -1 || $(this).attr('class') == 'required' ){
let orig_li = $(this).parent();
if( orig_li.attr('class') == 'radio' ){
let new_field = orig_li.clone();
new_field.children('label').each(function(){
let child_input = $(this).children('input');
child_input.attr("id",child_input.attr("id") + "_quick_add");
});
new_field.appendTo("#quick_add_list");
} else {
let orig_input_id = orig_li.children("input,textarea,select").last().attr("id");
if ( orig_input_id ) {
let new_field = orig_li.clone();
new_field.children("#"+orig_input_id).attr("id",orig_input_id + "_quick_add");
new_field.appendTo("#quick_add_list");
}
[% UNLESS mandatorypassword %]
if( input_label == 'password' ){
let orig_p2 = $("#entryform label[for='password2']").parent();
let new_p2 = orig_p2.clone();
new_p2.find('input[id="password2"]').attr("id","password2_quick_add");
new_p2.appendTo("#quick_add_list");
}
[% END %]
}
}
});
if ( $("#memberentry_guarantor").length ) {
$("#memberentry_guarantor").appendTo("#quick_add_form");
}
$("#quick_add_form").show();
$("#quick_add_form").find(".flatpickr:hidden").each( (i, input) => {
$(input).siblings(".flatpickr_wrapper").remove(); // Remove leftover from the previous flatpickr that has been cloned
apply_flatpickr(input);
} );
});
[% END %]
$("#guarantor_template").hide();
var prefill_fields;
var to_api_mapping;
[% IF prefill_fields %]
prefill_fields = [% To.json(prefill_fields) | $raw %];
[% END %]
[% IF to_api_mapping %]
to_api_mapping = [% To.json(to_api_mapping) | $raw %];
[% END %]
var TalkingTechItivaPhoneNotification = [% Koha.Preference('TalkingTechItivaPhoneNotification') || 0 | html %];
var PhoneNotification = [% Koha.Preference('PhoneNotification') || 0 | html %];
</script>
[% Asset.js("js/members.js") | $raw %]
[% Asset.js("js/messaging-preference-form.js") | $raw %]
[% 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 %]
[% INCLUDE 'select2.inc' %]
[% SET columns = ['cardnumber','name','category','branch','dateofbirth','address-library','action'] %]
[% PROCESS patron_search_modal columns => columns, modal_title => t("Add guarantor") %]
[% PROCESS patron_search_js columns => columns, actions => ["select"], preview_on_name_click => 1 %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]