added api endpoint to return instance specific timesheet config (#1335)

This commit is contained in:
hmr-it-jr
2020-01-04 01:44:11 +01:00
committed by Kevin Papst
parent 022dbe32e5
commit 50383673ca
7 changed files with 233 additions and 16 deletions

View File

@@ -11,49 +11,49 @@ declare(strict_types=1);
namespace App\API\Model;
class I18n
final class I18n
{
/**
* Format used for 'begin' and 'end'
*
* @var string
*/
protected $formDateTime = '';
private $formDateTime = '';
/**
* Format used for toolbar queries
*
* @var string
*/
protected $formDate = '';
private $formDate = '';
/**
* Format used to display date-time values (see PHP function date_format)
*
* @var string
*/
protected $dateTime = '';
private $dateTime = '';
/**
* Format used to display date values (see PHP function date_format)
*
* @var string
*/
protected $date = '';
private $date = '';
/**
* Format used to display times (see PHP function date_format)
*
* @var string
*/
protected $time = '';
private $time = '';
/**
* Format used to display durations (replace: %h with hours, %m with minutes, %s with seconds)
*
* @var string
*/
protected $duration = '';
private $duration = '';
/**
* Whether a twenty-four hour format is used (true) or 12-hours AM/PM format (false)
* @var bool
*/
protected $is24hours = true;
private $is24hours = true;
/**
* @return string

View File

@@ -0,0 +1,101 @@
<?php
declare(strict_types=1);
/*
* 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\API\Model;
final class TimesheetConfig
{
/**
* See here: https://www.kimai.org/documentation/timesheet.html#tracking-modes
*
* @var string
*/
private $trackingMode = 'default';
/**
* @var string
*/
private $defaultBeginTime = 'now';
/**
* @var int
*/
private $activeEntriesHardLimit = 1;
/**
* @var int
*/
private $activeEntriesSoftLimit = 1;
/**
* @var bool
*/
private $isAllowFutureTimes = true;
/**
* @return string
*/
public function getTrackingMode(): string
{
return $this->trackingMode;
}
public function setTrackingMode(string $trackingMode): TimesheetConfig
{
$this->trackingMode = $trackingMode;
return $this;
}
public function getDefaultBeginTime(): string
{
return $this->defaultBeginTime;
}
public function setDefaultBeginTime(string $defaultBeginTime): TimesheetConfig
{
$this->defaultBeginTime = $defaultBeginTime;
return $this;
}
public function getActiveEntriesHardLimit(): int
{
return $this->activeEntriesHardLimit;
}
public function setActiveEntriesHardLimit(int $activeEntriesHardLimit): TimesheetConfig
{
$this->activeEntriesHardLimit = $activeEntriesHardLimit;
return $this;
}
public function getActiveEntriesSoftLimit(): int
{
return $this->activeEntriesSoftLimit;
}
public function setActiveEntriesSoftLimit(int $activeEntriesSoftLimit): TimesheetConfig
{
$this->activeEntriesSoftLimit = $activeEntriesSoftLimit;
return $this;
}
public function isAllowFutureTimes(): bool
{
return $this->isAllowFutureTimes;
}
public function setIsAllowFutureTimes(bool $isAllowFutureTimes): TimesheetConfig
{
$this->isAllowFutureTimes = $isAllowFutureTimes;
return $this;
}
}