configs: overwrite via prepend, mode instead of duration_only (#715)

This commit is contained in:
Kevin Papst
2019-04-26 16:14:28 +02:00
committed by GitHub
parent f0f757cf75
commit 32f0d80729
24 changed files with 253 additions and 45 deletions

View File

@@ -0,0 +1,42 @@
<?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\Twig;
use App\Configuration\TimesheetConfiguration;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
class TimesheetConfigExtension extends AbstractExtension
{
/**
* @var TimesheetConfiguration
*/
protected $configuration;
public function __construct(TimesheetConfiguration $configuration)
{
$this->configuration = $configuration;
}
/**
* @return TwigFunction[]
*/
public function getFunctions()
{
return [
new TwigFunction('is_duration_only', [$this, 'isDurationOnly']),
];
}
public function isDurationOnly(): bool
{
return $this->configuration->isDurationOnly();
}
}