/** * @return \yii\db\ActiveQuery */ public function getActionsStatuses() { return $this->hasMany(ActionsStatuses::className(), ['company_id' => 'id']); }
</div> <div class="form-group"> <select name="Actions[action_priority_id]" class="styled status square" data-placeholder="Все приоритеты"> <?php $prior_array = ActionsPriority::model()->findAll(); foreach ($prior_array as $prior) { echo '<option ' . ($prior->id == 1 ? ' selected="selected"' : '') . ' class="' . $prior->color . '" value="' . $prior->id . '">' . 'Приоритет: ' . $prior->name . '</option>'; } ?> </select> <span class="star">*</span> </div> <div class="form-group"> <select name="Actions[action_status_id]" class="styled status circle" data-placeholder="Состояние действия"> <?php $statuses_array = ActionsStatuses::model()->findAll(); foreach ($statuses_array as $status) { echo '<option ' . ($actions->action_priority_id == $status->id ? ' selected="selected"' : '') . ' value="' . $status->id . '">' . 'Состояние: ' . $status->name . '</option>'; } ?> </select> <span class="star">*</span> </div> <div class="form-group form-control editable"> <?php echo $this->widget('ext.CJuiDateTimePicker.CJuiDateTimePicker', array('name' => 'Actions[action_date]', 'model' => $actions, 'attribute' => 'action_date', 'language' => 'ru', 'options' => array('dateFormat' => 'dd.mm.yy', 'changeMonth' => 'true', 'changeYear' => 'true', 'showButtonPanel' => true, 'beforeShow' => new CJavaScriptExpression('function(element){dataPickerFocus = $(element).attr(\'id\').trim();}')), 'htmlOptions' => array('class' => 'form-control editable')), true); ?> <?php echo $form->error($actions, 'action_date', array('class' => 'form-error')); ?> <span class="star">*</span>
public function actionSettings_action_status() { $user = Users::model()->findByPk(Yii::app()->user->id); $statuses = new ActionsStatuses(); $statuses_table_data = $statuses->search(); $this->render('settings_action_status', array('user' => $user, 'statuses' => $statuses, 'statuses_table_data' => $statuses_table_data)); }
/** * @return \yii\db\ActiveQuery */ public function getActionStatus() { return $this->hasOne(ActionsStatuses::className(), ['id' => 'action_status_id']); }