guild/backend/modules/task/views/task-user/index.php

47 lines
1.4 KiB
PHP
Raw Normal View History

2021-11-23 13:13:19 +03:00
<?php
use backend\modules\project\models\ProjectUser;
use backend\modules\task\models\Task;
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 */
$this->title = 'Исполнители задачи';
2021-11-23 13:13:19 +03:00
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="task-user-index">
<p>
<?= Html::a('Назначить сотрудника', ['create'], ['class' => 'btn btn-success']) ?>
2021-11-23 13:13:19 +03:00
</p>
<?= $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'],
[
'attribute' => 'task_id',
2021-11-25 12:33:08 +03:00
'filter' => Task::find()->select(['title', 'id'])->indexBy('id')->column(),
'value' => 'task.title'
],
[
'attribute' => 'project_user_id',
2021-11-25 12:33:08 +03:00
'filter' => ProjectUser::find()->select(['user.username', 'project_user.id'])
->joinWith('user')->indexBy('project_user.id')->column(),
'value' => 'projectUser.user.username'
],
2021-11-23 13:13:19 +03:00
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
</div>