added database driven system configurations with admin screen (#647)

This commit is contained in:
Kevin Papst
2019-03-22 20:58:38 +01:00
committed by GitHub
parent e990ae4800
commit 13d9f8f3f7
142 changed files with 2262 additions and 64727 deletions

View File

@@ -11,6 +11,7 @@ declare(strict_types=1);
namespace App\API;
use App\Configuration\TimesheetConfiguration;
use App\Entity\Timesheet;
use App\Form\TimesheetEditForm;
use App\Repository\Query\TimesheetQuery;
@@ -37,16 +38,14 @@ class TimesheetController extends BaseApiController
* @var TimesheetRepository
*/
protected $repository;
/**
* @var ViewHandlerInterface
*/
protected $viewHandler;
/**
* @var int
* @var TimesheetConfiguration
*/
protected $hardLimit;
protected $configuration;
/**
* @var UserDateTimeFactory
@@ -57,13 +56,13 @@ class TimesheetController extends BaseApiController
* @param ViewHandlerInterface $viewHandler
* @param TimesheetRepository $repository
* @param UserDateTimeFactory $dateTime
* @param int $hardLimit
* @param TimesheetConfiguration $configuration
*/
public function __construct(ViewHandlerInterface $viewHandler, TimesheetRepository $repository, UserDateTimeFactory $dateTime, int $hardLimit)
public function __construct(ViewHandlerInterface $viewHandler, TimesheetRepository $repository, UserDateTimeFactory $dateTime, TimesheetConfiguration $configuration)
{
$this->viewHandler = $viewHandler;
$this->repository = $repository;
$this->hardLimit = $hardLimit;
$this->configuration = $configuration;
$this->dateTime = $dateTime;
}
@@ -235,7 +234,7 @@ class TimesheetController extends BaseApiController
if (null === $timesheet->getEnd()) {
$this->repository->stopActiveEntries(
$timesheet->getUser(),
$this->hardLimit
$this->configuration->getActiveEntriesHardLimit()
);
}