Lines 41-46
use C4::Branch; # GetBranches
Link Here
|
41 |
use C4::Form::MessagingPreferences; |
41 |
use C4::Form::MessagingPreferences; |
42 |
use Koha::Borrower::Debarments; |
42 |
use Koha::Borrower::Debarments; |
43 |
use Koha::DateUtils; |
43 |
use Koha::DateUtils; |
|
|
44 |
use Koha::Patron::Categories; |
44 |
use Email::Valid; |
45 |
use Email::Valid; |
45 |
use Module::Load; |
46 |
use Module::Load; |
46 |
if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preference('NorwegianPatronDBEnable') == 1 ) { |
47 |
if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preference('NorwegianPatronDBEnable') == 1 ) { |
Lines 145-153
$template->param( "checked" => 1 ) if ( defined($nodouble) && $nodouble eq 1 );
Link Here
|
145 |
my $categorycode = $input->param('categorycode') || $borrower_data->{'categorycode'}; |
146 |
my $categorycode = $input->param('categorycode') || $borrower_data->{'categorycode'}; |
146 |
my $category_type = $input->param('category_type') || ''; |
147 |
my $category_type = $input->param('category_type') || ''; |
147 |
unless ($category_type or !($categorycode)){ |
148 |
unless ($category_type or !($categorycode)){ |
148 |
my $borrowercategory = GetBorrowercategory($categorycode); |
149 |
my $borrowercategory = Koha::Patron::Categories->find($categorycode); |
149 |
$category_type = $borrowercategory->{'category_type'}; |
150 |
$category_type = $borrowercategory->category_type; |
150 |
my $category_name = $borrowercategory->{'description'}; |
151 |
my $category_name = $borrowercategory->description; |
151 |
$template->param("categoryname"=>$category_name); |
152 |
$template->param("categoryname"=>$category_name); |
152 |
} |
153 |
} |
153 |
$category_type="A" unless $category_type; # FIXME we should display a error message instead of a 500 error ! |
154 |
$category_type="A" unless $category_type; # FIXME we should display a error message instead of a 500 error ! |
Lines 290-297
if ($op eq 'save' || $op eq 'insert'){
Link Here
|
290 |
|
291 |
|
291 |
if ( $newdata{dateofbirth} ) { |
292 |
if ( $newdata{dateofbirth} ) { |
292 |
my $age = GetAge($newdata{dateofbirth}); |
293 |
my $age = GetAge($newdata{dateofbirth}); |
293 |
my $borrowercategory=GetBorrowercategory($newdata{'categorycode'}); |
294 |
my $borrowercategory = Koha::Patron::Categories->find($newdata{categorycode}); |
294 |
my ($low,$high) = ($borrowercategory->{'dateofbirthrequired'}, $borrowercategory->{'upperagelimit'}); |
295 |
my ($low,$high) = ($borrowercategory->dateofbirthrequired, $borrowercategory->upperagelimit); |
295 |
if (($high && ($age > $high)) or ($age < $low)) { |
296 |
if (($high && ($age > $high)) or ($age < $low)) { |
296 |
push @errors, 'ERROR_age_limitations'; |
297 |
push @errors, 'ERROR_age_limitations'; |
297 |
$template->param( age_low => $low); |
298 |
$template->param( age_low => $low); |