add multi-assignment to tasks and projects
This commit is contained in:
@ -21,19 +21,27 @@ use yii\widgets\ActiveForm;
|
||||
'data' => Task::find()->select(['title', 'id'])->indexBy('id')->column(),
|
||||
'options' => ['placeholder' => 'Выберите проект', 'value' => $task_id, 'id' => 'task-id',],
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
'allowClear' => false,
|
||||
],
|
||||
]);
|
||||
?>
|
||||
|
||||
<?= $form->field($model, 'project_user_id')->widget(DepDrop::className(),
|
||||
[
|
||||
'options' => ['id' => 'project-user-id'],
|
||||
'type' => DepDrop::TYPE_SELECT2,
|
||||
'options' => ['id' => 'project-user-id', 'allowClear' => true, 'multiple' => true], // , 'multiple' => true
|
||||
'select2Options' => [
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
'closeOnSelect' => false,
|
||||
],
|
||||
'showToggleAll' => false,
|
||||
],
|
||||
'pluginOptions' => [
|
||||
'depends' => ['task-id'],
|
||||
'placeholder' => 'Выберите',
|
||||
'initialize' => true,
|
||||
'url' => Url::to(['/task/task-user/executor'])
|
||||
'url' => Url::to(['/task/task-user/executor']),
|
||||
]
|
||||
]
|
||||
); ?>
|
||||
|
47
backend/modules/task/views/task-user/_form_update.php
Normal file
47
backend/modules/task/views/task-user/_form_update.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
use backend\modules\task\models\Task;
|
||||
use kartik\depdrop\DepDrop;
|
||||
use kartik\select2\Select2;
|
||||
use yii\helpers\Html;
|
||||
use yii\helpers\Url;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\task\models\TaskUser */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
/* @var $task_id */
|
||||
?>
|
||||
|
||||
<div class="task-user-form">
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $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' => [
|
||||
'allowClear' => false,
|
||||
],
|
||||
]);
|
||||
?>
|
||||
|
||||
<?= $form->field($model, 'project_user_id')->widget(DepDrop::className(),
|
||||
[
|
||||
'options' => ['id' => 'project-user-id', 'allowClear' => true],
|
||||
'pluginOptions' => [
|
||||
'depends' => ['task-id'],
|
||||
'placeholder' => 'Выберите',
|
||||
'initialize' => true,
|
||||
'url' => Url::to(['/task/task-user/executor']),
|
||||
]
|
||||
]
|
||||
); ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Назначить', ['class' => 'btn btn-success']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
@ -12,7 +12,7 @@ $this->params['breadcrumbs'][] = 'Update';
|
||||
?>
|
||||
<div class="task-user-update">
|
||||
|
||||
<?= $this->render('_form', [
|
||||
<?= $this->render('_form_update', [
|
||||
'model' => $model,
|
||||
'task_id' => $task_id,
|
||||
]) ?>
|
||||
|
Reference in New Issue
Block a user