本文整理汇总了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)));
}
示例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);
}
}
示例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);