2021-11-23 13:13:19 +03:00
|
|
|
<?php
|
|
|
|
|
2021-11-24 13:05:12 +03:00
|
|
|
use backend\modules\project\models\ProjectUser;
|
|
|
|
use backend\modules\task\models\Task;
|
|
|
|
use yii\helpers\ArrayHelper;
|
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>
|
|
|
|
|
|
|
|
<?= GridView::widget([
|
|
|
|
'dataProvider' => $dataProvider,
|
|
|
|
'filterModel' => $searchModel,
|
|
|
|
'columns' => [
|
|
|
|
['class' => 'yii\grid\SerialColumn'],
|
|
|
|
|
2021-11-24 13:05:12 +03:00
|
|
|
[
|
|
|
|
'attribute' => 'task_id',
|
|
|
|
'filter' => ArrayHelper::map(Task::find()->all(), 'id', 'title'),
|
|
|
|
'value' => 'task.title'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'attribute' => 'project_user_id',
|
|
|
|
'filter' => ArrayHelper::map(ProjectUser::find()->joinWith('user')
|
|
|
|
->all(), 'id', 'user.username'),
|
|
|
|
'value' => 'projectUser.user.username'
|
|
|
|
],
|
2021-11-23 13:13:19 +03:00
|
|
|
|
|
|
|
['class' => 'yii\grid\ActionColumn'],
|
|
|
|
],
|
|
|
|
]); ?>
|
|
|
|
</div>
|