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 Email::Valid; |
46 |
use Email::Valid; |
46 |
use Module::Load; |
47 |
use Module::Load; |
47 |
if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preference('NorwegianPatronDBEnable') == 1 ) { |
48 |
if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preference('NorwegianPatronDBEnable') == 1 ) { |
Lines 152-160
$template->param( "checked" => 1 ) if ( defined($nodouble) && $nodouble eq 1 );
Link Here
|
152 |
my $categorycode = $input->param('categorycode') || $borrower_data->{'categorycode'}; |
153 |
my $categorycode = $input->param('categorycode') || $borrower_data->{'categorycode'}; |
153 |
my $category_type = $input->param('category_type') || ''; |
154 |
my $category_type = $input->param('category_type') || ''; |
154 |
unless ($category_type or !($categorycode)){ |
155 |
unless ($category_type or !($categorycode)){ |
155 |
my $borrowercategory = GetBorrowercategory($categorycode); |
156 |
my $borrowercategory = Koha::Patron::Categories->find($categorycode); |
156 |
$category_type = $borrowercategory->{'category_type'}; |
157 |
$category_type = $borrowercategory->category_type; |
157 |
my $category_name = $borrowercategory->{'description'}; |
158 |
my $category_name = $borrowercategory->description; |
158 |
$template->param("categoryname"=>$category_name); |
159 |
$template->param("categoryname"=>$category_name); |
159 |
} |
160 |
} |
160 |
$category_type="A" unless $category_type; # FIXME we should display a error message instead of a 500 error ! |
161 |
$category_type="A" unless $category_type; # FIXME we should display a error message instead of a 500 error ! |
Lines 297-304
if ($op eq 'save' || $op eq 'insert'){
Link Here
|
297 |
|
298 |
|
298 |
if ( $newdata{dateofbirth} ) { |
299 |
if ( $newdata{dateofbirth} ) { |
299 |
my $age = GetAge($newdata{dateofbirth}); |
300 |
my $age = GetAge($newdata{dateofbirth}); |
300 |
my $borrowercategory=GetBorrowercategory($newdata{'categorycode'}); |
301 |
my $borrowercategory = Koha::Patron::Categories->find($newdata{categorycode}); |
301 |
my ($low,$high) = ($borrowercategory->{'dateofbirthrequired'}, $borrowercategory->{'upperagelimit'}); |
302 |
my ($low,$high) = ($borrowercategory->dateofbirthrequired, $borrowercategory->upperagelimit); |
302 |
if (($high && ($age > $high)) or ($age < $low)) { |
303 |
if (($high && ($age > $high)) or ($age < $low)) { |
303 |
push @errors, 'ERROR_age_limitations'; |
304 |
push @errors, 'ERROR_age_limitations'; |
304 |
$template->param( age_low => $low); |
305 |
$template->param( age_low => $low); |