* добавил минуты
* исправил баг в календаре с 12 месяцем ('yyyy-00-dd' => 'yyyy-12-dd')
This commit is contained in:
parent
b497c000f6
commit
45fcfe16d1
@ -18,7 +18,7 @@ echo GridView::widget([
|
||||
if ($model->task) {
|
||||
$i = 1;
|
||||
foreach ($model->task as $task) {
|
||||
$text .= "<p>$i. ($task->hours_spent ч.) $task->task</p>";
|
||||
$text .= "<p>$i. ($task->hours_spent ч., $task->minutes_spent мин.) $task->task</p>";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ echo GridView::widget([
|
||||
if ($model->task) {
|
||||
$i = 1;
|
||||
foreach ($model->task as $task) {
|
||||
$text .= "<p>$i. ($task->hours_spent ч.) $task->task</p>";
|
||||
$text .= "<p>$i. ($task->hours_spent ч., $task->minutes_spent мин.) $task->task</p>";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,8 @@ use yii\widgets\ActiveForm;
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\Reports */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
|
||||
$this->registerCss('.list-cell__task{width:73%}')
|
||||
?>
|
||||
|
||||
<div class="reports-form">
|
||||
@ -52,6 +54,13 @@ use yii\widgets\ActiveForm;
|
||||
'style' => 'width:100px'
|
||||
],
|
||||
],
|
||||
[
|
||||
'name' => 'minutes_spent',
|
||||
'title' => 'Кол-во минут',
|
||||
'options' => [
|
||||
'type' => 'number',
|
||||
],
|
||||
],
|
||||
],
|
||||
])->label('Какие задачаи были выполнены:'); ?>
|
||||
|
||||
|
@ -37,7 +37,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
if ($model->task) {
|
||||
$i = 1;
|
||||
foreach ($model->task as $task) {
|
||||
$text .= "<p>$i. ($task->hours_spent ч.) $task->task</p>";
|
||||
$text .= "<p>$i. ($task->hours_spent ч., $task->minutes_spent мин.) $task->task</p>";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ class DateHelper {
|
||||
static dateToString(date) {
|
||||
let year = date.getFullYear()
|
||||
let day = this.intToDate(date.getDate())
|
||||
let month = this.intToDate(this.isDecember(date) ? 0 : date.getMonth() + 1)
|
||||
let month = this.intToDate(date.getMonth() + 1)
|
||||
return year + '-' + month + '-' + day
|
||||
}
|
||||
|
||||
|
@ -102,6 +102,7 @@ class Reports extends \yii\db\ActiveRecord
|
||||
$taskModel->report_id = $this->id;
|
||||
$taskModel->task = $task['task'];
|
||||
$taskModel->hours_spent = (float)$task['hours_spent'];
|
||||
$taskModel->minutes_spent = (int) $task['minutes_spent'];
|
||||
$taskModel->status = 1;
|
||||
$taskModel->created_at = time();
|
||||
$taskModel->save();
|
||||
|
@ -12,6 +12,7 @@ use Yii;
|
||||
* @property string $task
|
||||
* @property int $created_at
|
||||
* @property int $status
|
||||
* @property int $minutes_spent
|
||||
* @property float $hours_spent
|
||||
*
|
||||
* @property Reports $report
|
||||
@ -33,8 +34,9 @@ class ReportsTask extends \yii\db\ActiveRecord
|
||||
{
|
||||
return [
|
||||
[['report_id'], 'required'],
|
||||
[['report_id', 'created_at', 'status'], 'integer'],
|
||||
[['report_id', 'created_at', 'status', 'minutes_spent'], 'integer'],
|
||||
[['hours_spent'], 'number'],
|
||||
['minutes_spent', 'compare', 'compareValue' => 60, 'operator' => '<'],
|
||||
[['task'], 'string'],
|
||||
[['report_id'], 'exist', 'skipOnError' => true, 'targetClass' => Reports::className(), 'targetAttribute' => ['report_id' => 'id']],
|
||||
];
|
||||
|
@ -8,6 +8,8 @@ use yii\widgets\ActiveForm;
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\Reports */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
|
||||
$this->registerCss('.list-cell__task{width:73%}')
|
||||
?>
|
||||
|
||||
<div class="reports-form">
|
||||
@ -42,13 +44,24 @@ use yii\widgets\ActiveForm;
|
||||
[
|
||||
'name' => 'task',
|
||||
'title' => 'Задача',
|
||||
'options' => [
|
||||
],
|
||||
],
|
||||
[
|
||||
'name' => 'hours_spent',
|
||||
'title' => 'Кол-во часов',
|
||||
'options' => [
|
||||
'type' => 'number',
|
||||
'style' => 'width:100px'
|
||||
'min' => '0'
|
||||
],
|
||||
],
|
||||
[
|
||||
'name' => 'minutes_spent',
|
||||
'title' => 'Кол-во минут',
|
||||
'options' => [
|
||||
'type' => 'number',
|
||||
'min' => '0',
|
||||
'max' => '59'
|
||||
],
|
||||
],
|
||||
],
|
||||
|
@ -34,7 +34,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
if ($model->task) {
|
||||
$i = 1;
|
||||
foreach ($model->task as $task) {
|
||||
$text .= "<p>$i. ($task->hours_spent ч.) $task->task</p>";
|
||||
$text .= "<p>$i. ($task->hours_spent ч., $task->minutes_spent мин.) $task->task</p>";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
if ($model->task) {
|
||||
$i = 1;
|
||||
foreach ($model->task as $task) {
|
||||
$text .= "<p>$i. ($task->hours_spent ч.) $task->task</p>";
|
||||
$text .= "<p>$i. ($task->hours_spent ч., $task->minutes_spent мин.) $task->task</p>";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user