[freeside-commits] branch master updated. 4be2393932dc2d49b78fa46f77e9040515c35d53

Christopher Burger burgerc at 420.am
Tue Sep 26 10:44:31 PDT 2017


The branch, master has been updated
       via  4be2393932dc2d49b78fa46f77e9040515c35d53 (commit)
      from  ee2fb1a8744b88d699517ed636ab3cb1b99c53f0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4be2393932dc2d49b78fa46f77e9040515c35d53
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Tue Sep 26 13:43:31 2017 -0400

    RT# 77532 - fixed search to use phone type from database

diff --git a/httemplate/search/contact.html b/httemplate/search/contact.html
index 1615dfa..5f02fef 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);
 };
 

-----------------------------------------------------------------------

Summary of changes:
 httemplate/search/contact.html |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)




More information about the freeside-commits mailing list