report task
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use kartik\date\DatePicker;
|
||||
use unclead\multipleinput\MultipleInput;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
@ -34,7 +35,24 @@ use yii\widgets\ActiveForm;
|
||||
]).'<br>';
|
||||
?>
|
||||
|
||||
<?= $form->field($model, 'today')->textarea(['maxlength' => true]) ?>
|
||||
<?= $form->field($model, '_task')->widget(MultipleInput::class, [
|
||||
'cloneButton' => true,
|
||||
'max' => 10,
|
||||
'columns' => [
|
||||
[
|
||||
'name' => 'task',
|
||||
'title' => 'Задача',
|
||||
],
|
||||
[
|
||||
'name' => 'hours_spent',
|
||||
'title' => 'Кол-во часов',
|
||||
'options' => [
|
||||
'type' => 'number',
|
||||
'style' => 'width:100px'
|
||||
],
|
||||
],
|
||||
],
|
||||
])->label('Какие задачаи были выполнены:'); ?>
|
||||
|
||||
<?= $form->field($model, 'difficulties')->textarea(['maxlength' => true]) ?>
|
||||
|
||||
|
@ -26,10 +26,20 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
'created_at',
|
||||
[
|
||||
'attribute' => 'today',
|
||||
'format' => 'raw',
|
||||
'attribute' => 'Что было сделано сегодня?',
|
||||
'filter' => Html::activeTextInput($searchModel, 'today', ['class' => 'form-control']),
|
||||
'value' => function ($data) { return '<div class="custom-text">'.$data->today.'</div>'; },
|
||||
'label' => 'Задачи',
|
||||
'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;
|
||||
}
|
||||
],
|
||||
[
|
||||
'format' => 'raw',
|
||||
|
@ -30,7 +30,22 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
'attributes' => [
|
||||
// 'id',
|
||||
'created_at',
|
||||
'today',
|
||||
[
|
||||
'attribute' => 'today',
|
||||
'format' => 'raw',
|
||||
'label' => 'Задачи',
|
||||
'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',
|
||||
// 'user_card_id',
|
||||
|
Reference in New Issue
Block a user