本文整理汇总了PHP中CRM_Core_Form::retrieve方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_Form::retrieve方法的具体用法?PHP CRM_Core_Form::retrieve怎么用?PHP CRM_Core_Form::retrieve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_Form
的用法示例。
在下文中一共展示了CRM_Core_Form::retrieve方法的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;
}