authorizationChecker->isGranted('view_other_timesheet'); } public function create(Timesheet $timesheet, ?Request $request = null): void { if (null === $timesheet->getBegin()) { $timesheet->setBegin(new DateTime('now', $this->getTimezone($timesheet))); } /** @var DateTime $newBegin */ $newBegin = clone $timesheet->getBegin(); // @phpstan-ignore-line // this prevents the problem that "now" is being ignored in modify() $beginTime = new DateTime($this->configuration->getTimesheetDefaultBeginTime(), $newBegin->getTimezone()); $newBegin->setTime((int) $beginTime->format('H'), (int) $beginTime->format('i'), 0, 0); $timesheet->setBegin($newBegin); } public function getId(): string { return 'duration_fixed_begin'; } public function canSeeBeginAndEndTimes(): bool { return false; } public function getEditTemplate(): string { return 'timesheet/edit-default.html.twig'; } }