[% PROCESS 'member-main-address-style.inc' %]
[% PROCESS 'member-alt-address-style.inc' %]
[% PROCESS 'member-alt-contact-style.inc' %]
+[% PROCESS 'patron_restrictions.inc' %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>
Modify patron
[% END %]
[% INCLUDE 'patron-title.inc' no_html = 1 %]
- [% IF categoryname %]([% categoryname | html %])[% END %]
+ [% IF patron_category %]([% patron_category.description | html %])[% END %]
[% END %] › Patrons › Koha
</title>
<style>
</head>
<body id="pat_memberentrygen" class="pat">
- [% INCLUDE 'header.inc' %]
- [% INCLUDE 'patron-search-header.inc' %]
+ [% WRAPPER 'header.inc' %]
+ [% INCLUDE 'patron-search-header.inc' %]
+ [% END %]
+ [% WRAPPER 'sub-header.inc' %]
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
<ol>
<li>
<li>
<a href="#" aria-current="page">
[% IF ( opadd ) %]
- Add patron
+ <span>Add patron</span>
[% ELSIF ( opduplicate ) %]
- Duplicate patron
+ <span>Duplicate patron</span>
[% ELSE %]
- Modify patron
+ <span>Modify patron</span>
[% END %]
- [% IF categoryname %]
- ([% categoryname | html %])
+ [% IF patron_category %]
+ ([% patron_category.description | html %])
[% END %]
</a>
</li>
[% END %]
</ol>
</nav> <!-- /#breadcrumbs -->
+ [% END %]
<div class="main container-fluid">
<div class="row">
[% UNLESS ( no_add ) %]
<h1>
[% IF ( opadd ) %]
- Add patron
+ <span>Add patron</span>
[% ELSIF ( opduplicate ) %]
- Duplicate patron
+ <span>Duplicate patron</span>
[% ELSE %]
- Modify patron
+ <span>Modify patron</span>
[% END %]
[% INCLUDE 'patron-title.inc' %]
- [% IF categoryname %]([% categoryname | html %])[% END %]
+ [% IF patron_category %]([% patron_category.description | html %])[% END %]
</h1>
[% IF quickadd && opadd && !check_member %]
[% END %]
<!-- field always hidden in different form (1,2,3) -->
<input type="hidden" name="BorrowerMandatoryField" value="[% BorrowerMandatoryField | html %]" />
- <input type="hidden" name="category_type" value="[% category_type | 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 %]" />
[% END %]
[% IF ( step_1 ) %]
- [% UNLESS notitle && nosurname && nofirstname && nodateofbirth && noinitials && noothernames &&nosex %]
+ [% UNLESS notitle && nosurname && nofirstname && nomiddle_name && nodateofbirth && noinitials && noothernames &&nosex && nopronouns %]
<fieldset class="rows" id="memberentry_identity">
- <legend id="identity_lgd">[% IF ( I ) %]Organization [% ELSE %]Patron [% END %]identity</legend>
+ <legend id="identity_lgd">[% IF ( patron_category.category_type == 'I' ) %]<span>Organization</span> [% ELSE %]<span>Patron</span> [% END %]<span>identity</span></legend>
<ol>
- [% UNLESS ( I ) %]
+ [% UNLESS ( patron_category.category_type == 'I' ) %]
[% UNLESS notitle %]
[% IF Koha.Preference('BorrowersTitles') %]
<li>
[% UNLESS nosurname %]
<li>
- [% IF ( I ) %]
+ [% IF ( patron_category.category_type == 'I' ) %]
<label for="surname" class="required">
Name:
</label>
</li>
[% END # /UNLESS nosurname %]
- [% UNLESS ( I ) %]
+ [% UNLESS ( patron_category.category_type == 'I' ) %]
[% UNLESS nofirstname %]
<li>
[% IF ( mandatoryfirstname ) %]
[% END %]
</li>
[% END #/UNLESS nofirstname %]
+ [% UNLESS nomiddle_name %]
+ <li>
+ [% IF ( mandatorymiddle_name ) %]
+ <label for="middle_name" class="required">
+ [% ELSE %]
+ <label for="middle_name">
+ [% END %]
+ Middle name:
+ </label>
+ <input type="text" id="middle_name" name="middle_name" size="20" value="[% borrower_data.middle_name | html UNLESS opduplicate %]" />
+ [% IF ( mandatorymiddle_name ) %]
+ <span class="required">Required</span>
+ [% END %]
+ </li>
+ [% END #/UNLESS nomiddle_name %]
[% UNLESS nodateofbirth %]
<li>
[% IF ( mandatorydateofbirth ) %]
[% END %]
Date of birth:
</label>
- <input type="text" id="dateofbirth" name="dateofbirth" size="20" value="[% borrower_data.dateofbirth | html UNLESS opduplicate %]" class="flatpickr" />
+ <input type="text" id="dateofbirth" name="dateofbirth" size="20" value="[% borrower_data.dateofbirth | html UNLESS opduplicate %]" class="flatpickr" data-flatpickr-pastinclusive="true" />
[% IF ( mandatorydateofbirth ) %]
<span class="required">Required</span>
[% END %]
[% END %]
</li>
[% END # /UNLESS noinitials %]
+ [% UNLESS nopronouns %]
+ <li>
+ [% IF ( mandatorypronouns ) %]
+ <label for="pronouns" class="required">
+ [% ELSE %]
+ <label for="pronouns">
+ [% END %]
+ Pronouns:
+ </label>
+ <input type="text" id="pronouns" name="pronouns" size="20" value="[% borrower_data.pronouns | html UNLESS opduplicate %]" />
+ [% IF ( mandatorypronouns ) %]
+ <span class="required">Required</span>
+ [% END %]
+ </li>
+ [% END # /UNLESS nopronouns %]
[% END #/UNLESS ( I ) %]
[% UNLESS noothernames %]
<li>
[% IF ( mandatoryothernames ) %]
<span class="required">Required</span>
[% END %]
- [% IF ( I ) %]<input type="hidden" name="sex" value="N" />[% END %]
+ [% IF ( patron_category.category_type == 'I' ) %]<input type="hidden" name="sex" value="N" />[% END %]
</li>
[% END #/UNLESS noothernames %]
- [% UNLESS ( I ) %]
+ [% UNLESS ( patron_category.category_type == 'I' ) %]
[% UNLESS nosex %]
<li class="radio">
[% UNLESS ( opduplicate ) %]
[% FOREACH r IN relationships %]
<fieldset>
<ol>
- [% IF category_type == 'I' %]
+ [% 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 hide_patron_infos_if_needed=1 %]
<li>
<label for="categorycode_entry" class="required">Category: </label>
<select id="categorycode_entry" name="categorycode">
- [% FOREACH typeloo IN typeloop %]
- [% FOREACH categoryloo IN typeloo.categoryloop %]
- [% IF ( loop.first ) %]
- [% IF ( typeloo.typename_C ) %]<optgroup label="Child">[% END %]
- [% IF ( typeloo.typename_A ) %]<optgroup label="Adult">[% END %]
- [% IF ( typeloo.typename_S ) %]<optgroup label="Staff">[% END %]
- [% IF ( typeloo.typename_I ) %]<optgroup label="Organization">[% END %]
- [% IF ( typeloo.typename_P ) %]<optgroup label="Professional">[% END %]
- [% IF ( typeloo.typename_X ) %]<optgroup label="Statistical">[% END %]
- [% END %]
- [% IF ( categoryloo.categorycodeselected ) %]
- <option value="[% categoryloo.categorycode | html %]" selected="selected" data-pwd-length="[% categoryloo.effective_min_password_length | html %]" data-pwd-strong="[% categoryloo.effective_require_strong_password | html %]" data-typename="[% typeloo.typename | html %]">[% categoryloo.categoryname | html %]</option>
+ [% FOREACH category_type IN patron_categories.keys %]
+ [% SWITCH category_type %]
+ [% CASE 'C' %]
+ <optgroup label="Child">
+ [% CASE 'A' %]
+ <optgroup label="Adult">
+ [% CASE 'S' %]
+ <optgroup label="Staff">
+ [% CASE 'I' %]
+ <optgroup label="Organization">
+ [% CASE 'P' %]
+ <optgroup label="Professional">
+ [% CASE 'X' %]
+ <optgroup label="Statistical">
+ [% CASE %]
+ <optgroup label="Unknown">
+ [% END %]
+ [% 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 %]">[% category.description | html %]</option>
[% ELSE %]
- <option value="[% categoryloo.categorycode | html %]" data-pwd-length="[% categoryloo.effective_min_password_length | html %]" data-pwd-strong="[% categoryloo.effective_require_strong_password | html %]" data-typename="[% typeloo.typename | html %]">[% categoryloo.categoryname | html %]</option>
+ <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>
[% END %]
- [% IF ( loop.last ) %]
- </optgroup>
- [% END %]
- [% END # /FOREACH categoryloo %]
- [% END # /FOREACH typeloo %]
+ [% END %]
+ </optgroup>
+ [% END %]
</select>
<span class="required">Required</span>
</li>
[% END # UNLESS nouserid && nopassword && !CanUpdatePasswordExpiration %]
<!--this zones are not necessary in modif mode -->
- [% UNLESS ( opadd || opduplicate ) %]
+ [% UNLESS ( opadd || opduplicate || ( nogonenoaddress && nolost ) ) %]
<fieldset class="rows" id="memberentry_account_flags">
<legend id="account_flags_lgd">Patron account flags</legend>
<ol class="radio">
- [% FOREACH flagloo IN flagloop %]
+ [% UNLESS nogonenoaddress %]
+ <li>
+ [% IF mandatorygonenoaddress %]
+ <label class="radio required" for="yesgonenoaddress">
+ [% ELSE %]
+ <label class="radio" for="yesgonenoaddress">
+ [% END %]
+ Gone no address:
+ </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" for="yes[% flagloo.name | html %]">
- [% IF ( flagloo.key == 'gonenoaddress' ) %]Gone no address:[% END %]
- [% IF ( flagloo.key == 'lost' ) %]Lost card:[% END %]
+ [% IF mandatorylost %]
+ <label class="radio required" for="yeslost">
+ [% ELSE %]
+ <label class="radio" for="yeslost">
+ [% END %]
+ Lost card:
</label>
[% IF CAN_user_circulate_manage_restrictions %]
- <label for="yes[% flagloo.name | html %]">
- [% IF ( flagloo.yes ) %]
- <input type="radio" id="yes[% flagloo.name | html %]" name="[% flagloo.name | html %]" value="1" checked="checked" />
+ <label for="yeslost">
+ [% IF ( borrower_data.lost ) %]
+ <input type="radio" id="yeslost" name="lost" value="1" checked="checked" />
[% ELSE %]
- <input type="radio" id="yes[% flagloo.name | html %]" name="[% flagloo.name | html %]" value="1" />
+ <input type="radio" id="yeslost" name="lost" value="1" />
[% END %]
Yes
</label>
- <label for="no[% flagloo.name | html %]">
- [% IF ( flagloo.no ) %]
- <input type="radio" id="no[% flagloo.name | html %]" name="[% flagloo.name | html %]" value="0" checked="checked"/>
+ <label for="nolost">
+ [% IF ( borrower_data.lost ) %]
+ <input type="radio" id="nolost" name="lost" value="0" />
[% ELSE %]
- <input type="radio" id="no[% flagloo.name | html %]" name="[% flagloo.name | html %]" value="0" />
+ <input type="radio" id="nolost" name="lost" value="0" checked="checked"/>
[% END %]
No
</label>
[% ELSE %]
- [% IF flagloo.yes %]Yes[% ELSE %]No[% END %]
+ [% 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 # /FOREACH flagloo %]
+ [% END # /UNLESS nogonenoaddress %]
</ol>
</fieldset> <!-- /#memberentry_account_flags -->
</thead>
<tbody>
[% FOREACH d IN debarments %]
+ [% dtype = d.type %]
<tr>
- <td>[% d.type | html %]</td>
+ <td>[% restriction_types.$dtype.display_text | html %]</td>
<td>
[% IF d.comment.search('OVERDUES_PROCESS') %]
Restriction added by overdues process [% d.comment.remove('OVERDUES_PROCESS ') | $raw %]
<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 code IN restriction_types.keys %]
+ [% IF !restriction_types.$code.is_system %]
+ [% IF restriction_types.$code.is_default %]
+ <option value="[% code | html %]" selected>[% PROCESS restriction_type_description restriction=restriction_types.$code %]</option>
+ [% ELSE %]
+ <option value="[% code | html %]">[% PROCESS restriction_type_description restriction=restriction_types.$code %]</option>
+ [% END %]
+ [% END %]
+ [% END %]
+ </select>
+ </li>
+ [% END %]
<li>
<label for="debarred_comment">Comment: </label>
<input type="text" id="debarred_comment" name="debarred_comment" />
<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 + if including the country code.</span>
+ <span class="hint sms_number_help">Please enter numbers only. Prefix the number with + or 00 if including the country code.</span>
</p>
- [% UNLESS nosms_provider_id %]
+ [% IF SMSSendDriver == 'Email' && !nosms_provider_id %]
<p>
<label for="sms_provider_id">SMS provider:</label>
<select id="sms_provider_id" name="sms_provider_id">
input_label='title';
}
if( qaddfields.indexOf( input_label ) != -1 || $(this).attr('class') == 'required' ){
- $(this).parent().clone().appendTo("#quick_add_list");
- [% UNLESS mandatorypassword %]
- if( input_label == 'password' ) $("#entryform label[for='password2']").parent().clone().appendTo("#quick_add_list");
- [% END %]
+ 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").attr("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 ) {