Cleanup after 2.0 (#3868)

* removed duration_only mode
* cleanup database
* remove deleted user preference keys
This commit is contained in:
Kevin Papst
2023-02-22 15:06:54 +01:00
committed by GitHub
parent f04e0d92aa
commit 266c4bad25
6 changed files with 75 additions and 90 deletions

View File

@@ -322,8 +322,6 @@ class User implements UserInterface, EquatableInterface, ThemeUserInterface, Pas
UserPreference::SKIN,
'calendar_initial_view',
'login_initial_view',
'collapsed_sidebar', // TODO @2.1 removed with 2.0, can be deleted with 2.1
'layout', // TODO @2.1 removed with 2.0, can be deleted with 2.1
'update_browser_title',
'daily_stats',
'export_decimal',

View File

@@ -1,82 +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\Timesheet\TrackingMode;
use App\Entity\Timesheet;
use App\Timesheet\RoundingService;
use DateTime;
use Symfony\Component\HttpFoundation\Request;
/**
* This is a copy of the DefaultMode from 2.0
* FIXME 2.1 remove me with the next release
* @deprecated since 2.0
* @codeCoverageIgnore
*/
final class DurationOnlyMode extends AbstractTrackingMode
{
public function __construct(private RoundingService $rounding)
{
}
public function canEditBegin(): bool
{
return true;
}
public function canEditEnd(): bool
{
return true;
}
public function canEditDuration(): bool
{
return true;
}
public function canUpdateTimesWithAPI(): bool
{
return true;
}
public function getId(): string
{
return 'duration_only';
}
public function canSeeBeginAndEndTimes(): bool
{
return true;
}
public function getEditTemplate(): string
{
return 'timesheet/edit-default.html.twig';
}
public function create(Timesheet $timesheet, ?Request $request = null): void
{
parent::create($timesheet, $request);
if (null === $timesheet->getBegin()) {
$timesheet->setBegin(new DateTime('now', $this->getTimezone($timesheet)));
}
$this->rounding->roundBegin($timesheet);
if (null !== $timesheet->getEnd()) {
$this->rounding->roundEnd($timesheet);
if (null !== $timesheet->getDuration()) {
$this->rounding->roundDuration($timesheet);
}
}
}
}