add "duration + fixed start time" tracking mode (#859)
This commit is contained in:
@@ -1,48 +0,0 @@
|
||||
<?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']),
|
||||
new TwigFunction('is_punch_mode', [$this, 'isPunchInOut']),
|
||||
];
|
||||
}
|
||||
|
||||
public function isDurationOnly(): bool
|
||||
{
|
||||
return $this->configuration->isDurationOnly();
|
||||
}
|
||||
|
||||
public function isPunchInOut(): bool
|
||||
{
|
||||
return $this->configuration->isPunchInOut();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user