Lines 106-113
my $userenv = C4::Context->userenv;
Link Here
|
106 |
|
106 |
|
107 |
## Deal with guarantor stuff |
107 |
## Deal with guarantor stuff |
108 |
$template->param( relationships => scalar $patron->guarantor_relationships ) if $patron; |
108 |
$template->param( relationships => scalar $patron->guarantor_relationships ) if $patron; |
109 |
|
109 |
my $guarantorinfo = $input->param('guarantorinfo'); |
110 |
my $guarantor_id = $input->param('guarantor_id'); |
110 |
my $guarantor_id = $input->param('new_guarantor_id'); |
111 |
my $guarantor = undef; |
111 |
my $guarantor = undef; |
112 |
$guarantor = Koha::Patrons->find( $guarantor_id ) if $guarantor_id; |
112 |
$guarantor = Koha::Patrons->find( $guarantor_id ) if $guarantor_id; |
113 |
$template->param( guarantor => $guarantor ); |
113 |
$template->param( guarantor => $guarantor ); |
Lines 263-268
if ( ( $op eq 'insert' ) and !$nodouble ) {
Link Here
|
263 |
$check_member = $patrons->next->borrowernumber; |
263 |
$check_member = $patrons->next->borrowernumber; |
264 |
} |
264 |
} |
265 |
} |
265 |
} |
|
|
266 |
|
267 |
if ( $guarantor_id ) { |
268 |
if (my $guarantor = Koha::Patrons->find( $guarantor_id )) { |
269 |
my $guarantor_category = $guarantor->category->category_type; |
270 |
push @errors, 'ERROR_guarantor_is_guarantee' if ( ($guarantor_category eq 'C') && |
271 |
($op eq 'save' || $op eq 'insert') ); |
272 |
} |
273 |
} |
274 |
|
275 |
my $valid_guarantor = $guarantor_id ? $guarantor_id : $newdata{'contactname'}; |
276 |
|
277 |
if($category_type eq 'C' && ($op eq 'save' || $op eq 'insert') && C4::Context->preference('ChildNeedsGuarantor')){ |
278 |
if(!$valid_guarantor){ |
279 |
push @errors, 'ERROR_child_no_guarantor'; |
280 |
} |
281 |
} |
266 |
|
282 |
|
267 |
###############test to take the right zipcode, country and city name ############## |
283 |
###############test to take the right zipcode, country and city name ############## |
268 |
# set only if parameter was passed from the form |
284 |
# set only if parameter was passed from the form |
269 |
- |
|
|