Release 2.22.0 (#5043)

This commit is contained in:
Kevin Papst
2024-09-20 14:30:11 +02:00
committed by GitHub
parent 3e0dadc0c8
commit 537c120ad9
57 changed files with 435 additions and 572 deletions

View File

@@ -17,7 +17,11 @@ use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
final class UserSubscriber extends AbstractActionsSubscriber
{
public function __construct(AuthorizationCheckerInterface $auth, UrlGeneratorInterface $urlGenerator, private EventDispatcherInterface $eventDispatcher)
public function __construct(
AuthorizationCheckerInterface $auth,
UrlGeneratorInterface $urlGenerator,
private readonly EventDispatcherInterface $eventDispatcher
)
{
parent::__construct($auth, $urlGenerator);
}
@@ -47,6 +51,10 @@ final class UserSubscriber extends AbstractActionsSubscriber
$event->addActionToSubmenu('edit', $id, $action);
}
if ($this->isGranted('hours', $user)) {
$event->addActionToSubmenu('report', 'work_times', ['url' => $this->path('user_contract', ['user' => $user->getId()]), 'title' => 'work_times']);
}
if (($event->getUser()->getId() === $user->getId() && $this->isGranted('report:user')) || $this->isGranted('report:other')) {
$event->addActionToSubmenu('report', 'weekly', ['url' => $this->path('report_user_week', ['user' => $user->getId()]), 'translation_domain' => 'reporting', 'title' => 'report_user_week']);
$event->addActionToSubmenu('report', 'monthly', ['url' => $this->path('report_user_month', ['user' => $user->getId()]), 'translation_domain' => 'reporting', 'title' => 'report_user_month']);