本文整理汇总了PHP中Workflow::getStageValues方法的典型用法代码示例。如果您正苦于以下问题:PHP Workflow::getStageValues方法的具体用法?PHP Workflow::getStageValues怎么用?PHP Workflow::getStageValues使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Workflow
的用法示例。
在下文中一共展示了Workflow::getStageValues方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetStageValues
/**
* Basic test for get stage values
*/
public function testGetStageValues()
{
$workflow = $this->workflows('workflow2');
$workflowStatus = Workflow::getWorkflowStatus($workflow->id);
$contact = $this->contacts('contact935');
$values = Workflow::getStageValues($workflowStatus, array('start' => 0, 'end' => time(), 'workflowId' => $workflow->id));
//Workflow only has one contact, and it is in the 4th stage
$this->assertEquals(0, $values[0]);
$this->assertEquals(0, $values[1]);
$this->assertEquals(0, $values[2]);
$this->assertEquals($contact->dealvalue, $values[3]);
$workflow = $this->workflows('workflow3');
$workflowStatus = Workflow::getWorkflowStatus($workflow->id);
$values = Workflow::getStageValues($workflowStatus, array('start' => 0, 'end' => time(), 'workflowId' => $workflow->id));
//Non-financial workflow should have null values
$this->assertNull($values[0]);
$this->assertNull($values[1]);
$this->assertNull($values[2]);
$this->assertNull($values[3]);
}
示例2: getDragAndDropViewParams
private function getDragAndDropViewParams($id, $users = '')
{
$model = $this->loadModel($id);
$modelType = isset($_GET['modelType']) ? self::parseModelType($_GET['modelType']) : '';
$dateRange = self::getDateRange();
$expectedCloseDateDateRange = self::getDateRange('expectedCloseDateStart', 'expectedCloseDateEnd', 'expectedCloseDateRange');
$memberListContainerSelectors = array();
$stageValues = Workflow::getStageValues($model, $users, $modelType, $dateRange, $expectedCloseDateDateRange);
$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);
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, 'stageValues' => $stageValues);
}
示例3: 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);
}