From 365cc343aae3bd809b15807f769ef3a9ae2ddf06 Mon Sep 17 00:00:00 2001 From: Allen Shaw Date: Sat, 4 May 2013 14:33:41 -0700 Subject: [PATCH] Refactored Contact Page Summary tab to use CRM_Core_DAO::buildOptions() method. CRM-12464 ---------------------------------------- * CRM-12464: Search improvements in 4.4 http://issues.civicrm.org/jira/browse/CRM-12464 --- CRM/Contact/Page/View/Summary.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/Page/View/Summary.php b/CRM/Contact/Page/View/Summary.php index 17b2c1d654..94154ef9f9 100644 --- a/CRM/Contact/Page/View/Summary.php +++ b/CRM/Contact/Page/View/Summary.php @@ -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); } } -- 2.25.1