本文整理汇总了PHP中CRM_Contact_BAO_Contact::displayname方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contact_BAO_Contact::displayname方法的具体用法?PHP CRM_Contact_BAO_Contact::displayname怎么用?PHP CRM_Contact_BAO_Contact::displayname使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Contact_BAO_Contact
的用法示例。
在下文中一共展示了CRM_Contact_BAO_Contact::displayname方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preProcess
/**
* Build all the data structures needed to build the form.
*/
public function preProcess()
{
// Initialize the task and row fields.
parent::preProcess();
// Get the contact read only fields to display.
$readOnlyFields = array_merge(array('sort_name' => ts('Added By'), 'target_sort_name' => ts('With Contact')), CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'contact_autocomplete_options', TRUE, NULL, FALSE, 'name', TRUE));
// Get the read only field data.
$returnProperties = array_fill_keys(array_keys($readOnlyFields), 1);
$contactDetails = CRM_Contact_BAO_Contact_Utils::contactDetails($this->_activityHolderIds, 'Activity', $returnProperties);
$readOnlyFields['assignee_display_name'] = ts('Assigned to');
if (!empty($contactDetails)) {
foreach ($contactDetails as $key => $value) {
$assignee = CRM_Activity_BAO_ActivityAssignment::retrieveAssigneeIdsByActivityId($key);
foreach ($assignee as $keys => $values) {
$assigneeContact[] = CRM_Contact_BAO_Contact::displayname($values);
}
$contactDetails[$key]['assignee_display_name'] = !empty($assigneeContact) ? implode(';', $assigneeContact) : NULL;
}
}
$this->assign('contactDetails', $contactDetails);
$this->assign('readOnlyFields', $readOnlyFields);
}