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']);

View File

@@ -43,8 +43,8 @@ final class MenuBuilderSubscriber implements EventSubscriberInterface
$event->addItem($child);
}
if ($menuEvent->getAppsMenu()->hasChildren()) {
$event->addItem($menuEvent->getAppsMenu());
if ($menuEvent->getAppsMenu()->hasChildren()) { // @phpstan-ignore-line
$event->addItem($menuEvent->getAppsMenu()); // @phpstan-ignore-line
}
if ($menuEvent->getAdminMenu()->hasChildren()) {
$event->addItem($menuEvent->getAdminMenu());

View File

@@ -94,7 +94,7 @@ final class MenuSubscriber implements EventSubscriberInterface
}
$contract = new MenuItemModel('contract', 'work_contract', null, [], 'contract');
if ($user->hasContractSettings() || $auth->isGranted('hours_other_profile')) {
if ($auth->isGranted('hours', $user)) {
$contract->addChild(new MenuItemModel('contract_status', 'work_times', 'user_contract', [], 'work_times'));
}