本文整理汇总了PHP中Workflow::getStageCounts方法的典型用法代码示例。如果您正苦于以下问题:PHP Workflow::getStageCounts方法的具体用法?PHP Workflow::getStageCounts怎么用?PHP Workflow::getStageCounts使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Workflow
的用法示例。
在下文中一共展示了Workflow::getStageCounts方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderFunnelView
/**
* Render funnel for workflow view
*/
public function renderFunnelView($workflowId, $dateRange, $expectedCloseDateDateRange, $users = '', $modelId = 0, $modelType = '')
{
$workflowStatus = Workflow::getWorkflowStatus($workflowId, $modelId, $modelType);
$stageCounts = Workflow::getStageCounts($workflowStatus, $dateRange, $expectedCloseDateDateRange, $users, $modelType);
$model = $this->loadModel($workflowId);
$colors = $model->getWorkflowStageColors(sizeof($stageCounts));
$stageValues = Workflow::getStageValues($model, $users, $modelType, $dateRange, $expectedCloseDateDateRange);
$stageNameLinks = Workflow::getStageNameLinks($workflowStatus, $dateRange, $expectedCloseDateDateRange, $users);
$this->renderPartial('_funnel', array('workflowStatus' => $workflowStatus, 'recordsPerStage' => $stageCounts, 'stageCount' => sizeof($stageCounts), 'stageValues' => array_map(function ($a) {
return Formatter::formatCurrency($a[1]);
}, $stageValues), 'totalValue' => Formatter::formatCurrency(array_reduce($stageValues, function ($a, $b) {
return $a + $b[1];
}, 0)), 'stageNameLinks' => $stageNameLinks, 'colors' => $colors));
}
示例2: getDragAndDropViewParams
private function getDragAndDropViewParams($id, $users = '')
{
$model = $this->loadModel($id);
$modelType = isset($_GET['modelType']) ? $_GET['modelType'] : 'contacts';
$dateRange = self::getDateRange();
$expectedCloseDateDateRange = self::getDateRange('expectedCloseDateStart', 'expectedCloseDateEnd', 'expectedCloseDateRange');
$memberListContainerSelectors = array();
$stageCount = count($model->stages);
for ($i = 1; $i <= $stageCount; $i++) {
$memberListContainerSelectors[] = '#workflow-stage-' . $i . ' .items';
}
$workflowStatus = Workflow::getWorkflowStatus($id);
$stagePermissions = Workflow::getStagePermissions($workflowStatus);
$stagesWhichRequireComments = Workflow::getStageCommentRequirements($workflowStatus);
$stageNames = Workflow::getStageNames($workflowStatus);
$colors = $model->getWorkflowStageColors($stageCount, true);
$stageCounts = Workflow::getStageCounts($workflowStatus, $dateRange, $expectedCloseDateDateRange, $users, $modelType);
return array('model' => $model, 'modelType' => $modelType, 'dateRange' => $dateRange, 'expectedCloseDateDateRange' => $expectedCloseDateDateRange, 'users' => $users, 'colors' => $colors, 'listItemColors' => Workflow::getPipelineListItemColors($colors), 'memberListContainerSelectors' => $memberListContainerSelectors, 'stagePermissions' => $stagePermissions, 'stagesWhichRequireComments' => $stagesWhichRequireComments, 'stageNames' => $stageNames, 'stageCounts' => $stageCounts);
}
示例3: assertDataProviderCountMatchesStageCount
private function assertDataProviderCountMatchesStageCount($workflow, $workflowStatus, $stageNumber)
{
$counts = Workflow::getStageCounts($workflowStatus, array('start' => 0, 'end' => time(), 'workflowId' => $workflow->id));
X2_TEST_DEBUG_LEVEL > 1 && print_r($counts);
$_SERVER['REQUEST_METHOD'] = 'POST';
$_SERVER['SERVER_NAME'] = 'localhost';
$controllerName = 'WorkflowController';
$moduleName = 'WorkflowModule';
Yii::app()->controller = new $controllerName('Workflow', new $moduleName('Workflow', null));
$contactsDataProvider = Yii::app()->controller->getStageMemberDataProvider('contacts', $workflow->id, array('start' => 0, 'end' => time(), 'workflowId' => $workflow->id), $stageNumber, '');
// ensure that number of record in dataproviders matches count
// stage 0 should have no records in it
$this->assertEquals($counts[$stageNumber - 1], count($contactsDataProvider->data));
return $counts;
}
示例4: getDragAndDropViewParams
private function getDragAndDropViewParams($id, $users = '')
{
$model = $this->loadModel($id);
if (isset($_GET['modelType'])) {
$modelType = $_GET['modelType'];
} elseif (!empty($model->financialModel)) {
if (X2Model::getModelName($model->financialModel)) {
$modelType = $model->financialModel;
} else {
$modelType = 'contacts';
}
} else {
$modelType = 'contacts';
}
$dateRange = self::getDateRange();
$memberListContainerSelectors = array();
$stageCount = count($model->stages);
for ($i = 1; $i <= $stageCount; $i++) {
$memberListContainerSelectors[] = '#workflow-stage-' . $i . ' .items';
}
$workflowStatus = Workflow::getWorkflowStatus($id);
$stagePermissions = Workflow::getStagePermissions($workflowStatus);
$stagesWhichRequireComments = Workflow::getStageCommentRequirements($workflowStatus);
$stageNames = Workflow::getStageNames($workflowStatus);
$colors = $model->getWorkflowStageColors($stageCount, true);
$stageCounts = Workflow::getStageCounts($workflowStatus, $dateRange, $users, $modelType);
$stageValues = Workflow::getStageValues($workflowStatus, $dateRange, $users, $modelType);
return array('model' => $model, 'modelType' => $modelType, 'dateRange' => $dateRange, 'users' => $users, 'colors' => $colors, 'listItemColors' => Workflow::getPipelineListItemColors($colors), 'memberListContainerSelectors' => $memberListContainerSelectors, 'stagePermissions' => $stagePermissions, 'stagesWhichRequireComments' => $stagesWhichRequireComments, 'stageNames' => $stageNames, 'stageCounts' => $stageCounts, 'stageValues' => $stageValues);
}