本文整理汇总了PHP中CRM_Case_BAO_Case::getCaseSubject方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Case_BAO_Case::getCaseSubject方法的具体用法?PHP CRM_Case_BAO_Case::getCaseSubject怎么用?PHP CRM_Case_BAO_Case::getCaseSubject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Case_BAO_Case
的用法示例。
在下文中一共展示了CRM_Case_BAO_Case::getCaseSubject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: retrieve
/**
* Fetch object based on array of properties.
*
* @param array $params
* (reference ) an assoc array of name/value pairs.
* @param array $defaults
* (reference ) an assoc array to hold the flattened values.
*
* @return CRM_Activity_DAO_Activity
*/
public static function retrieve(&$params, &$defaults)
{
$activity = new CRM_Activity_DAO_Activity();
$activity->copyValues($params);
if ($activity->find(TRUE)) {
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
// TODO: at some stage we'll have to deal
// with multiple values for assignees and targets, but
// for now, let's just fetch first row.
$defaults['assignee_contact'] = CRM_Activity_BAO_ActivityContact::retrieveContactIdsByActivityId($activity->id, $assigneeID);
$assignee_contact_names = CRM_Activity_BAO_ActivityContact::getNames($activity->id, $assigneeID);
$defaults['assignee_contact_value'] = implode('; ', $assignee_contact_names);
$sourceContactId = self::getActivityContact($activity->id, $sourceID);
if ($activity->activity_type_id != CRM_Core_OptionGroup::getValue('activity_type', 'Bulk Email', 'name')) {
$defaults['target_contact'] = CRM_Activity_BAO_ActivityContact::retrieveContactIdsByActivityId($activity->id, $targetID);
$target_contact_names = CRM_Activity_BAO_ActivityContact::getNames($activity->id, $targetID);
$defaults['target_contact_value'] = implode('; ', $target_contact_names);
} elseif (CRM_Core_Permission::check('access CiviMail') || CRM_Mailing_Info::workflowEnabled() && CRM_Core_Permission::check('create mailings')) {
$defaults['mailingId'] = CRM_Utils_System::url('civicrm/mailing/report', "mid={$activity->source_record_id}&reset=1&atype={$activity->activity_type_id}&aid={$activity->id}&cid={$sourceContactId}&context=activity");
} else {
$defaults['target_contact_value'] = ts('(recipients)');
}
$sourceContactId = self::getActivityContact($activity->id, $sourceID);
$defaults['source_contact_id'] = $sourceContactId;
if ($sourceContactId && !CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $sourceContactId, 'is_deleted')) {
$defaults['source_contact'] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $sourceContactId, 'sort_name');
}
// Get case subject.
$defaults['case_subject'] = CRM_Case_BAO_Case::getCaseSubject($activity->id);
CRM_Core_DAO::storeValues($activity, $defaults);
return $activity;
}
return NULL;
}
示例2: retrieve
/**
* Takes a bunch of params that are needed to match certain criteria and
* retrieves the relevant objects. Typically the valid params are only
* contact_id. We'll tweak this function to be more full featured over a period
* of time. This is the inverse function of create. It also stores all the retrieved
* values in the default array
*
* @param array $params (reference ) an assoc array of name/value pairs
* @param array $defaults (reference ) an assoc array to hold the flattened values
* @param string $activityType activity type
*
* @return object CRM_Core_BAO_Meeting object
* @access public
*/
public function retrieve(&$params, &$defaults)
{
$activity =& new CRM_Activity_DAO_Activity();
$activity->copyValues($params);
if ($activity->find(true)) {
require_once "CRM/Contact/BAO/Contact.php";
// TODO: at some stage we'll have to deal
// TODO: with multiple values for assignees and targets, but
// TODO: for now, let's just fetch first row
$defaults['assignee_contact'] = CRM_Activity_BAO_ActivityAssignment::retrieveAssigneeIdsByActivityId($activity->id);
$assignee_contact_names = CRM_Activity_BAO_ActivityAssignment::getAssigneeNames($activity->id);
$defaults['assignee_contact_value'] = null;
foreach ($assignee_contact_names as $key => $name) {
$defaults['assignee_contact_value'] .= $defaults['assignee_contact_value'] ? "; {$name}" : "{$name}";
}
if ($activity->activity_type_id != CRM_Core_OptionGroup::getValue('activity_type', 'Bulk Email', 'name')) {
require_once 'CRM/Activity/BAO/ActivityTarget.php';
$defaults['target_contact'] = CRM_Activity_BAO_ActivityTarget::retrieveTargetIdsByActivityId($activity->id);
$target_contact_names = CRM_Activity_BAO_ActivityTarget::getTargetNames($activity->id);
$defaults['target_contact_value'] = null;
foreach ($target_contact_names as $key => $name) {
$defaults['target_contact_value'] .= $defaults['target_contact_value'] ? "; {$name}" : "{$name}";
}
} else {
if (CRM_Core_Permission::check('access CiviMail')) {
$defaults['mailingId'] = CRM_Utils_System::url('civicrm/mailing/report', "mid={$activity->source_record_id}&reset=1&atype={$activity->activity_type_id}&aid={$activity->id}&cid={$activity->source_contact_id}&context=activity");
} else {
$defaults['target_contact_value'] = ts('(recipients)');
}
}
if ($activity->source_contact_id) {
$defaults['source_contact'] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $activity->source_contact_id, 'sort_name');
}
//get case subject
require_once "CRM/Case/BAO/Case.php";
$defaults['case_subject'] = CRM_Case_BAO_Case::getCaseSubject($activity->id);
CRM_Core_DAO::storeValues($activity, $defaults);
return $activity;
}
return null;
}