2021-11-23 13:13:19 +03:00
|
|
|
<?php
|
|
|
|
|
2021-11-24 13:05:12 +03:00
|
|
|
use backend\modules\project\models\ProjectUser;
|
2023-01-18 15:30:38 +03:00
|
|
|
use backend\modules\task\models\ProjectTask;
|
|
|
|
use backend\modules\task\models\ProjectTaskUser;
|
2021-12-17 15:16:45 +03:00
|
|
|
use kartik\select2\Select2;
|
2021-11-23 13:13:19 +03:00
|
|
|
use yii\helpers\Html;
|
|
|
|
use yii\grid\GridView;
|
|
|
|
|
|
|
|
/* @var $this yii\web\View */
|
|
|
|
/* @var $searchModel backend\modules\task\models\TaskUserSearch */
|
|
|
|
/* @var $dataProvider yii\data\ActiveDataProvider */
|
|
|
|
|
2021-11-24 13:05:12 +03:00
|
|
|
$this->title = 'Исполнители задачи';
|
2021-11-23 13:13:19 +03:00
|
|
|
$this->params['breadcrumbs'][] = $this->title;
|
|
|
|
?>
|
|
|
|
<div class="task-user-index">
|
|
|
|
|
|
|
|
<p>
|
2021-11-24 13:05:12 +03:00
|
|
|
<?= Html::a('Назначить сотрудника', ['create'], ['class' => 'btn btn-success']) ?>
|
2021-11-23 13:13:19 +03:00
|
|
|
</p>
|
|
|
|
|
2021-12-06 15:13:31 +03:00
|
|
|
<?= $this->render('_search_by_project', [
|
|
|
|
'model' => $searchModel,
|
|
|
|
]) ?>
|
|
|
|
|
2021-11-23 13:13:19 +03:00
|
|
|
<?= GridView::widget([
|
|
|
|
'dataProvider' => $dataProvider,
|
|
|
|
'filterModel' => $searchModel,
|
|
|
|
'columns' => [
|
|
|
|
['class' => 'yii\grid\SerialColumn'],
|
|
|
|
|
2021-11-24 13:05:12 +03:00
|
|
|
[
|
|
|
|
'attribute' => 'task_id',
|
2021-12-17 15:16:45 +03:00
|
|
|
'value' => 'task.title',
|
|
|
|
'filter' => Select2::widget([
|
|
|
|
'model' => $searchModel,
|
|
|
|
'attribute' => 'task_id',
|
2023-01-18 15:30:38 +03:00
|
|
|
'data' => ProjectTaskUser::find()->joinWith('task')
|
2023-01-23 11:40:45 +03:00
|
|
|
->select(['project_task.title', 'project_task.id'])->indexBy('project_task.id')->column(),
|
2021-12-17 15:16:45 +03:00
|
|
|
'pluginOptions' => [
|
|
|
|
'allowClear' => true,
|
|
|
|
'width' => '250px',
|
|
|
|
],
|
|
|
|
'options' => [
|
|
|
|
'class' => 'form-control',
|
|
|
|
'placeholder' => 'Выберите значение'
|
|
|
|
],
|
|
|
|
])
|
2021-11-24 13:05:12 +03:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'attribute' => 'project_user_id',
|
2021-12-21 17:39:21 +03:00
|
|
|
'value' => 'projectUser.card.fio',
|
2021-12-17 15:16:45 +03:00
|
|
|
'filter' => Select2::widget([
|
|
|
|
'model' => $searchModel,
|
|
|
|
'attribute' => 'project_user_id',
|
2023-01-18 15:30:38 +03:00
|
|
|
'data' => ProjectTaskUser::find()->joinWith('projectUser.card')
|
2023-01-23 11:40:45 +03:00
|
|
|
->select(['user_card.fio', 'project_task_user.id'])->column(),
|
2021-12-17 15:16:45 +03:00
|
|
|
'pluginOptions' => [
|
|
|
|
'allowClear' => true,
|
|
|
|
'width' => '250px',
|
|
|
|
],
|
|
|
|
'options' => [
|
|
|
|
'class' => 'form-control',
|
|
|
|
'placeholder' => 'Выберите значение'
|
|
|
|
],
|
|
|
|
])
|
2021-11-24 13:05:12 +03:00
|
|
|
],
|
2021-11-23 13:13:19 +03:00
|
|
|
|
|
|
|
['class' => 'yii\grid\ActionColumn'],
|
|
|
|
],
|
|
|
|
]); ?>
|
|
|
|
</div>
|