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 |
- |
|
|