|
Lines 103-109
my @relations = split /\|/, C4::Context->preference('borrowerRelationship'), -1;
Link Here
|
| 103 |
my $empty_relationship_allowed = grep {$_ eq ""} @relations; |
103 |
my $empty_relationship_allowed = grep {$_ eq ""} @relations; |
| 104 |
$template->param( empty_relationship_allowed => $empty_relationship_allowed ); |
104 |
$template->param( empty_relationship_allowed => $empty_relationship_allowed ); |
| 105 |
|
105 |
|
| 106 |
my $guarantor_id = $input->param('guarantor_id'); |
106 |
my $guarantorinfo = $input->param('guarantorinfo'); |
|
|
107 |
my $guarantor_id = $input->param('new_guarantor_id'); |
| 107 |
my $guarantor = undef; |
108 |
my $guarantor = undef; |
| 108 |
$guarantor = Koha::Patrons->find( $guarantor_id ) if $guarantor_id; |
109 |
$guarantor = Koha::Patrons->find( $guarantor_id ) if $guarantor_id; |
| 109 |
$template->param( guarantor => $guarantor ); |
110 |
$template->param( guarantor => $guarantor ); |
|
Lines 279-284
if ( ( $op eq 'insert' ) and !$nodouble ) {
Link Here
|
| 279 |
} |
280 |
} |
| 280 |
} |
281 |
} |
| 281 |
|
282 |
|
|
|
283 |
if ( $guarantor_id ) { |
| 284 |
if (my $guarantor = Koha::Patrons->find( $guarantor_id )) { |
| 285 |
my $guarantor_category = $guarantor->category->category_type; |
| 286 |
push @errors, 'ERROR_guarantor_is_guarantee' if ( ($guarantor_category eq 'C') && |
| 287 |
($op eq 'save' || $op eq 'insert') ); |
| 288 |
} |
| 289 |
} |
| 290 |
|
| 291 |
my $valid_guarantor = $guarantor_id ? $guarantor_id : $newdata{'contactname'}; |
| 292 |
|
| 293 |
if($category_type eq 'C' && ($op eq 'save' || $op eq 'insert') && C4::Context->preference('ChildNeedsGuarantor')){ |
| 294 |
if(!$valid_guarantor){ |
| 295 |
push @errors, 'ERROR_child_no_guarantor'; |
| 296 |
} |
| 297 |
} |
| 298 |
|
| 282 |
###############test to take the right zipcode, country and city name ############## |
299 |
###############test to take the right zipcode, country and city name ############## |
| 283 |
# set only if parameter was passed from the form |
300 |
# set only if parameter was passed from the form |
| 284 |
$newdata{'city'} = $input->param('city') if defined($input->param('city')); |
301 |
$newdata{'city'} = $input->param('city') if defined($input->param('city')); |
| 285 |
- |
|
|