View | Details | Raw Unified | Return to bug 8464
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-1 / +1 lines)
Lines 168-174 Link Here
168
			[% END %]
168
			[% END %]
169
			[% IF ( ERROR_age_limitations ) %]
169
			[% IF ( ERROR_age_limitations ) %]
170
				<li id="ERROR_age_limitations">Patron's age is incorrect for their category.  
170
				<li id="ERROR_age_limitations">Patron's age is incorrect for their category.  
171
					Ages allowed are [% ERROR_age_limitations %].</li>
171
					Ages allowed are [% allowedAgeRange %].</li>
172
			[% END %]
172
			[% END %]
173
			[% IF ( ERROR_branch ) %]
173
			[% IF ( ERROR_branch ) %]
174
				<li id="ERROR_branch">Library is invalid.</li>
174
				<li id="ERROR_branch">Library is invalid.</li>
(-)a/members/memberentry.pl (-8 / +7 lines)
Lines 97-110 $template->param("minPasswordLength" => $minpw); Link Here
97
97
98
# function to designate mandatory fields (visually with css)
98
# function to designate mandatory fields (visually with css)
99
my $check_BorrowerMandatoryField=C4::Context->preference("BorrowerMandatoryField");
99
my $check_BorrowerMandatoryField=C4::Context->preference("BorrowerMandatoryField");
100
my @field_check=split(/\|/,$check_BorrowerMandatoryField);
100
my @field_check_mandatory=split(/\|/,$check_BorrowerMandatoryField);
101
foreach (@field_check) {
101
foreach (@field_check_mandatory) {
102
	$template->param( "mandatory$_" => 1);    
102
	$template->param( "mandatory$_" => 1);    
103
}
103
}
104
# function to designate unwanted fields
104
# function to designate unwanted fields
105
my $check_BorrowerUnwantedField=C4::Context->preference("BorrowerUnwantedField");
105
my $check_BorrowerUnwantedField=C4::Context->preference("BorrowerUnwantedField");
106
@field_check=split(/\|/,$check_BorrowerUnwantedField);
106
my @field_check_unwanted=split(/\|/,$check_BorrowerUnwantedField);
107
foreach (@field_check) {
107
foreach (@field_check_unwanted) {
108
    next unless m/\w/o;
108
    next unless m/\w/o;
109
	$template->param( "no$_" => 1);
109
	$template->param( "no$_" => 1);
110
}
110
}
Lines 263-277 if ($op eq 'save' || $op eq 'insert'){ Link Here
263
263
264
    if (checkcardnumber($newdata{cardnumber},$newdata{borrowernumber})){ 
264
    if (checkcardnumber($newdata{cardnumber},$newdata{borrowernumber})){ 
265
        push @errors, 'ERROR_cardnumber';
265
        push @errors, 'ERROR_cardnumber';
266
    } 
266
    }
267
    my $dateofbirthmandatory = (scalar grep {$_ eq "dateofbirth"} @field_check) ? 1 : 0;
267
    my $dateofbirthmandatory = (scalar grep {$_ eq "dateofbirth"} @field_check_mandatory) ? 1 : 0;
268
    if ($newdata{dateofbirth} && $dateofbirthmandatory) {
268
    if ($newdata{dateofbirth} && $dateofbirthmandatory) {
269
        my $age = GetAge($newdata{dateofbirth});
269
        my $age = GetAge($newdata{dateofbirth});
270
        my $borrowercategory=GetBorrowercategory($newdata{'categorycode'});   
270
        my $borrowercategory=GetBorrowercategory($newdata{'categorycode'});   
271
        my ($low,$high) = ($borrowercategory->{'dateofbirthrequired'}, $borrowercategory->{'upperagelimit'});
271
        my ($low,$high) = ($borrowercategory->{'dateofbirthrequired'}, $borrowercategory->{'upperagelimit'});
272
        if (($high && ($age > $high)) or ($age < $low)) {
272
        if (($high && ($age > $high)) or ($age < $low)) {
273
            push @errors, 'ERROR_age_limitations';
273
            push @errors, 'ERROR_age_limitations';
274
            $template->param('ERROR_age_limitations' => "$low to $high");
274
            $template->param('allowedAgeRange' => "$low to $high");
275
        }
275
        }
276
    }
276
    }
277
  
277
  
278
- 

Return to bug 8464