View | Details | Raw Unified | Return to bug 4415
Collapse All | Expand All

(-)a/members/memberentry.pl (-13 / +12 lines)
Lines 211-223 if ( ( $op eq 'insert' ) and !$nodouble ) { Link Here
211
if ( $guarantorid and ( $category_type eq 'C' || $category_type eq 'P' )) {
211
if ( $guarantorid and ( $category_type eq 'C' || $category_type eq 'P' )) {
212
    if (my $guarantordata=GetMember(borrowernumber => $guarantorid)) {
212
    if (my $guarantordata=GetMember(borrowernumber => $guarantorid)) {
213
        $guarantorinfo=$guarantordata->{'surname'}." , ".$guarantordata->{'firstname'};
213
        $guarantorinfo=$guarantordata->{'surname'}." , ".$guarantordata->{'firstname'};
214
        if ( !defined($data{'contactname'}) or $data{'contactname'} eq '' or
214
        $newdata{'contactfirstname'}= $guarantordata->{'firstname'};
215
             $data{'contactname'} ne $guarantordata->{'surname'} ) {
215
        $newdata{'contactname'}     = $guarantordata->{'surname'};
216
            $newdata{'contactfirstname'}= $guarantordata->{'firstname'};
216
        $newdata{'contacttitle'}    = $guarantordata->{'title'};
217
            $newdata{'contactname'}     = $guarantordata->{'surname'};
217
        if ( $op eq 'add' ) {
218
            $newdata{'contacttitle'}    = $guarantordata->{'title'};
219
	        foreach (qw(streetnumber address streettype address2
218
	        foreach (qw(streetnumber address streettype address2
220
                        zipcode country city phone phonepro mobile fax email emailpro branchcode)) {
219
                        zipcode country city state phone phonepro mobile fax email emailpro branchcode
220
                        B_streetnumber B_streettype B_address B_address2
221
                        B_city B_state B_zipcode B_country B_email B_phone)) {
221
		        $newdata{$_} = $guarantordata->{$_};
222
		        $newdata{$_} = $guarantordata->{$_};
222
	        }
223
	        }
223
        }
224
        }
Lines 225-236 if ( $guarantorid and ( $category_type eq 'C' || $category_type eq 'P' )) { Link Here
225
}
226
}
226
227
227
###############test to take the right zipcode, country and city name ##############
228
###############test to take the right zipcode, country and city name ##############
228
if (!defined($guarantorid) or $guarantorid eq '' or $guarantorid eq '0') {
229
# set only if parameter was passed from the form
229
    # set only if parameter was passed from the form
230
$newdata{'city'}    = $input->param('city')    if defined($input->param('city'));
230
    $newdata{'city'}    = $input->param('city')    if defined($input->param('city'));
231
$newdata{'zipcode'} = $input->param('zipcode') if defined($input->param('zipcode'));
231
    $newdata{'zipcode'} = $input->param('zipcode') if defined($input->param('zipcode'));
232
$newdata{'country'} = $input->param('country') if defined($input->param('country'));
232
    $newdata{'country'} = $input->param('country') if defined($input->param('country'));
233
}
234
233
235
#builds default userid
234
#builds default userid
236
if ( (defined $newdata{'userid'}) && ($newdata{'userid'} eq '')){
235
if ( (defined $newdata{'userid'}) && ($newdata{'userid'} eq '')){
Lines 677-683 $template->param(CGIbranch=>$CGIbranch) if ($CGIbranch); Link Here
677
$template->param(
676
$template->param(
678
  nodouble  => $nodouble,
677
  nodouble  => $nodouble,
679
  borrowernumber  => $borrowernumber, #register number
678
  borrowernumber  => $borrowernumber, #register number
680
  guarantorid => (($borrower_data->{'guarantorid'})) ? $borrower_data->{'guarantorid'} : $guarantorid,
679
  guarantorid => ($borrower_data->{'guarantorid'} || $guarantorid),
681
  ethcatpopup => $ethcatpopup,
680
  ethcatpopup => $ethcatpopup,
682
  relshiploop => \@relshipdata,
681
  relshiploop => \@relshipdata,
683
  city_loop => $city_arrayref,
682
  city_loop => $city_arrayref,
(-)a/members/moremember.pl (-7 lines)
Lines 157-168 $data->{ "sex_".$data->{'sex'}."_p" } = 1; Link Here
157
157
158
my $catcode;
158
my $catcode;
159
if ( $category_type eq 'C') {
159
if ( $category_type eq 'C') {
160
	if ($data->{guarantorid} ) {
161
    	my $data2 = GetMember( 'borrowernumber' => $data->{'guarantorid'} );
162
    	foreach (qw(address address2 city state B_address B_address2 B_city B_state phone mobile zipcode B_zipcode country B_country)) {
163
    	    $data->{$_} = $data2->{$_};
164
    	}
165
   }
166
   my  ( $catcodes, $labels ) =  GetborCatFromCatType( 'A', 'WHERE category_type = ?' );
160
   my  ( $catcodes, $labels ) =  GetborCatFromCatType( 'A', 'WHERE category_type = ?' );
167
   my $cnt = scalar(@$catcodes);
161
   my $cnt = scalar(@$catcodes);
168
162
169
- 

Return to bug 4415