my $name_city=$input->param('name_city');
my $nodouble=$input->param('nodouble');
my $select_city=$input->param('select_city');
-my $zipcode=$input->param('zipcode');
-my $city=$input->param('city');
my $nok=$input->param('nok');
my $guarantorinfo=$input->param('guarantorinfo');
my $step=$input->param('step') || 0;
my $guarantordata=GetMember($guarantorid);
$guarantorinfo=$guarantordata->{'surname'}." , ".$guarantordata->{'firstname'};
if (($data{'contactname'} eq '' or $data{'contactname'} ne $guarantordata->{'surname'})) {
- $data{'contactfirstname'}= $guarantordata->{'firstname'};
+ $data{'contactfirstname'}= $guarantordata->{'firstname'};
$data{'contactname'} = $guarantordata->{'surname'};
- $data{'contacttitle'} = $guarantordata->{'title'};
+ $data{'contacttitle'} = $guarantordata->{'title'};
foreach (qw(streetnumber address streettype address2 zipcode city phone phonepro mobile fax email emailpro branchcode)) {
$data{$_} = $guarantordata->{$_};
}
}
###############test to take the right zipcode and city name ##############
-if ( $guarantorid eq ''){
- $newdata{'city'}= $city;
- $newdata{'zipcode'}=$zipcode;
+if ($guarantorid eq '') {
+ # set only if parameter was passed from the form
+ $newdata{'city'} = $input->param('city') if defined($input->param('city'));
+ $newdata{'zipcode'} = $input->param('zipcode') if defined($input->param('zipcode'));
}
#builds default userid
}
my @typeloop;
-foreach ( ($category_type) ? ($category_type) : qw(C A S P I X)){
- my $action="WHERE category_type=?";
+foreach (qw(C A S P I X)) {
+ my $action="WHERE category_type=?";
($categories,$labels)=GetborCatFromCatType($_,$action);
my @categoryloop;
foreach my $cat (@$categories){
$template->param( city_cgipopup => 1) if ($cityid );
my $citypopup = CGI::popup_menu(-name=>'select_city',
-id => 'select_city',
- -values=>$name_city,
+ '-values' =>$cityid,
-labels=>$name_city,
-default=>$default_city,
);
nodouble => $nodouble,
borrowernumber => $borrowernumber,#register number
"contacttitle_".$data{'contacttitle'} => "SELECTED" ,
- guarantorid => $guarantorid,
+ guarantorid => $borrower_data ? $borrower_data->{'guarantorid'} : $guarantorid,
ethcatpopup => $ethcatpopup,
relshiploop => \@relshipdata,
citypopup => $citypopup,