feat: timeline for role house manager

closes #869b9vmmx
This commit is contained in:
Björn Fromme
2026-03-15 12:42:28 +01:00
parent 6dfd8fd3ef
commit 1a536c044e
7 changed files with 87 additions and 27 deletions
+18 -14
View File
@@ -4,6 +4,7 @@ namespace App\Form;
use App\Model\TimelineFilterDto;
use App\Service\Assignment\TimelineService;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormBuilderInterface;
@@ -13,6 +14,7 @@ class TimelineFilterType extends AbstractType
{
public function __construct(
private readonly TimelineService $timelineService,
private readonly Security $security,
private readonly array $destinations,
) {
}
@@ -50,21 +52,23 @@ class TimelineFilterType extends AbstractType
])
;
$destinations = $this->destinations;
$hotelChoices = [];
sort($destinations);
foreach ($destinations as $item) {
$hotelChoices[$item] = $item;
}
if (false === $this->security->isGranted('ROLE_HOUSE_MANAGER')) {
$destinations = $this->destinations;
$hotelChoices = [];
sort($destinations);
foreach ($destinations as $item) {
$hotelChoices[$item] = $item;
}
$builder
->add('hotels', MultiselectType::class, [
'label' => 'Haus/Destination',
'required' => false,
'empty_label' => 'nicht filtern',
'choices' => $hotelChoices,
])
;
$builder
->add('hotels', MultiselectType::class, [
'label' => 'Haus/Destination',
'required' => false,
'empty_label' => 'nicht filtern',
'choices' => $hotelChoices,
])
;
}
}
public function configureOptions(OptionsResolver $resolver): void