$("#saverecord").css({ 'margin-left': 0 });
var original_offset = $("#toolbar").position().top;
var additional_height = $("#filters").height();
- $('#toolbar').fixFloat({ 'originalOffset': original_offset - additional_height });
+ $('#toolbar').fixFloat({ 'originalOffset': original_offset });
$("#filteraction_on").on("click", function(){
$(window).off('scroll');
- $("#toolbar").css({ top: original_offset });
- $('#toolbar').fixFloat({ 'originalOffset': original_offset });
+ $("#toolbar").css({ top: original_offset + additional_height });
+ $('#toolbar').fixFloat({ 'originalOffset': original_offset + additional_height });
});
$("#filteraction_off").on("click", function(){
$(window).off('scroll');
- $("#toolbar").css({ top: original_offset - additional_height});
- $('#toolbar').fixFloat({ 'originalOffset': original_offset - additional_height });
+ $("#toolbar").css({ top: original_offset });
+ $('#toolbar').fixFloat({ 'originalOffset': original_offset });
})
[% IF categorycode %]
$(toggle_to+"[for='"+input_label+"']").next().prop('checked', $(this).next().prop('checked') );
return;
}
- if( $(this).next().val() != '' ) {
- $(toggle_to+"[for='"+input_label+"']").next().val( $(this).next().val() );
- }
+ $(toggle_to+"[for='"+input_label+"']").next().val( $(this).next().val() );
});
$(".toggler").toggle();
}
else {return false;}
});
+
+ $("#entryform").validate({
+ rules: {
+ password: {
+ required: true,
+ password_strong: true,
+ password_no_spaces: true
+ },
+ password2: {
+ required: true,
+ password_match: true
+ }
+ }
+ });
+
$("#saverecord").click(function(){
if( check_form_borrowers() ){
$("#entryform").submit();
}
});
+ $('#duplicate').on('click', function() {
+ $("input[name='op']").val('modify');
+ $("input[name='borrowernumber']").val('[% check_member %]');
+ $("input[name='check_member']").val('');
+ $('#entryform').submit();
+ });
+
+ $('#not-duplicate').on('click', function() {
+ $("input[name='nodouble']").val('1');
+ $('#entryform').submit();
+ });
});
var MSG_SEPARATOR = _("Separator must be / in field %s");
var MSG_DUPLICATE_ORGANIZATION = _("Warning: Duplicate organization");
var MSG_LATE_EXPIRY = _("Warning: Expiration date falls before enrollment date");
var MSG_DUPLICATE_SUSPICION = _("Please confirm whether this is a duplicate patron");
- var MSG_PASSWORD_MISMATCH = _("The passwords entered do not match");
- var MSG_PASSWORD_CONTAINS_TRAILING_SPACES = _("Password contains leading and/or trailing spaces.");
var MSG_MONTH = _("%s month")
var MSG_MONTHS = _("%s months")
var MSG_YEAR = _("%s year")
<div class="dialog alert">
<h3>Duplicate patron record?</h3>
<p><a class="popup" href="#" onclick="Dopop('moremember.pl?print=brief&borrowernumber=[% check_member %]');return false;" >View existing record</a></p>
- <form action="/cgi-bin/koha/members/memberentry.pl" method="get">
- <input type="hidden" name="op" value="modify" />
- <input type="hidden" name="borrowernumber" value="[% check_member %]" />
- <input type="hidden" name="csrf_token" value="[% csrf_token %]" />
- <button type="submit" class="new"><i class="fa fa-pencil"></i> It is a duplicate.
- Edit existing record</button>
- </form>
+ <button id="duplicate" type="submit" class="new"><i class="fa fa-pencil"></i> It is a duplicate.
+ Edit existing record</button>
- <form name="form" action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off">
- <input type="hidden" name="nodouble" value="1" />
- <input type="hidden" name="csrf_token" value="[% csrf_token %]" />
- <button type="submit" class="new"><i class="fa fa-plus"></i> Not a duplicate.
+ <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 ( ERROR_dateexpiry ) %]
<li id="ERROR_dateexpiry">Date of expiration is invalid.</li>
[% END %]
- [% IF ( ERROR_short_password ) %]
- <li id="ERROR_short_password">Password must be at least [% minPasswordLength %] characters long.</li>
- [% END %]
+ [% IF ( ERROR_password_too_short ) %]
+ <li id="ERROR_short_password">Password must be at least [% minPasswordLength %] 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 %]
<div id="toolbar" class="btn-toolbar">
[% UNLESS ( check_member ) %]
[% IF quickadd && opadd %]
- <button class="btn btn-small toggler" id="save_quick_add" name="save"><i class="fa fa-save"></i> Save</button>
+ <button class="btn btn-default btn-sm toggler" id="save_quick_add" name="save"><i class="fa fa-save"></i> Save</button>
[% END %]
- <button class="btn btn-small toggler" id="saverecord" name="save" ><i class="fa fa-save"></i> Save</button>
+ <button class="btn btn-default btn-sm toggler" id="saverecord" name="save" ><i class="fa fa-save"></i> Save</button>
[% IF opadd %]
- <a class="btn btn-small" href="/cgi-bin/koha/members/member.pl" class="toggler save_entryform">
+ <a class="btn btn-default btn-sm" href="/cgi-bin/koha/members/member.pl" class="toggler save_entryform">
[% ELSE %]
- <a class="btn btn-small" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">
+ <a class="btn btn-default btn-sm" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">
[% END %]
<i class="fa fa-times"></i> Cancel
</a>
[% END %]
</div>
-[% UNLESS ( check_member ) %]<form name="form" id="entryform" action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off" class="toggler" >
-<input type="hidden" name="nodouble" value="[% nodouble %]" /> [% 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 %]" />
+[% END %]
<!-- field always hidden in different form (1,2,3) -->
<input type="hidden" name="BorrowerMandatoryField" value="[% BorrowerMandatoryField %]" />
<input type="hidden" name="category_type" value="[% category_type %]" />
<input type="hidden" name="updtype" value="[% updtype %]" />
<input type="hidden" name="destination" value="[% destination %]" />
<input type="hidden" name="check_member" value="[% check_member %]" />
-<input type="hidden" name="borrowernumber" value="[% UNLESS opduplicate %][% borrowernumber %][% END %]" />
-<input type="hidden" name="nodouble" value="[% UNLESS opduplicate %][% nodouble %][% END %]" />
+<input type="hidden" name="borrowernumber" value="[% borrowernumber UNLESS opduplicate %]" />
+<input type="hidden" name="nodouble" value="[% nodouble UNLESS opduplicate %]" />
<input type="hidden" name="csrf_token" value="[% csrf_token %]" />
[% IF ( step ) %]<input type="hidden" name="step" value="[% step %]" />[% END %]
[% IF ( opadd ) %]<input type="hidden" name="op" value="insert" />
<label for="firstname">
[% END %]
First name: </label>
- <input type="text" id="firstname" name="firstname" size="20" value="[% UNLESS opduplicate %][% firstname | html %][% END %]" />
+ <input type="text" id="firstname" name="firstname" size="20" value="[% firstname | html UNLESS opduplicate %]" />
[% IF ( mandatoryfirstname ) %]<span class="required">Required</span>[% END %]
</li>
[% END %]
[% END %]
Date of birth: </label>
- <input type="text" id="dateofbirth" name="dateofbirth" size="20" onchange="write_age();" value="[% UNLESS opduplicate %][% dateofbirth %][% END %]" class="datepicker" />
+ <input type="text" id="dateofbirth" name="dateofbirth" size="20" onchange="write_age();" value="[% dateofbirth UNLESS opduplicate %]" class="datepicker" />
[% IF ( mandatorydateofbirth ) %]<span class="required">Required</span>[% END %]
[% IF ( ERROR_dateofbirth ) %]<span class="required">(Error)</span>[% END %]
<label for="initials">
[% END %]
Initials: </label>
- <input type="text" id="initials" name="initials" size="20" value="[% UNLESS opduplicate %][% initials | html %][% END %]" />
+ <input type="text" id="initials" name="initials" size="20" value="[% initials | html UNLESS opduplicate %]" />
[% IF ( mandatoryinitials ) %]<span class="required">Required</span>[% END %]
</li>
[% END %]
<label for="othernames">
[% END %]
Other name: </label>
- <input type="text" id="othernames" name="othernames" size="20" value="[% UNLESS opduplicate %][% othernames | html %][% END %]" />
+ <input type="text" id="othernames" name="othernames" size="20" value="[% othernames | html UNLESS opduplicate %]" />
[% IF ( mandatoryothernames ) %]<span class="required">Required</span>[% END %]
[% IF ( I ) %]<input type="hidden" name="sex" value="N" />[% END %]
</li>
[% UNLESS ( opduplicate ) %]
[% IF ( female ) %]
- <label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F" checked="checked" />
+ <label for="sex-female"><input type="radio" name="sex" id="sex-female" value="F" checked="checked" /> Female</label>
[% ELSE %]
- <label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F" />
+ <label for="sex-female"><input type="radio" name="sex" id="sex-female" value="F" /> Female</label>
[% END %]
[% IF ( male ) %]
- <label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" checked="checked" />
+ <label for="sex-male"><input type="radio" name="sex" id="sex-male" value="M" checked="checked" /> Male</label>
[% ELSE %]
- <label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" />
+ <label for="sex-male"><input type="radio" name="sex" id="sex-male" value="M" /> Male</label>
[% END %]
[% IF ( none ) %]
- <label for="sex-none">None specified </label><input type="radio" name="sex" id="sex-none" value="" checked="checked" />
+ <label for="sex-none"><input type="radio" name="sex" id="sex-none" value="" checked="checked" /> None specified</label>
[% ELSE %]
- <label for="sex-none">None specified </label><input type="radio" name="sex" id="sex-none" value="" />
+ <label for="sex-none"><input type="radio" name="sex" id="sex-none" value="" /> None specified</label>
[% END %]
[% ELSE %]
<label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F" />
[% ELSE %]
<li id="contact-details" style="display: none">
[% END %]
- <span class="label">Patron #:</span> [% IF ( guarantorid ) %] <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantorid %]" target="blank">[% guarantorid %]</a>[% END %]
+ <span class="label">Patron #:</span> [% IF ( guarantorid ) %] <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantorid %]" target="blank">[% guarantorid |html %]</a>[% END %]
</li>
[% UNLESS nocontactname %]
<li>
[% END %]
[% IF ( step_3 ) %]
+ [% SET autoMemberNum = Koha.Preference('autoMemberNum') %]
<fieldset class="rows" id="memberentry_library_management">
<legend id="library_management_lgd">Library management</legend><ol>
[% UNLESS nocardnumber %]
<li>
- [% IF ( mandatorycardnumber ) %]
+ [% IF mandatorycardnumber and not autoMemberNum %]
<label for="cardnumber" class="required">
[% ELSE %]
<label for="cardnumber" class="validated">
[% END %]
- Card number: </label>
+ [% IF autoMemberNum %]
+ Card number<br>(<u>leave blank for auto calc during registration</u>): </label>
+ [% ELSE %]
+ Card number: </label>
+ [% END %]
[% IF minlength_cardnumber == maxlength_cardnumber %]
<input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber | html %]" minlength="[% minlength_cardnumber %]" maxlength="[% maxlength_cardnumber %]" />
- [% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]
+ [% IF mandatorycardnumber and not autoMemberNum %]<span class="required">Required</span>[% END %]
<div class="hint">Card number must be exactly [% minlength_cardnumber %] characters.</div>
[% ELSIF minlength_cardnumber && maxlength_cardnumber %]
<input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber | html %]" minlength="[% minlength_cardnumber %]" maxlength="[% maxlength_cardnumber %]" />
- [% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]
+ [% IF mandatorycardnumber and not autoMemberNum %]<span class="required">Required</span>[% END %]
<div class="hint">Card number must be between [% minlength_cardnumber %] and [% maxlength_cardnumber %] characters.</div>
[% ELSIF maxlength_cardnumber %]
<input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber | html %]" maxlength="[% maxlength_cardnumber %]" />
- [% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]
+ [% IF mandatorycardnumber and not autoMemberNum %]<span class="required">Required</span>[% END %]
<div class="hint">Card number can be up to [% maxlength_cardnumber %] characters.</div>
[% ELSE %]
<input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber | html %]" />
- [% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]
+ [% IF mandatorycardnumber and not autoMemberNum %]<span class="required">Required</span>[% END %]
<div class="hint">There is no minimum or maximum character length.</div>
[% END %]
</li>
</select>
</li>
[% END %]
+ [% 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 == lang %]
+ <option value="[% sublanguage.rfc4646_subtag %]" selected="selected">[% sublanguage.native_description %] [% sublanguage.region_description %] ([% sublanguage.rfc4646_subtag %])</option>
+ [% ELSE %]
+ <option value="[% sublanguage.rfc4646_subtag %]">[% sublanguage.native_description %] [% sublanguage.region_description %] ([% sublanguage.rfc4646_subtag %])</option>
+ [% END %]
+ [% ELSE %]
+ [% IF sublanguage.rfc4646_subtag == lang %]
+ <option value="[% sublanguage.rfc4646_subtag %]" selected="selected">[% sublanguage.native_description %] ([% sublanguage.rfc4646_subtag %])</option>
+ [% ELSE %]
+ <option value="[% sublanguage.rfc4646_subtag %]">[% sublanguage.native_description %] ([% sublanguage.rfc4646_subtag %])</option>
+ [% END %]
+ [% END %]
+ [% END %]
+ [% END %]
+ </select>
+ </li>
+ [% END %]
</ol>
</fieldset>
[% UNLESS nodateenrolled && noopacnote && noborrowernotes %]
Expiry date (leave blank for auto calc): </label>
[% IF ( dateformat == "metric" ) %]
[% UNLESS ( opadd ) %]
- <input type="text" id="to" name="dateexpiry" maxlength="10" size="10" onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');" value="[% UNLESS opduplicate %][% dateexpiry %][% END %]" class="datepickerto" />
+ <input type="text" id="to" name="dateexpiry" maxlength="10" size="10" onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');" value="[% dateexpiry UNLESS opduplicate %]" class="datepickerto" />
[% ELSE %]
<input type="text" id="to" name="dateexpiry" maxlength="10" size="10" onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');" class="datepickerto" />
[% END %]
[% ELSE %]
[% UNLESS ( opadd ) %]
- <input type="text" id="to" name="dateexpiry" maxlength="10" size="10" value="[% UNLESS opduplicate %][% dateexpiry %][% END %]" class="datepickerto" />
+ <input type="text" id="to" name="dateexpiry" maxlength="10" size="10" value="[% dateexpiry UNLESS opduplicate %]" class="datepickerto" />
[% ELSE %]
- <input type="text" id="to" name="dateexpiry" maxlength="10" size="10" class="datepickerto" />
+ <input type="text" id="to" name="dateexpiry" maxlength="10" size="10" value="[% dateexpiry %]" class="datepickerto" />
[% END %]
[% END %]
[% IF ( mandatorydateexpiry ) %]<span class="required">Required</span>[% END %]
<label for="opacnote">
[% END %]
OPAC note: </label>
- <textarea id="opacnote" name="opacnote" cols="55" rows="5">[% UNLESS opduplicate %][% opacnote | html %][% END %]</textarea>
+ <textarea id="opacnote" name="opacnote" cols="55" rows="5">[% opacnote | html UNLESS opduplicate %]</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>
<label for="borrowernotes">
[% END %]
Circulation note: </label>
- <textarea id="borrowernotes" name="borrowernotes" cols="55" rows="5">[% UNLESS opduplicate %][% borrowernotes | html %][% END %]</textarea>
+ <textarea id="borrowernotes" name="borrowernotes" cols="55" rows="5">[% borrowernotes | html UNLESS opduplicate %]</textarea>
<div class="hint">This message displays when checking out to this patron</div>
[% IF ( mandatoryborrowernotes ) %]<span class="required">Required</span>[% END %]
</li>
[% END %]
[% END %]
[% END %]
- [% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %][% IF ( ERROR_short_password ) %]<span class="required">Password is too short</span>[% END %]
-[% IF ( minPasswordLength ) %]<div class="hint">Minimum password length: [% minPasswordLength %]</div>[% END %]
+ [% 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: [% minPasswordLength %]</div>
</li>
<li>
[% IF ( mandatorypassword ) %]
[% IF ( flagloo.key == 'lost' ) %]Lost card:[% END %]
</label>
[% IF CAN_user_circulate_manage_restrictions %]
- <label for="yes[% flagloo.name %]">Yes </label>
+ <label for="yes[% flagloo.name %]">
[% IF ( flagloo.yes ) %]
<input type="radio" id="yes[% flagloo.name %]" name="[% flagloo.name %]" value="1" checked="checked" />
[% ELSE %]
<input type="radio" id="yes[% flagloo.name %]" name="[% flagloo.name %]" value="1" />
[% END %]
- <label for="no[% flagloo.name %]">No </label>
+ Yes </label>
+ <label for="no[% flagloo.name %]">
[% IF ( flagloo.no ) %]
<input type="radio" id="no[% flagloo.name %]" name="[% flagloo.name %]" value="0" checked="checked"/>
[% ELSE %]
<input type="radio" id="no[% flagloo.name %]" name="[% flagloo.name %]" value="0" />
[% END %]
+ No </label>
[% ELSE %]
[% IF flagloo.yes %]Yes[% ELSE %]No[% END %]
[% END %]
[% FOREACH patron_attribute IN pa_loo.items %]
<li data-category_code="[% patron_attribute.category_code %]">
<label for="[% patron_attribute.form_id %]">[% patron_attribute.description %]: </label>
- <input type="hidden" id="[% patron_attribute.form_id %]_code" name="[% patron_attribute.form_id %]_code" value="[% patron_attribute.code |html %]" />
[% IF ( patron_attribute.use_dropdown ) %]
<select id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]">
<option value=""></option>
[% ELSE %]
<textarea rows="2" cols="30" id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]">[% patron_attribute.value %]</textarea>
[% END %]
+ <input type="hidden" id="[% patron_attribute.form_id %]_code" name="[% patron_attribute.form_id %]_code" value="[% patron_attribute.code |html %]" />
<a href="#" onclick="clear_entry(this); return false;"><i class="fa fa-fw fa-trash"></i> Clear</a>
[% IF ( patron_attribute.repeatable ) %]
<a href="#" onclick="clone_entry(this); return false;"><i class="fa fa-fw fa-plus"></i> New</a>
</form>
<script>
$(document).ready(function () {
+
$("#entryform,#saverecord").hide();
[% q_add_f = Koha.Preference('PatronQuickAddFields').split('\|') %]
var qaddfields = [[% FOREACH field IN q_add_f.unique %]"[% field %]",[% END %]];
if ( skipped_fields.indexOf( input_label ) != -1 ) { input_label=""; }
if( qaddfields.indexOf( input_label ) != -1 || $(this).attr('class') == 'required' ){
$(this).parent().clone().appendTo("#quick_add_list");
- if( input_label == 'password') $("#entryform label[for='password2']").parent().clone().appendTo("#quick_add_list");
+ [% UNLESS mandatorypassword %]
+ if( input_label == 'password' ) $("#entryform label[for='password2']").parent().clone().appendTo("#quick_add_list");
+ [% END %]
}
});
if( $("#memberentry_guarantor").length ) {
$("#memberentry_guarantor").clone().appendTo("#quick_add_list").css("margin",0);
+ $("#quick_add_form #memberentry_guarantor").append("<p>" + _("Note: Quick add guarantor form populates address fields in full form") + "</p>");
+ $("#quick_add_list #guarantordelete").prop('id','qagd');
}
+ $("#qagd").click(function() { $("#guarantordelete").click(); });
$("#quick_add_form").show();
});
</script>
[% END %]
</div>
[% INCLUDE 'intranet-bottom.inc' %]
-
+[% PROCESS 'password_check.inc' %]
+[% PROCESS 'add_password_check' new_password => 'password' %]