X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Ftr-select-contact.html;h=4eb8a9879afbea1165b2609cf117f58c6d118c1b;hp=579117808b1521b8f2d216e5bff55820a0d4dc47;hb=3f2a7b01b59902faed5767d81e2959e131bdbdfd;hpb=2e761a72c380dc9d7320ccd822cfe8476534b369 diff --git a/httemplate/elements/tr-select-contact.html b/httemplate/elements/tr-select-contact.html index 579117808..4eb8a9879 100644 --- a/httemplate/elements/tr-select-contact.html +++ b/httemplate/elements/tr-select-contact.html @@ -138,8 +138,8 @@ if ( $cgi->param('error') ) { if ( length($opt{'curr_value'}) ) { $contactnum = $opt{'curr_value'}; } elsif ($prospect_main) { - my @cust_contact = $prospect_main->cust_contact; - $contactnum = $cust_contact[0]->contactnum if scalar(@cust_contact)==1; + my @prospect_contact = $prospect_main->prospect_contact; + $contactnum = $prospect_contact[0]->contactnum if scalar(@prospect_contact)==1; } else { #$cust_main $cgi->param('contactnum') =~ /^(\-?\d*)$/ or die "illegal contactnum"; $contactnum = $1; @@ -162,7 +162,7 @@ if ( $contactnum && $contactnum > 0 ) { if ( $contactnum == -1 ) { $contact->$_( $cgi->param($_) ) foreach @contact_fields; #XXX } elsif ( $cust_pkg && $cust_pkg->contactnum ) { - my $pkg_contact = $cust_pkg->contact; + my $pkg_contact = $cust_pkg->contact_obj; $contact->$_( $pkg_contact->$_ ) foreach @contact_fields; #XXX why are we making a new one gagain?? $opt{'empty_label'} ||= 'package contact: '.$pkg_contact->line; } elsif ( $cust_main ) { @@ -176,8 +176,10 @@ my $contact_sort = sub { }; my @contact; -push @contact, $cust_main->cust_contact if $cust_main; -push @contact, $prospect_main->contact if $prospect_main; +push @contact, map $_->contact, $cust_main->cust_contact + if $cust_main; +push @contact, map $_->contact, $prospect_main->prospect_contact + if $prospect_main; push @contact, $contact if !$cust_main && $contact && $contact->contactnum > 0 && ! grep { $_->contactnum == $contact->contactnum } @contact;