Lines 42-47
use C4::Form::MessagingPreferences;
Link Here
|
42 |
use Koha::Patron::Debarments; |
42 |
use Koha::Patron::Debarments; |
43 |
use Koha::Cities; |
43 |
use Koha::Cities; |
44 |
use Koha::DateUtils; |
44 |
use Koha::DateUtils; |
|
|
45 |
use Koha::Patron::Categories; |
45 |
use Koha::Token; |
46 |
use Koha::Token; |
46 |
use Email::Valid; |
47 |
use Email::Valid; |
47 |
use Module::Load; |
48 |
use Module::Load; |
Lines 153-161
$template->param( "checked" => 1 ) if ( defined($nodouble) && $nodouble eq 1 );
Link Here
|
153 |
my $categorycode = $input->param('categorycode') || $borrower_data->{'categorycode'}; |
154 |
my $categorycode = $input->param('categorycode') || $borrower_data->{'categorycode'}; |
154 |
my $category_type = $input->param('category_type') || ''; |
155 |
my $category_type = $input->param('category_type') || ''; |
155 |
unless ($category_type or !($categorycode)){ |
156 |
unless ($category_type or !($categorycode)){ |
156 |
my $borrowercategory = GetBorrowercategory($categorycode); |
157 |
my $borrowercategory = Koha::Patron::Categories->find($categorycode); |
157 |
$category_type = $borrowercategory->{'category_type'}; |
158 |
$category_type = $borrowercategory->category_type; |
158 |
my $category_name = $borrowercategory->{'description'}; |
159 |
my $category_name = $borrowercategory->description; |
159 |
$template->param("categoryname"=>$category_name); |
160 |
$template->param("categoryname"=>$category_name); |
160 |
} |
161 |
} |
161 |
$category_type="A" unless $category_type; # FIXME we should display a error message instead of a 500 error ! |
162 |
$category_type="A" unless $category_type; # FIXME we should display a error message instead of a 500 error ! |
Lines 303-310
if ($op eq 'save' || $op eq 'insert'){
Link Here
|
303 |
|
304 |
|
304 |
if ( $newdata{dateofbirth} ) { |
305 |
if ( $newdata{dateofbirth} ) { |
305 |
my $age = GetAge($newdata{dateofbirth}); |
306 |
my $age = GetAge($newdata{dateofbirth}); |
306 |
my $borrowercategory=GetBorrowercategory($newdata{'categorycode'}); |
307 |
my $borrowercategory = Koha::Patron::Categories->find($newdata{categorycode}); |
307 |
my ($low,$high) = ($borrowercategory->{'dateofbirthrequired'}, $borrowercategory->{'upperagelimit'}); |
308 |
my ($low,$high) = ($borrowercategory->dateofbirthrequired, $borrowercategory->upperagelimit); |
308 |
if (($high && ($age > $high)) or ($age < $low)) { |
309 |
if (($high && ($age > $high)) or ($age < $low)) { |
309 |
push @errors, 'ERROR_age_limitations'; |
310 |
push @errors, 'ERROR_age_limitations'; |
310 |
$template->param( age_low => $low); |
311 |
$template->param( age_low => $low); |