public function paramRules() { $workflows = Workflow::getList(false); // no "none" options $workflowIds = array_keys($workflows); $stages = count($workflowIds) ? Workflow::getStagesByNumber($workflowIds[0]) : array('---'); $stages = array('' => Yii::t('app', 'Any')) + $stages; return array('title' => Yii::t('studio', $this->title), 'modelClass' => 'modelClass', 'options' => array(array('name' => 'workflowId', 'label' => Yii::t('studio', 'Process'), 'type' => 'dropdown', 'options' => $workflows), array('name' => 'stageNumber', 'label' => Yii::t('studio', 'Stage'), 'type' => 'dependentDropdown', 'dependency' => 'workflowId', 'options' => $stages, 'optional' => true, 'optionsSource' => Yii::app()->createUrl('/workflow/workflow/getStageNames')), array('name' => 'modelClass', 'label' => Yii::t('studio', 'Associated Record Type'), 'type' => 'dropdown', 'options' => X2Model::getModelTypesWhichSupportWorkflow(true)))); }
<div class="row"> <div class='date-range-title'><?php echo Yii::t('app', 'Stage Start Date:'); ?> </div> <?php $this->widget('DateRangeInputsWidget', array('startDateName' => 'start', 'startDateLabel' => Yii::t('workflow', 'Start Date'), 'startDateValue' => $dateRange['start'], 'endDateName' => 'end', 'endDateLabel' => Yii::t('app', 'End Date'), 'endDateValue' => $dateRange['end'], 'dateRangeName' => 'range', 'dateRangeLabel' => Yii::t('app', 'Date Range'), 'dateRangeValue' => $dateRange['range'])); ?> </div> <div class="row row-no-title"> <div class="cell"> <?php echo CHtml::label(Yii::t('app', 'Record Type'), 'modelType'); ?> <?php echo CHtml::dropDownList('modelType', $modelType, X2Model::getModelTypesWhichSupportWorkflow(true, true), array('id' => 'workflow-model-type-filter')); ?> </div> </div> <div class="row row-no-title"> <div class="cell"> <?php echo CHtml::label(Yii::t('workflow', '{user}', array('{user}' => Modules::displayName(false, "Users"))), 'users'); echo CHtml::dropDownList('users', $users, array_merge(array('' => Yii::t('app', 'All')), User::getNames())); ?> </div> <?php echo CHtml::hiddenField('id', $model->id); ?> <div class="cell"> <?php
public function paramRules() { $workflows = Workflow::getList(false); // no "none" options return array('title' => Yii::t('studio', $this->title), 'modelClass' => 'modelClass', 'options' => array(array('name' => 'workflowId', 'label' => Yii::t('studio', 'Process'), 'type' => 'dropdown', 'options' => $workflows), array('name' => 'modelClass', 'label' => Yii::t('studio', 'Associated Record Type'), 'type' => 'dropdown', 'options' => X2Model::getModelTypesWhichSupportWorkflow(true)))); }
?> </div> <div class="cell"> <?php echo $form->labelEx($model, 'financial'); echo $form->checkBox($model, 'financial'); echo $form->error($model, 'financial'); ?> </div> <div class="cell" id="financialModel" style="<?php echo $model->financial ? '' : 'display:none;'; ?> "> <?php echo $form->labelEx($model, 'financialModel'); echo $form->dropDownList($model, 'financialModel', X2Model::getModelTypesWhichSupportWorkflow(true, true), array('empty' => Yii::t('workflow', 'Select a model type'))); echo $form->error($model, 'financialModel'); ?> </div> <div class="cell" id="financialField" style="<?php echo $model->financial ? '' : 'display:none;'; ?> "> <?php echo $form->labelEx($model, 'financialField'); $currencyFields = !empty($model->financialModel) ? Workflow::getCurrencyFields($model->financialModel) : array(); $emptyText = empty($currencyFields) ? Yii::t('workflow', 'Select a model') : Yii::t('workflow', 'Select a field'); echo $form->dropDownList($model, 'financialField', $currencyFields, array('empty' => $emptyText)); echo $form->error($model, 'financialField'); ?> </div>