X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2Fcontact.html;h=1615dfab23d03af6d675d54dcdba29f8966031ca;hp=c3667df98c2c9e1c6cc972219080509be5e8a9bb;hb=d9a303be7f60e3cf54c7603e65861606c06045fd;hpb=ec7e8155fce544f19f2b6734476ed6db8c200aa9 diff --git a/httemplate/search/contact.html b/httemplate/search/contact.html index c3667df98..1615dfab2 100644 --- a/httemplate/search/contact.html +++ b/httemplate/search/contact.html @@ -22,6 +22,34 @@ push @select, map "contact.$_", qw( first last title ); my %hash = (); my $addl_from = ''; +my $email_sub = sub { + my $contact = shift; + #can't because contactnum is in the wrong field #my @contact_email = $contact->contact_email; + my @contact_email = qsearch('contact_email', { 'contactnum' => $contact->contact_contactnum } ); + join(', ', map $_->emailaddress, @contact_email); +}; + +my $work_phone_sub = sub { + my $contact = shift; + #can't because contactnum is in the wrong field + my @contact_workphone = qsearch('contact_phone', { 'contactnum' => $contact->contact_contactnum, 'phonetypenum' => '1' } ); + join(', ', map $_->phonenum, @contact_workphone); +}; + +my $mobile_phone_sub = sub { + my $contact = shift; + #can't because contactnum is in the wrong field + my @contact_mobilephone = qsearch('contact_phone', { 'contactnum' => $contact->contact_contactnum, 'phonetypenum' => '3' } ); + join(', ', map $_->phonenum, @contact_mobilephone); +}; + +my $home_phone_sub = sub { + my $contact = shift; + #can't because contactnum is in the wrong field + my @contact_homephone = qsearch('contact_phone', { 'contactnum' => $contact->contact_contactnum, 'phonetypenum' => '2' } ); + join(', ', map $_->phonenum, @contact_homephone); +}; + my $link; #for closure in this sub, we'll define it later my $contact_classname_sub = sub { my $contact = shift; @@ -37,9 +65,9 @@ my $contact_classname_sub = sub { $X_contact->contact_classname; }; -my @header = ( 'First', 'Last', 'Title', 'Type' ); -my @fields = ( 'first', 'last', 'title', $contact_classname_sub ); -my @links = ( '', '', '', '', ); +my @header = ( 'First', 'Last', 'Title', 'Email', 'Work Phone', 'Mobile Phone', 'Home Phone', 'Type' ); +my @fields = ( 'first', 'last', 'title', $email_sub, $work_phone_sub, $mobile_phone_sub, $home_phone_sub, $contact_classname_sub ); +my @links = ( '', '', '', '', '', '', '', '', ); my $company_link = '';