Refactored Contact Page Summary tab to use CRM_Core_DAO::buildOptions() method. CRM...
authorAllen Shaw <allen@emphanos.com>
Sat, 4 May 2013 21:33:41 +0000 (14:33 -0700)
committerColeman Watts <coleman@civicrm.org>
Thu, 30 May 2013 05:14:04 +0000 (22:14 -0700)
----------------------------------------
* CRM-12464: Search improvements in 4.4
  http://issues.civicrm.org/jira/browse/CRM-12464

CRM/Contact/Page/View/Summary.php

index 17b2c1d65436701b8c3ef63cf90326213c0347fc..94154ef9f9136359be267006b03c77b272823017 100644 (file)
@@ -153,14 +153,20 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View {
       'phone' => array(
         'type' => 'phoneType',
         'id' => 'phone_type',
+        'daoName' => 'CRM_Core_DAO_Phone',
+        'fieldName' => 'phone_type_id',
       ),
       'im' => array(
         'type' => 'IMProvider',
         'id' => 'provider',
+        'daoName' => 'CRM_Core_DAO_IM',
+        'fieldName' => 'provider_id',
       ),
       'website' => array(
         'type' => 'websiteType',
         'id' => 'website_type',
+        'daoName' => 'CRM_Core_DAO_Website',
+        'fieldName' => 'website_type_id',
       ),
       'address' => array('skip' => TRUE, 'customData' => 1),
       'email' => array('skip' => TRUE),
@@ -172,7 +178,8 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View {
         foreach ($defaults[$key] as & $val) {
           CRM_Utils_Array::lookupValue($val, 'location_type', CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', array('labelColumn' => 'display_name')), FALSE);
           if (!CRM_Utils_Array::value('skip', $value)) {
-            eval('$pseudoConst = CRM_Core_PseudoConstant::' . $value['type'] . '();');
+            $daoName = $value['daoName'];
+            $pseudoConst = $daoName::buildOptions($value['fieldName'], 'view');
             CRM_Utils_Array::lookupValue($val, $value['id'], $pseudoConst, FALSE);
           }
         }