/** * Run the page. * * This method is called after the page is created. * * @return void * @access public * */ function run() { // get the emails for this contact $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST); $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', array('labelColumn' => 'display_name')); $IMProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id'); $entityBlock = array('contact_id' => $contactId); $ims = CRM_Core_BAO_IM::getValues($entityBlock); if (!empty($ims)) { foreach ($ims as $key => &$value) { $value['location_type'] = $locationTypes[$value['location_type_id']]; $value['provider'] = $IMProviders[$value['provider_id']]; } } $this->assign('contactId', $contactId); $this->assign('im', $ims); // check logged in user permission CRM_Contact_Page_View::checkUserPermission($this, $contactId); // finally call parent parent::run(); }
/** * simple helper function to dispatch getCall to lower comm blocks */ function getBlocks(&$params, &$values, &$ids, $blockCount = 0, &$parent) { $parent->address =& CRM_Core_BAO_Address::getValues($params, $values, $ids, $blockCount); $parent->phone =& CRM_Core_BAO_Phone::getValues($params, $values, $ids, $blockCount); $parent->email =& CRM_Core_BAO_Email::getValues($params, $values, $ids, $blockCount); $parent->im =& CRM_Core_BAO_IM::getValues($params, $values, $ids, $blockCount); }