2021-09-13 16:40:37 +03:00
|
|
|
<?php
|
|
|
|
|
2021-09-15 11:26:06 +03:00
|
|
|
use common\models\Reports;
|
2021-09-13 16:40:37 +03:00
|
|
|
use yii\grid\GridView;
|
2021-09-15 11:26:06 +03:00
|
|
|
use yii\helpers\Html;
|
2021-09-13 16:40:37 +03:00
|
|
|
|
|
|
|
/* @var $this yii\web\View */
|
|
|
|
/* @var $dataProvider yii\data\ActiveDataProvider */
|
|
|
|
|
2021-09-15 11:26:06 +03:00
|
|
|
|
2021-09-13 16:40:37 +03:00
|
|
|
echo GridView::widget([
|
|
|
|
'dataProvider' => $dataProvider,
|
|
|
|
'columns' => [
|
|
|
|
['class' => 'yii\grid\SerialColumn'],
|
|
|
|
[
|
|
|
|
'attribute' => 'today',
|
|
|
|
'format' => 'raw',
|
|
|
|
'value' => function ($model) {
|
|
|
|
|
|
|
|
$text = '';
|
|
|
|
if ($model->task) {
|
|
|
|
$i = 1;
|
|
|
|
foreach ($model->task as $task) {
|
|
|
|
$text .= "<p>$i. ($task->hours_spent ч.) $task->task</p>";
|
|
|
|
$i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $text;
|
|
|
|
}
|
|
|
|
],
|
|
|
|
'difficulties',
|
|
|
|
'tomorrow',
|
2021-09-15 11:26:06 +03:00
|
|
|
[
|
|
|
|
'format' => 'raw',
|
|
|
|
'attribute' => 'user_card_id',
|
|
|
|
'value' => function ($model) {
|
|
|
|
return Html::a(Reports::getFio($model) . ' ' . Html::tag('i', null, ['class' => 'far fa-calendar-alt']),
|
|
|
|
\yii\helpers\Url::base(true) . '/reports/reports/calendar?user_id=' . $model['user_card_id'], ['data-pjax' => 0]);
|
|
|
|
},
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'class' => 'yii\grid\ActionColumn',
|
|
|
|
'urlCreator' => function ($action, $model, $key, $index) {
|
|
|
|
return \yii\helpers\Url::base(true) . '/reports/reports/' . $action . '?id=' . $model->id;
|
|
|
|
}
|
|
|
|
],
|
2021-09-13 16:40:37 +03:00
|
|
|
],
|
2021-09-15 11:26:06 +03:00
|
|
|
|
2021-09-13 16:40:37 +03:00
|
|
|
]);
|
|
|
|
die();
|
|
|
|
|