feat: timeline for role house manager
closes #869b9vmmx
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user