2021-11-23 13:13:19 +03:00
|
|
|
<?php
|
|
|
|
|
2021-11-24 13:05:12 +03:00
|
|
|
use backend\modules\task\models\Task;
|
|
|
|
use kartik\depdrop\DepDrop;
|
2021-12-06 15:13:31 +03:00
|
|
|
use kartik\select2\Select2;
|
2021-11-23 13:13:19 +03:00
|
|
|
use yii\helpers\Html;
|
2021-11-24 13:05:12 +03:00
|
|
|
use yii\helpers\Url;
|
2021-11-23 13:13:19 +03:00
|
|
|
use yii\widgets\ActiveForm;
|
|
|
|
|
|
|
|
/* @var $this yii\web\View */
|
|
|
|
/* @var $model backend\modules\task\models\TaskUser */
|
|
|
|
/* @var $form yii\widgets\ActiveForm */
|
2021-12-06 15:13:31 +03:00
|
|
|
/* @var $task_id */
|
2021-11-23 13:13:19 +03:00
|
|
|
?>
|
|
|
|
|
|
|
|
<div class="task-user-form">
|
|
|
|
|
|
|
|
<?php $form = ActiveForm::begin(); ?>
|
|
|
|
|
2021-12-06 15:13:31 +03:00
|
|
|
<?= $form->field($model, 'task_id')->widget(Select2::className(),[
|
|
|
|
'data' => Task::find()->select(['title', 'id'])->indexBy('id')->column(),
|
|
|
|
'options' => ['placeholder' => 'Выберите проект', 'value' => $task_id, 'id' => 'task-id',],
|
|
|
|
'pluginOptions' => [
|
2021-12-16 17:14:33 +03:00
|
|
|
'allowClear' => false,
|
2021-12-06 15:13:31 +03:00
|
|
|
],
|
|
|
|
]);
|
2021-11-24 13:05:12 +03:00
|
|
|
?>
|
|
|
|
|
|
|
|
<?= $form->field($model, 'project_user_id')->widget(DepDrop::className(),
|
|
|
|
[
|
2021-12-16 17:14:33 +03:00
|
|
|
'type' => DepDrop::TYPE_SELECT2,
|
|
|
|
'options' => ['id' => 'project-user-id', 'allowClear' => true, 'multiple' => true], // , 'multiple' => true
|
|
|
|
'select2Options' => [
|
|
|
|
'pluginOptions' => [
|
|
|
|
'allowClear' => true,
|
|
|
|
'closeOnSelect' => false,
|
|
|
|
],
|
|
|
|
'showToggleAll' => false,
|
|
|
|
],
|
2021-11-24 13:05:12 +03:00
|
|
|
'pluginOptions' => [
|
|
|
|
'depends' => ['task-id'],
|
|
|
|
'placeholder' => 'Выберите',
|
2021-12-06 15:13:31 +03:00
|
|
|
'initialize' => true,
|
2021-12-16 17:14:33 +03:00
|
|
|
'url' => Url::to(['/task/task-user/executor']),
|
2021-11-24 13:05:12 +03:00
|
|
|
]
|
|
|
|
]
|
|
|
|
); ?>
|
2021-11-23 13:13:19 +03:00
|
|
|
|
|
|
|
<div class="form-group">
|
2021-12-06 15:13:31 +03:00
|
|
|
<?= Html::submitButton('Назначить', ['class' => 'btn btn-success']) ?>
|
2021-11-23 13:13:19 +03:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php ActiveForm::end(); ?>
|
|
|
|
|
|
|
|
</div>
|