當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Workflow::getStages方法代碼示例

本文整理匯總了PHP中Workflow::getStages方法的典型用法代碼示例。如果您正苦於以下問題:PHP Workflow::getStages方法的具體用法?PHP Workflow::getStages怎麽用?PHP Workflow::getStages使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Workflow的用法示例。


在下文中一共展示了Workflow::getStages方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: paramRules

 public function paramRules()
 {
     $workflows = Workflow::getList(false);
     // no "none" options
     $workflowIds = array_keys($workflows);
     $stages = count($workflowIds) ? Workflow::getStages($workflowIds[0]) : array('---');
     return array('title' => Yii::t('studio', $this->title), 'modelRequired' => 1, 'options' => array(array('name' => 'workflowId', 'label' => 'Workflow', 'type' => 'dropdown', 'options' => $workflows), array('name' => 'stageNumber', 'label' => 'Stage', 'type' => 'dropdown', 'options' => $stages)));
 }
開發者ID:dsyman2,項目名稱:X2CRM,代碼行數:8,代碼來源:X2FlowWorkflowComplete.php

示例2: actionGetWorkflowStages

 /**
  * A method to echo a dropdown of workflow stages.
  *
  * This method is called via AJAX request and echoes back a dropdown with
  * options consisting of all stages for a particular workflow.
  */
 public function actionGetWorkflowStages()
 {
     if (isset($_POST['workflow'])) {
         $id = $_POST['workflow'];
         $stages = Workflow::getStages($id);
         foreach ($stages as $key => $value) {
             echo CHtml::tag('option', array('value' => $key + 1), CHtml::encode($value), true);
         }
     } else {
         echo CHtml::tag('option', array('value' => ''), CHtml::encode(var_dump($_POST)), true);
     }
 }
開發者ID:xl602,項目名稱:X2CRM,代碼行數:18,代碼來源:AdminController.php

示例3: getText


//.........這裏部分代碼省略.........
             if (count(X2Model::model($this->associationType)->findAllByPk($this->associationId)) > 0) {
                 $text = Yii::t('app', "A new web lead has come in: {modelLink}", array('{modelLink}' => X2Model::getModelLink($this->associationId, $this->associationType)));
             } else {
                 $deletionEvent = X2Model::model('Events')->findByAttributes(array('type' => 'record_deleted', 'associationType' => $this->associationType, 'associationId' => $this->associationId));
                 if (isset($deletionEvent)) {
                     $text = Yii::t('app', "A new web lead has come in: {deletionText}. It has been deleted.", array('{deletionText}' => $deletionEvent->text));
                 } else {
                     $text = Yii::t('app', "A new web lead has come in, but it could not be found.");
                 }
             }
             break;
         case 'record_deleted':
             if (class_exists($this->associationType)) {
                 if (Yii::app()->params->profile !== null && Yii::app()->params->profile->language != 'en' && !empty(Yii::app()->params->profile->language) || Yii::app()->params->profile === null && Yii::app()->language !== 'en' || strpos($this->associationType, 'A') !== 0 && strpos($this->associationType, 'E') !== 0 && strpos($this->associationType, 'I') !== 0 && strpos($this->associationType, 'O') !== 0 && strpos($this->associationType, 'U') !== 0) {
                     if (!empty($authorText)) {
                         $text = $authorText . Yii::t('app', "deleted a {modelType}, {text}", array('{modelType}' => Events::parseModelName($this->associationType), '{text}' => $this->text));
                     } else {
                         $text = Yii::t('app', "A {modelType}, {text}, was deleted", array('{modelType}' => Events::parseModelName($this->associationType), '{text}' => $this->text));
                     }
                 } else {
                     if (!empty($authorText)) {
                         $text = $authorText . Yii::t('app', "deleted an {modelType}, {text}.", array('{modelType}' => Events::parseModelName($this->associationType), '{text}' => $this->text));
                     } else {
                         $text = Yii::t('app', "An {modelType}, {text}, was deleted.", array('{modelType}' => Events::parseModelName($this->associationType), '{text}' => $this->text));
                     }
                 }
             }
             break;
         case 'workflow_start':
             $action = X2Model::model('Actions')->findByPk($this->associationId);
             if (isset($action)) {
                 $record = X2Model::model(ucfirst($action->associationType))->findByPk($action->associationId);
                 if (isset($record)) {
                     $stages = Workflow::getStages($action->workflowId);
                     if (isset($stages[$action->stageNumber - 1])) {
                         $text = $authorText . Yii::t('app', 'started the process stage "{stage}" for the {modelName} {modelLink}', array('{stage}' => $stages[$action->stageNumber - 1], '{modelName}' => Events::parseModelName($action->associationType), '{modelLink}' => X2Model::getModelLink($action->associationId, $action->associationType)));
                     } else {
                         $text = $authorText . Yii::t('app', "started a process stage for the {modelName} {modelLink}, but the process stage could not be found.", array('{modelName}' => Events::parseModelName($action->associationType), '{modelLink}' => X2Model::getModelLink($action->associationId, $action->associationType)));
                     }
                 } else {
                     $text = $authorText . Yii::t('app', "started a process stage, but the associated {modelName} was not found.", array('{modelName}' => Events::parseModelName($action->associationType)));
                 }
             } else {
                 $text = $authorText . Yii::t('app', "started a process stage, but the process record could not be found.");
             }
             break;
         case 'workflow_complete':
             $action = X2Model::model('Actions')->findByPk($this->associationId);
             if (isset($action)) {
                 $record = X2Model::model(ucfirst($action->associationType))->findByPk($action->associationId);
                 if (isset($record)) {
                     $stages = Workflow::getStages($action->workflowId);
                     if (isset($stages[$action->stageNumber - 1])) {
                         $text = $authorText . Yii::t('app', 'completed the process stage "{stageName}" for the {modelName} {modelLink}', array('{stageName}' => $stages[$action->stageNumber - 1], '{modelName}' => Events::parseModelName($action->associationType), '{modelLink}' => X2Model::getModelLink($action->associationId, $action->associationType)));
                     } else {
                         $text = $authorText . Yii::t('app', "completed a process stage for the {modelName} {modelLink}, but the process stage could not be found.", array('{modelName}' => Events::parseModelName($action->associationType), '{modelLink}' => X2Model::getModelLink($action->associationId, $action->associationType)));
                     }
                 } else {
                     $text = $authorText . Yii::t('app', "completed a process stage, but the associated {modelName} was not found.", array('{modelName}' => Events::parseModelName($action->associationType)));
                 }
             } else {
                 $text = $authorText . Yii::t('app', "completed a process stage, but the process record could not be found.");
             }
             break;
         case 'workflow_revert':
             $action = X2Model::model('Actions')->findByPk($this->associationId);
開發者ID:shuvro35,項目名稱:X2CRM,代碼行數:67,代碼來源:Events.php


注:本文中的Workflow::getStages方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。