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

44 lines
1.3 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;
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 */
$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>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
[
'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>