summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2017-09-26 13:43:31 -0400
committerChristopher Burger <burgerc@freeside.biz>2018-06-12 15:57:29 -0400
commit98d614173c61436e5637b61bc93ce0fa2e1ecc4e (patch)
treedb7a82696a3f329949dbbc3d64d4442291109bf1
parentdee7d649620b848812547b7bc0d86f12d29570a4 (diff)
RT# 77532 - fixed search to use phone type from database
-rw-r--r--httemplate/search/contact.html9
1 files changed, 6 insertions, 3 deletions
diff --git a/httemplate/search/contact.html b/httemplate/search/contact.html
index 1615dfab2..5f02fef2f 100644
--- a/httemplate/search/contact.html
+++ b/httemplate/search/contact.html
@@ -31,22 +31,25 @@ my $email_sub = sub {
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' => '1' } );
+ 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' => '3' } );
+ 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' => '2' } );
+ my @contact_homephone = qsearch('contact_phone', { 'contactnum' => $contact->contact_contactnum, 'phonetypenum' => $phone_type->phonetypenum } );
join(', ', map $_->phonenum, @contact_homephone);
};