dashboard widgets from event (#246)

This commit is contained in:
Kevin Papst
2018-07-28 23:18:28 +02:00
committed by GitHub
parent e6f8bc8ae2
commit 0996eca3c5
10 changed files with 384 additions and 129 deletions

View File

@@ -40,7 +40,7 @@ class TimesheetGlobalStatistic extends TimesheetStatistic
*/
public function setActiveCurrently($activeCurrently)
{
$this->activeCurrently = $activeCurrently;
$this->activeCurrently = (int) $activeCurrently;
}
/**
@@ -56,7 +56,7 @@ class TimesheetGlobalStatistic extends TimesheetStatistic
*/
public function setActiveThisMonth($activeThisMonth)
{
$this->activeThisMonth = $activeThisMonth;
$this->activeThisMonth = (int) $activeThisMonth;
}
/**
@@ -72,6 +72,6 @@ class TimesheetGlobalStatistic extends TimesheetStatistic
*/
public function setActiveTotal($activeTotal)
{
$this->activeTotal = $activeTotal;
$this->activeTotal = (int) $activeTotal;
}
}

View File

@@ -50,7 +50,7 @@ class TimesheetStatistic
*/
public function setDurationThisMonth($durationThisMonth)
{
$this->durationThisMonth = $durationThisMonth;
$this->durationThisMonth = (int) $durationThisMonth;
}
/**
@@ -66,7 +66,7 @@ class TimesheetStatistic
*/
public function setAmountTotal($amountTotal)
{
$this->amountTotal = $amountTotal;
$this->amountTotal = (int) $amountTotal;
}
/**
@@ -82,7 +82,7 @@ class TimesheetStatistic
*/
public function setDurationTotal($durationTotal)
{
$this->durationTotal = $durationTotal;
$this->durationTotal = (int) $durationTotal;
}
/**
@@ -98,7 +98,7 @@ class TimesheetStatistic
*/
public function setAmountThisMonth($amountThisMonth)
{
$this->amountThisMonth = $amountThisMonth;
$this->amountThisMonth = (int) $amountThisMonth;
}
/**

View File

@@ -32,6 +32,6 @@ class UserStatistic
*/
public function setTotalAmount($totalAmount)
{
$this->totalAmount = $totalAmount;
$this->totalAmount = (int) $totalAmount;
}
}

71
src/Model/WidgetRow.php Normal file
View File

@@ -0,0 +1,71 @@
<?php
/*
* This file is part of the Kimai time-tracking app.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Model;
class WidgetRow
{
/**
* @var string
*/
protected $id;
/**
* @var string
*/
protected $title;
/**
* @var string[]
*/
protected $widgets = [];
/**
* @param string $id
* @param string $title
*/
public function __construct(string $id, string $title = '')
{
$this->id = $id;
$this->title = $title;
}
/**
* @return string
*/
public function getId(): string
{
return $this->id;
}
/**
* @return string
*/
public function getTitle(): string
{
return $this->title;
}
/**
* @return string[]
*/
public function getWidgets(): array
{
return $this->widgets;
}
/**
* @param string $templateString
* @return $this
*/
public function add(string $templateString)
{
$this->widgets[] = $templateString;
return $this;
}
}