dashboard widgets from event (#246)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,6 +32,6 @@ class UserStatistic
|
||||
*/
|
||||
public function setTotalAmount($totalAmount)
|
||||
{
|
||||
$this->totalAmount = $totalAmount;
|
||||
$this->totalAmount = (int) $totalAmount;
|
||||
}
|
||||
}
|
||||
|
||||
71
src/Model/WidgetRow.php
Normal file
71
src/Model/WidgetRow.php
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user