feat: filter assignments by id

This commit is contained in:
Björn Fromme
2024-12-02 14:19:35 +01:00
parent a378bc2e41
commit 44d130414c
5 changed files with 51 additions and 13 deletions
+20 -11
View File
@@ -12,6 +12,7 @@ use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -27,6 +28,7 @@ class AssignmentFilterType extends AbstractType
$builder
->add('dateFrom', DatepickerType::class, [
'label' => 'Zeitraum von',
'required' => false,
'min_date' => $options['min_date'],
'max_date' => $options['max_date'],
'attr' => [
@@ -35,6 +37,7 @@ class AssignmentFilterType extends AbstractType
])
->add('dateTo', DatepickerType::class, [
'label' => 'Zeitraum bis',
'required' => false,
'min_date' => $options['min_date'],
'max_date' => $options['max_date'],
'attr' => [
@@ -65,17 +68,23 @@ class AssignmentFilterType extends AbstractType
;
if ($this->security->isGranted('ROLE_ADMINISTRATIVE')) {
$builder->add('status', MultiselectType::class, [
'label' => 'Status',
'required' => false,
'empty_label' => 'nicht filtern',
'choices' => [
'voll besetzt' => Assignment::STATUS_STAFFED,
'teilweise besetzt' => Assignment::STATUS_PARTLY_STAFFED,
'unbesetzt' => Assignment::STATUS_UNSTAFFED,
'mit Bewerbungen' => Assignment::STATUS_STAFFING,
],
]);
$builder
->add('id', IntegerType::class, [
'label' => 'ID',
'required' => false,
])
->add('status', MultiselectType::class, [
'label' => 'Status',
'required' => false,
'empty_label' => 'nicht filtern',
'choices' => [
'voll besetzt' => Assignment::STATUS_STAFFED,
'teilweise besetzt' => Assignment::STATUS_PARTLY_STAFFED,
'unbesetzt' => Assignment::STATUS_UNSTAFFED,
'mit Bewerbungen' => Assignment::STATUS_STAFFING,
],
])
;
}
if (0 < count($options['job_profiles'])) {