X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcontact.html;h=5f02fef2f6e034cdf87446170b9251f196d1322e;hb=4be2393932dc2d49b78fa46f77e9040515c35d53;hp=44c864c162fe4c104b5aff61b7ca8b7c5e6ed0d5;hpb=f35818a77c0b825df553618f09c728c95cf3dc29;p=freeside.git diff --git a/httemplate/search/contact.html b/httemplate/search/contact.html index 44c864c16..5f02fef2f 100644 --- a/httemplate/search/contact.html +++ b/httemplate/search/contact.html @@ -24,10 +24,35 @@ my $addl_from = ''; my $email_sub = sub { my $contact = shift; - my @contact_email = $contact->contact_email; + #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; + my $phone_type = qsearchs('phone_type', { 'typename' => 'Work' }); + #can't because contactnum is in the wrong field + my @contact_workphone = qsearch('contact_phone', { 'contactnum' => $contact->contact_contactnum, 'phonetypenum' => $phone_type->phonetypenum } ); + join(', ', map $_->phonenum, @contact_workphone); +}; + +my $mobile_phone_sub = sub { + my $contact = shift; + my $phone_type = qsearchs('phone_type', { 'typename' => 'Mobile' }); + #can't because contactnum is in the wrong field + my @contact_mobilephone = qsearch('contact_phone', { 'contactnum' => $contact->contact_contactnum, 'phonetypenum' => $phone_type->phonetypenum } ); + join(', ', map $_->phonenum, @contact_mobilephone); +}; + +my $home_phone_sub = sub { + my $contact = shift; + my $phone_type = qsearchs('phone_type', { 'typename' => 'Home' }); + #can't because contactnum is in the wrong field + my @contact_homephone = qsearch('contact_phone', { 'contactnum' => $contact->contact_contactnum, 'phonetypenum' => $phone_type->phonetypenum } ); + 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; @@ -43,9 +68,9 @@ my $contact_classname_sub = sub { $X_contact->contact_classname; }; -my @header = ( 'First', 'Last', 'Title', 'Email', 'Type' ); -my @fields = ( 'first', 'last', 'title', $email_sub, $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 = '';