当前位置: 首页>>代码示例>>PHP>>正文


PHP Workflow::getStageCounts方法代码示例

本文整理汇总了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));
 }
开发者ID:shuvro35,项目名称:X2CRM,代码行数:17,代码来源:WorkflowController.php

示例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);
 }
开发者ID:dsyman2,项目名称:X2CRM,代码行数:19,代码来源:WorkflowController.php

示例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;
 }
开发者ID:tymiles003,项目名称:X2CRM,代码行数:15,代码来源:WorkflowTest.php

示例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);
 }
开发者ID:tymiles003,项目名称:X2CRM,代码行数:29,代码来源:WorkflowController.php


注:本文中的Workflow::getStageCounts方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。