feat: filter assignments by hotel in favor of destination

This commit is contained in:
Björn Fromme
2024-02-28 13:10:52 +01:00
parent e0522bdf53
commit a668dcb326
7 changed files with 41 additions and 34 deletions
+9 -9
View File
@@ -66,16 +66,16 @@ class AssignmentFilterType extends AbstractType
])
;
}
if (0 < count($options['destinations'])) {
if (0 < count($options['hotels'])) {
$choices = [];
foreach ($options['hotels'] as $item) {
$choices[$item->getHotel()] = $item->getHotelCode();
}
$builder
->add('destination', EntityType::class, [
'label' => 'Destination',
'class' => Destination::class,
->add('hotel', ChoiceType::class, [
'label' => 'Haus',
'required' => false,
'choice_label' => function (Destination $destination) {
return $destination->getProduct();
},
'choices' => $options['destinations'],
'choices' => $choices,
])
;
}
@@ -89,7 +89,7 @@ class AssignmentFilterType extends AbstractType
'min_date' => null,
'max_date' => null,
'job_profiles' => [],
'destinations' => [],
'hotels' => [],
])
->setAllowedTypes('min_date', [\DateTimeImmutable::class, 'null'])
->setAllowedTypes('max_date', [\DateTimeImmutable::class, 'null'])