本文整理匯總了PHP中CRM_Core_Form::getActivities方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Core_Form::getActivities方法的具體用法?PHP CRM_Core_Form::getActivities怎麽用?PHP CRM_Core_Form::getActivities使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CRM_Core_Form
的用法示例。
在下文中一共展示了CRM_Core_Form::getActivities方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getCaseReport
/**
* @param int $clientID
* @param int $caseID
* @param string $activitySetName
* @param array $params
* @param CRM_Core_Form $form
*
* @return mixed
*/
public static function getCaseReport($clientID, $caseID, $activitySetName, $params, $form)
{
$template = CRM_Core_Smarty::singleton();
$template->assign('caseId', $caseID);
$template->assign('clientID', $clientID);
$template->assign('activitySetName', $activitySetName);
if (!empty($params['is_redact'])) {
$form->_isRedact = TRUE;
$template->assign('_isRedact', 'true');
} else {
$form->_isRedact = FALSE;
$template->assign('_isRedact', 'false');
}
// first get all case information
$case = $form->caseInfo($clientID, $caseID);
$template->assign_by_ref('case', $case);
if ($params['include_activities'] == 1) {
$template->assign('includeActivities', 'All');
} else {
$template->assign('includeActivities', 'Missing activities only');
}
$xml = $form->retrieve($case['caseTypeName']);
$activitySetNames = CRM_Case_XMLProcessor_Process::activitySets($xml->ActivitySets);
$pageTitle = CRM_Utils_Array::value($activitySetName, $activitySetNames);
$template->assign('pageTitle', $pageTitle);
if ($activitySetName) {
$activityTypes = $form->getActivityTypes($xml, $activitySetName);
} else {
$activityTypes = CRM_Case_XMLProcessor::allActivityTypes();
}
if (!$activityTypes) {
return FALSE;
}
// next get activity set Information
$activitySet = array('label' => $form->getActivitySetLabel($xml, $activitySetName), 'includeActivities' => 'All', 'redact' => 'false');
$template->assign_by_ref('activitySet', $activitySet);
//now collect all the information about activities
$activities = array();
$form->getActivities($clientID, $caseID, $activityTypes, $activities);
$template->assign_by_ref('activities', $activities);
// now run the template
$contents = $template->fetch('CRM/Case/XMLProcessor/Report.tpl');
return $contents;
}