[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Patrons › [% IF ( opadd ) %]Add[% ELSIF ( opduplicate ) %]Duplicate[% ELSE %] Modify[% END %] patron [% IF (firstname) %][% firstname %] [% END %][% IF (surname) %][% surname %] [% END %]([%IF ( categoryname ) %][% categoryname %][% ELSE %][% IF ( I ) %]Organization[% END %][% IF ( A ) %]Adult[% END %][% IF ( C ) %]Child[% END %][% IF ( P ) %]Professional[% END %][% IF ( S ) %]Staff[% END %][% END %])</title>
[% INCLUDE 'doc-head-close.inc' %]
+<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
[% INCLUDE 'calendar.inc' %]
<script type="text/javascript">
//<![CDATA[
- $(document).ready(function() {
- $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
- $("#guarantordelete").click(function() {
- $("#contact-details").hide().find('a').remove();
- $("#guarantorid, #contactname, #contactfirstname").each(function () { this.value = "" });
- $("#contactname, #contactfirstname")
- .each(function () { this.type = 'text' })
- .parent().find('span').remove();
- $("#guarantorsearch").val(_("Set to patron"));
- });
- $("#select_city").change(function(){
- var myRegEx=new RegExp(/(.*)\|(.*)\|(.*)\|(.*)/);
- document.form.select_city.value.match(myRegEx);
- document.form.zipcode.value=RegExp.$1;
- document.form.city.value=RegExp.$2;
- document.form.state.value=RegExp.$3;
- document.form.country.value=RegExp.$4;
- });
+$(document).ready(function() {
- [% IF categorycode %]
- update_category_code( "[% categorycode %]" );
- [% ELSE %]
- if ( $("#categorycode_entry").length > 0 ){
- var category_code = $("#categorycode_entry").find("option:selected").val();
- update_category_code( category_code );
- }
- [% END %]
- $("#dateofbirth").datepicker({ maxDate: "-1D" });
- $("#entryform").validate({
- submitHandler: function(form) {
- $("body, form input[type='submit'], form button[type='submit'], form a").addClass('waiting');
- if (form.beenSubmitted)
- return false;
- else
- form.beenSubmitted = true;
- form.submit();
- }
+ $("#saverecord").css({ 'margin-left': 0 });
+ var original_offset = $("#toolbar").position().top;
+ var additional_height = $("#filters").height();
+ $('#toolbar').fixFloat({ 'originalOffset': original_offset - additional_height });
+ $("#filteraction_on").on("click", function(){
+ $(window).off('scroll');
+ $("#toolbar").css({ top: original_offset });
+ $('#toolbar').fixFloat({ 'originalOffset': original_offset });
});
+ $("#filteraction_off").on("click", function(){
+ $(window).off('scroll');
+ $("#toolbar").css({ top: original_offset - additional_height});
+ $('#toolbar').fixFloat({ 'originalOffset': original_offset - additional_height });
+ })
- var mrform = $("#manual_restriction_form");
- var mrlink = $("#add_manual_restriction");
- mrform.hide();
- mrlink.on("click",function(e){
- $(this).hide();
- mrform.show();
- e.preventDefault();
- });
- $("#cancel_manual_restriction").on("click",function(e){
- $('#debarred_expiration').val('');
- $('#add_debarment').val(0);
- $('#debarred_comment').val('');
- mrlink.show();
- mrform.hide();
- e.preventDefault();
- });
- });
-
- function clear_entry(node) {
- var original = $(node).parent();
- $("textarea", original).attr('value', '');
- $("select", original).attr('value', '');
- }
+ [% IF categorycode %]
+ update_category_code( "[% categorycode %]" );
+ [% ELSE %]
+ if ( $("#categorycode_entry").length > 0 ){
+ var category_code = $("#categorycode_entry").find("option:selected").val();
+ update_category_code( category_code );
+ }
+ [% END %]
+});
- function clone_entry(node) {
- var original = $(node).parent();
- var clone = original.clone();
+$(document).ready(function() {
- var newId = 50 + parseInt(Math.random() * 100000);
- $("input,select,textarea", clone).attr('id', function() {
- return this.id.replace(/patron_attr_\d+/, 'patron_attr_' + newId);
- });
- $("input,select,textarea", clone).attr('name', function() {
- return this.name.replace(/patron_attr_\d+/, 'patron_attr_' + newId);
- });
- $("label", clone).attr('for', function() {
- return $(this).attr("for").replace(/patron_attr_\d+/, 'patron_attr_' + newId);
+ 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";
+ } else {
+ toggle_to="#entryform label";
+ toggle_from = "#quick_add_form label";
+ }
+ $(toggle_from).each(function() {
+ var input_label = $(this).attr('for');
+ if ( input_label == 'sex-male' || input_label == 'sex-none' || input_label == 'sex-female' ) {
+ $(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() );
+ }
});
- $("input#patron_attr_" + newId, clone).attr('value','');
- $("select#patron_attr_" + newId, clone).attr('value','');
- $(original).after(clone);
- return false;
- }
- function update_category_code(category_code) {
- if ( $(category_code).is("select") ) {
- category_code = $("#categorycode_entry").find("option:selected").val();
- }
- var mytables = $(".attributes_table");
- $(mytables).find("li").hide();
- $(mytables).find(" li[data-category_code='"+category_code+"']").show();
- $(mytables).find(" li[data-category_code='']").show();
- }
+ $(".toggler").toggle();
+ });
- function select_user(borrowernumber, borrower) {
- var form = $('#entryform').get(0);
- if (form.guarantorid.value) {
- $("#contact-details").find('a').remove();
- $("#contactname, #contactfirstname").parent().find('span').remove();
+ $("#save_quick_add").click(function(){
+ $("#quick_add_form").validate();
+ if( $("#quick_add_form").valid()){
+ $('.toggle_quick_add').click();
+ $('#saverecord').click();
}
+ else {return false;}
+ });
+ $("#saverecord").click(function(){
+ if( check_form_borrowers() ){
+ $("#entryform").submit();
+ }
+ });
- var id = borrower.borrowernumber;
- form.guarantorid.value = id;
- $('#contact-details')
- .show()
- .find('span')
- .after('<a target="blank" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=' + id + '">' + id + '</a>');
-
- $(form.contactname)
- .val(borrower.surname)
- .before('<span>' + borrower.surname + '</span>').get(0).type = 'hidden';
- $(form.contactfirstname)
- .val(borrower.firstname)
- .before('<span>' + borrower.firstname + '</span>').get(0).type = 'hidden';
-
- form.streetnumber.value = borrower.streetnumber;
- form.address.value = borrower.address;
- form.address2.value = borrower.address2;
- form.city.value = borrower.city;
- form.state.value = borrower.state;
- form.zipcode.value = borrower.zipcode;
- form.country.value = borrower.country;
- form.branchcode.value = borrower.branchcode;
-
- form.guarantorsearch.value = _("Change");
-
- return 0;
- }
-
-
+});
var MSG_SEPARATOR = _("Separator must be / in field %s");
var MSG_INCORRECT_DAY = _("Invalid day entered in field %s");
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")
+ var MSG_YEARS = _("%s years")
+ var LABEL_CHANGE = _("Change");
+ var LABEL_SET_TO_PATRON = _("Set to patron");
+ var LABEL_AGE = _("Age");
+
//]]>
</script>
-<script type="text/javascript" src="[% themelang %]/js/members.js"></script>
+<script type="text/javascript" src="[% interface %]/[% theme %]/js/members.js"></script>
</head>
<body id="pat_memberentrygen" class="pat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'patron-search.inc' %]
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> ›
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> ›
[% IF (firstname || surname ) %] <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% IF (firstname) %][% firstname %] [% END %][% IF (surname) %][% surname %] [% END %]</a> ›[% END %]
<strong>[% IF ( opadd ) %]Add[% ELSIF ( opduplicate ) %]Duplicate[% ELSE %] Modify[% END %] patron ([%IF ( categoryname ) %][% categoryname %][% ELSE %][% IF ( I ) %]Organization[% END %][% IF ( A ) %]Adult[% END %][% IF ( C ) %]Child[% END %][% IF ( P ) %]Professional[% END %][% IF ( S ) %]Staff[% END %][% END %])</strong>
</div>
[% IF ( opadd ) %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %]
-
+
<div id="bd">
<div id="yui-main">
<div class="yui-b">
[% END %]
[% IF ( no_add ) %]<div class="dialog alert"><h3>Cannot add patron</h3>
- [% IF ( no_branches ) %]<p>There are <strong>no libraries defined</strong>. [% IF ( CAN_user_parameters ) %]Please <a href="/cgi-bin/koha/admin/branches.pl">add a library</a>.[% ELSE %]An administrator must define at least one library.[% END %]</p>[% END %]
- [% IF ( no_categories ) %]<p>There are <strong>no patron categories defined</strong>. [% IF ( CAN_user_parameters ) %]Please <a href="/cgi-bin/koha/admin/categorie.pl">add a patron category</a>.[% ELSE %]An administrator must define at least one patron category.</p>[% END %][% END %]</div>[% END %]
+ [% IF ( no_branches ) %]<p><strong>There are no libraries defined.</strong> [% IF ( CAN_user_parameters ) %]<a href="/cgi-bin/koha/admin/branches.pl">Please add a library.</a>[% ELSE %]An administrator must define at least one library.[% END %]</p>[% END %]
+ [% IF ( no_categories ) %]<p><strong>There are no patron categories defined.</strong> [% IF ( CAN_user_parameters ) %]<a href="/cgi-bin/koha/admin/categories.pl">Please add a patron category.</a>[% ELSE %]An administrator must define at least one patron category.</p>[% END %][% END %]</div>[% END %]
[% UNLESS ( no_add ) %]
<h1>[% IF ( opadd ) %]Add[% ELSIF ( opduplicate ) %]Duplicate[% ELSE %] Modify[% END %] patron [% IF (firstname) %][% firstname %] [% END %][% IF (surname) %][% surname %] [% END %]([%IF ( categoryname ) %][% categoryname %][% ELSE %][% IF ( I ) %]Organization[% END %][% IF ( A ) %]Adult[% END %][% IF ( C ) %]Child[% END %][% IF ( P ) %]Professional[% END %][% IF ( S ) %]Staff[% END %][% END %])</h1>
-
+
+ [% IF quickadd && opadd && !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="dialog alert">
<h3>Duplicate patron record?</h3>
- <p><a class="popup" href="javascript:Dopop('moremember.pl?print=brief&borrowernumber=[% check_member %]');" >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="category_type" value="[% check_categorytype %]" /><input class="edit" type="submit" value="It is a duplicate. Edit existing record" /></form>
+ <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 %]" />
+ <button type="submit" class="new"><i class="fa fa-pencil"></i> It is a duplicate.
+ Edit existing record</button>
+ </form>
- <form name="form_double" action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off">
+ <form name="form" action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off">
<input type="hidden" name="nodouble" value="1" />
- <input class="new" type="submit" value="Not a duplicate. Save as new record" />
+ <button type="submit" class="new"><i class="fa fa-plus"></i> Not a duplicate.
+ Save as new record</button>
</div>
[% END %]
<li id="ERROR_cardnumber">Cardnumber length is incorrect.</li>
[% END %]
[% IF ( ERROR_age_limitations ) %]
- <li id="ERROR_age_limitations">Patron's age is incorrect for their category.
+ <li id="ERROR_age_limitations">Patron's age is incorrect for their category.
Ages allowed are [% age_low %]-[% age_high %].</li>
[% END %]
[% IF ( ERROR_branch ) %]
<li id="ERROR_branch">Library is invalid.</li>
- [% END %]
+ [% END %]
[% IF ( ERROR_dateofbirth ) %]
<li id="ERROR_dateofbirth">Date of birth is invalid.</li>
[% END %]
<li id="ERROR_password_mismatch">Passwords do not match.</li>
[% END %]
[% IF ( ERROR_extended_unique_id_failed ) %]
- <li id="ERROR_extended_unique_id_failed"><strong>[% ERROR_extended_unique_id_failed_description %]</strong> attribute value <i>[% ERROR_extended_unique_id_failed_value %]</i> is already in use by another patron record.</li>
+ <li id="ERROR_extended_unique_id_failed"><strong>[% ERROR_extended_unique_id_failed_description %]:</strong> Attribute value "[% ERROR_extended_unique_id_failed_value %]" 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 %]
</ul>
</div>
[% END %]
-[% UNLESS ( check_member ) %]<form name="form" id="entryform" action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off">
+<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>
+ [% END %]
+ <button class="btn btn-small 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">
+ [% ELSE %]
+ <a class="btn btn-small" 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 %]
<!-- field always hidden in different form (1,2,3) -->
<input type="hidden" name="BorrowerMandatoryField" value="[% BorrowerMandatoryField %]" />
[% END %]
Date of birth: </label>
- [% IF ( dateformat == "metric" ) %]
- <input type="text" id="dateofbirth" name="dateofbirth" size="20" onchange="CheckDate(document.form.dateofbirth);" value="[% UNLESS opduplicate %][% dateofbirth %][% END %]" />
- [% ELSE %]
- <input type="text" id="dateofbirth" name="dateofbirth" size="20" value="[% UNLESS opduplicate %][% dateofbirth %][% END %]" />
- [% END %]
+ <input type="text" id="dateofbirth" name="dateofbirth" size="20" onchange="write_age();" value="[% UNLESS opduplicate %][% dateofbirth %][% END %]" />
[% IF ( mandatorydateofbirth ) %]<span class="required">Required</span>[% END %]
[% IF ( ERROR_dateofbirth ) %]<span class="required">(Error)</span>[% END %]
<label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" />
[% END %]
[% IF ( none ) %]
- <label for="sex-none">N/A </label><input type="radio" name="sex" id="sex-none" value="" checked="checked" />
+ <label for="sex-none">None specified </label><input type="radio" name="sex" id="sex-none" value="" checked="checked" />
[% ELSE %]
- <label for="sex-none">N/A </label><input type="radio" name="sex" id="sex-none" value="" />
+ <label for="sex-none">None specified </label><input type="radio" name="sex" id="sex-none" value="" />
[% END %]
[% ELSE %]
<label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F" />
<label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" />
- <label for="sex-none">N/A </label><input type="radio" name="sex" id="sex-none" value="" checked="checked" />
+ <label for="sex-none">None specified </label><input type="radio" name="sex" id="sex-none" value="" checked="checked" />
[% END %]
</li>
</fieldset>
[% END # hide fieldset %]
-[% IF ( showguarantor ) %]<input type="hidden" id="guarantorid" name="guarantorid" value="[% guarantorid %]" />
- <fieldset class="rows">
- <legend>Guarantor information</legend>
+[% IF ( showguarantor ) %]
+ <input type="hidden" id="guarantorid" name="guarantorid" value="[% guarantorid %]" />
+ [% UNLESS step_6 %]
+ <input type="hidden" name="branchcode" value="[% branchcode %]" />
+ [% END %]
+ <fieldset id="memberentry_guarantor" class="rows">
+ <legend id="guarantor_lgd">Guarantor information</legend>
<ol>
[% IF ( P ) %]
[% IF ( guarantorid ) %]
<li>
<span class="label"> </span>
[% IF ( guarantorid ) %]
- <input id="guarantorsearch" type="button" value="Change" onclick="Dopopguarantor('guarantor_search.pl?category_type=[% category_type %]');" />
+ <input id="guarantorsearch" type="button" value="Change" onclick="Dopopguarantor('guarantor_search.pl');" />
[% ELSE %]
- <input id="guarantorsearch" type="button" value="Set to patron" onclick="Dopopguarantor('guarantor_search.pl?category_type=[% category_type %]');" />
+ <input id="guarantorsearch" type="button" value="Set to patron" onclick="Dopopguarantor('guarantor_search.pl');" />
[% END %]
<input id="guarantordelete" type="button" value="Delete" />
</li>
+ [% IF guarantorid && Koha.Preference('AllowStaffToSetCheckoutsVisibilityForGuarantor') %]
+ <li>
+ <label for="privacy_guarantor_checkouts">Show checkouts to guarantor</label>
+ <select name="privacy_guarantor_checkouts" id="privacy_guarantor_checkouts">
+ [% IF 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 guarantor of this patron to view this patron's checkouts from the OPAC</div>
+ </li>
+ [% END %]
</ol>
</fieldset>
<legend id="contact_lgd">Contact</legend><ol>
[% UNLESS nophone %]
<li>
- [% IF ( mandatoryphone ) %]
+ [% IF ( mandatoryphone ) %]
<label for="phone" class="required">
[% ELSE %]
<label for="phone">
[% END %]
[% UNLESS noemailpro %]
<li>
- [% IF ( mandatoryemailpro ) %]
+ [% IF ( mandatoryemailpro ) %]
<label for="emailpro" class="required">
[% ELSE %]
<label for="emailpro">
[% END %]
Card number: </label>
[% IF minlength_cardnumber == maxlength_cardnumber %]
- <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" minlength="[% minlength_cardnumber %]" maxlength="[% maxlength_cardnumber %]" title="exactly [% minlength_cardnumber %] characters" />
+ <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" minlength="[% minlength_cardnumber %]" maxlength="[% maxlength_cardnumber %]" />
+ [% IF ( mandatorycardnumber ) %]<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 %]" minlength="[% minlength_cardnumber %]" maxlength="[% maxlength_cardnumber %]" title="between [% minlength_cardnumber %] and [% maxlength_cardnumber %] characters" />
+ <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" minlength="[% minlength_cardnumber %]" maxlength="[% maxlength_cardnumber %]" />
+ [% IF ( mandatorycardnumber ) %]<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 %]" maxlength="[% maxlength_cardnumber %]" title="up to [% maxlength_cardnumber %] characters" />
+ <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" maxlength="[% maxlength_cardnumber %]" />
+ [% IF ( mandatorycardnumber ) %]<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 %]" />
+ <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" />
+ [% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]
+ <div class="hint">There is no minimum or maximum character length.</div>
[% END %]
- [% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]
</li>
[% END %]
[% UNLESS nobranchcode %]
[% END %]
</li>
[% END %]
- </ol>
+ [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
+ <li><label for="checkprevcheckout">Check for previous checkouts: </label>
+ <select name="checkprevcheckout" id="checkprevcheckout">
+ [% IF ( 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 ( 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 %]
+ </ol>
</fieldset>
[% UNLESS nodateenrolled && noopacnote && noborrowernotes %]
<fieldset class="rows" id="memberentry_subscription">
[% ELSE %]
<label for="to">
[% END %]
- Expiry date (leave blank for auto calc) </label>
+ 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" />
<label for="opacnote" class="required">
[% ELSE %]
<label for="opacnote">
- [% END %]
+ [% END %]
OPAC note: </label>
<textarea id="opacnote" name="opacnote" cols="55" rows="5">[% UNLESS opduplicate %][% opacnote %][% END %]</textarea>
<div class="hint">This message appears on this patron's user page in the OPAC</div>
[% END %]
[% UNLESS noborrowernotes %]
<li>
- [% IF ( mandatoryborrowernotes ) %]
+ [% IF ( mandatoryborrowernotes ) %]
<label for="borrowernotes" class="required">
[% ELSE %]
<label for="borrowernotes">
[% END %]
[% END %]
+[%# Dummy input to avoid Firefox from using userid/password saved for authentication %]
+<input type="text" disabled="disabled" style="display:none" />
+
[% IF ( mandatoryuserid ) %]<span class="required">Required</span>[% END %]
</li>
[%END %]
[% END # hide fieldset %][% END %]
<!--this zones are not necessary in modif mode -->
[% UNLESS ( opadd || opduplicate ) %]
- <fieldset class="rows">
- <legend>Patron account flags</legend>
+ <fieldset class="rows" id="memberentry_account_flags">
+ <legend id="account_flags_lgd">Patron account flags</legend>
<ol class="radio">
[% FOREACH flagloo IN flagloop %]
<li><label class="radio" for="yes[% flagloo.name %]">
</ol>
</fieldset>
- <fieldset class="rows">
- <legend>Patron restrictions</legend>
+ <fieldset class="rows" id="memberentry_restrictions">
+ <legend id="restrictions_lgd">Patron restrictions</legend>
- [% IF ( debarments.size < 1 ) %]
- <p>Patron is currently unrestricted.</p>
- [% ELSE %]
+ [% IF ( debarments ) %]
<table>
<thead>
<tr>
[% FOREACH d IN debarments %]
<tr>
<td>[% d.type %]</td>
- <td>[% d.comment %]</td>
+ <td>
+ [% IF d.comment.search('OVERDUES_PROCESS') %]
+ Restriction added by overdues process [% d.comment.remove('OVERDUES_PROCESS ') %]
+ [% ELSE %]
+ [% d.comment %]
+ [% END %]
+ </td>
<td>[% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] <i>Indefinite</i> [% END %]</td>
[% IF CAN_user_borrowers && CAN_user_circulate_manage_restrictions %]
<td>
[% END %]
</tbody>
</table>
+ [% ELSE %]
+ <p>Patron is currently unrestricted.</p>
[% END %]
+
[% IF CAN_user_borrowers && CAN_user_circulate_manage_restrictions %]
<p><a href="#" id="add_manual_restriction">Add manual restriction</a></p>
<fieldset id="manual_restriction_form">
<input type="hidden" id="add_debarment" name="add_debarment" value="0" />
- <legend>Add manual restriction</legend>
+ <legend id="manual_restriction_lgd">Add manual restriction</legend>
<ol>
<li><label for="debarred_comment">Comment: </label><input type="text" id="debarred_comment" name="debarred_comment" onchange="$('#add_debarment').val(1);" /></li>
<li><label for="debarred_expiration">Expiration: </label><input name="debarred_expiration" id="debarred_expiration" size="10" readonly="readonly" value="" class="datepicker" onchange="$('#add_debarment').val(1);" />
[% IF ( step_4 ) %][% IF ( ExtendedPatronAttributes ) %][% UNLESS ( no_patron_attribute_types ) %]
<fieldset class="rows" id="memberentry_patron_attributes">
- <legend>Additional attributes and identifiers</legend>
+ <legend id="patron_attributes_lgd">Additional attributes and identifiers</legend>
<input type="hidden" name="setting_extended_patron_attributes" value="1" />
[% FOREACH pa_loo IN patron_attributes %]
[% IF pa_loo.class %]
<fieldset id="aai_[% pa_loo.class %]">
- <legend>[% pa_loo.lib %]</legend>
+ <legend id="[% pa_loo.class %]_lgd">[% pa_loo.lib %]</legend>
[% END %]
<ol class="attributes_table">
[% FOREACH patron_attribute IN pa_loo.items %]
<select id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]">
<option value=""></option>
[% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
- [% IF ( auth_val_loo.selected ) %]
+ [% IF auth_val_loo.authorised_value == patron_attribute.value %]
<option value="[% auth_val_loo.authorised_value %]" selected="selected">
[% auth_val_loo.lib %]
</option>
[% ELSE %]
<textarea rows="2" cols="30" id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]">[% patron_attribute.value %]</textarea>
[% END %]
- [% IF ( patron_attribute.password_allowed ) %]
- (<label class="yesno" for="[% patron_attribute.form_id %]_password">Password:</label> <input type="password" maxlength="64" value="[% patron_attribute.password %]"
- id="[% patron_attribute.form_id %]_password" name="[% patron_attribute.form_id %]_password" />)
- [% END %]
- <a href="#" class="clear-field" onclick="clear_entry(this); return false;">Clear</a>
+ <a href="#" onclick="clear_entry(this); return false;"><i class="fa fa-fw fa-trash"></i> Clear</a>
[% IF ( patron_attribute.repeatable ) %]
- <a href="#" class="clone-field" onclick="clone_entry(this); return false;">New</a>
+ <a href="#" onclick="clone_entry(this); return false;"><i class="fa fa-fw fa-plus"></i> New</a>
[% END %]
</li>
[% END %]
var transports = ['email', 'rss', 'sms'];
$.each(transports, function(j, transport) {
if (item['transports_' + transport] == 1) {
- $('#' + transport + attrid).attr('checked', 'checked');
+ $('#' + transport + attrid).prop('checked', true);
} else {
- $('#' + transport + attrid).removeAttr('checked');
+ $('#' + transport + attrid).prop('checked', false);
}
});
if (item.digest && item.digest != ' ') {
- $('#digest' + attrid).attr('checked', item.digest);
+ $('#digest' + attrid).prop('checked', true);
} else {
- $('#digest' + attrid).removeAttr('checked');
+ $('#digest' + attrid).prop('checked', false);
}
if (item.takes_days == '1') {
$('[name=' + attrid + '-DAYS]').val('' + item.days_in_advance);
</script>
[% END %]
<input type="hidden" name="setting_messaging_prefs" value="1" />
- [% IF type_only %]
- <p>If no preferences are selected, the default preferences for the category chosen will be applied on save, otherwise your selection here is saved</p>
- [% END %]
[% INCLUDE 'messaging-preference-form.inc' %]
[% IF ( SMSSendDriver ) %]
<p><label for="SMSnumber">SMS number:</label>
<input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]" />
</p>
+ <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 == sms_provider_id %]
+ <option value="[% s.id %]" selected="selected">[% s.name %]</option>
+ [% ELSE %]
+ <option value="[% s.id %]">[% s.name %]</option>
+ [% END %]
+ [% END %]
+ </select>
+ </p>
[% END %]
</fieldset>
[% END %] [% END %]
-[% UNLESS ( check_member ) %]
- <fieldset class="action">
- <input type="submit" name="save" onclick="return check_form_borrowers();" value="Save" />
- [% IF ( opadd ) %]
- <a class="cancel" href="/cgi-bin/koha/members/member.pl">Cancel</a>
- [% ELSE %]
- <a class="cancel" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Cancel</a>
- [% END %]
- </fieldset>
-[% END %]
</form>
-
+
+[% IF quickadd && opadd && !check_member %]
+ <form id="quick_add_form" class="toggler">
+ <fieldset class="rows quick_add"><legend>Quick add</legend>
+ <ol id="quick_add_list">
+ </ol>
+ </fieldset>
+ </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 %]];
+ var skipped_fields = ["contactname","contactfirstname","relationship"]; //Guarantor form is pulled as a whole, ignore individual fields
+ $("#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 ( 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");
+ }
+ });
+ if( $("#memberentry_guarantor").length ) {
+ $("#memberentry_guarantor").clone().appendTo("#quick_add_list").css("margin",0);
+ }
+ $("#quick_add_form").show();
+ });
+ </script>
+[% END %]
</div>
</div>