feat: filter assignments and applications by country

closes #8698fpqq5
This commit is contained in:
Björn Fromme
2025-04-08 17:48:44 +02:00
parent 299c37c823
commit 947b183c50
10 changed files with 77 additions and 5 deletions
+11
View File
@@ -63,6 +63,17 @@ class ApplicationFilterType extends AbstractType
'label' => 'vergangene Einsätze anzeigen',
'required' => false,
])
->add('country', ChoiceType::class, [
'label' => 'Land',
'required' => false,
'placeholder' => 'nicht filtern',
'choices' => [
'Österreich' => 'a',
'Schweiz' => 'ch',
'Frankreich' => 'f',
'Italien' => 'i',
],
])
->add('apply', SubmitType::class, [
'label' => 'filtern',
])
+11
View File
@@ -66,6 +66,17 @@ class AssignmentFilterType extends AbstractType
'label' => 'vergangene Einsätze anzeigen',
'required' => false,
])
->add('country', ChoiceType::class, [
'label' => 'Land',
'required' => false,
'placeholder' => 'nicht filtern',
'choices' => [
'Österreich' => 'a',
'Schweiz' => 'ch',
'Frankreich' => 'f',
'Italien' => 'i',
],
])
->add('apply', SubmitType::class, [
'label' => 'filtern',
])
+13
View File
@@ -17,6 +17,7 @@ class ApplicationFilterDto extends AbstractFilterDto
protected ?int $duration = null;
protected array $status = [];
protected bool $includePast = false;
protected ?string $country = null;
public function getId(): ?int
{
@@ -113,4 +114,16 @@ class ApplicationFilterDto extends AbstractFilterDto
return $this;
}
public function getCountry(): ?string
{
return $this->country;
}
public function setCountry(?string $country): static
{
$this->country = $country;
return $this;
}
}
+13
View File
@@ -17,6 +17,7 @@ class AssignmentFilterDto extends AbstractFilterDto
protected ?int $duration = null;
protected array $status = [];
protected bool $includePast = false;
protected ?string $country = null;
public function getId(): ?int
{
@@ -113,4 +114,16 @@ class AssignmentFilterDto extends AbstractFilterDto
return $this;
}
public function getCountry(): ?string
{
return $this->country;
}
public function setCountry(?string $country): static
{
$this->country = $country;
return $this;
}
}
+7
View File
@@ -102,6 +102,13 @@ class ApplicationRepository extends ServiceEntityRepository
}
}
if (null !== $country = $filterDto->getCountry()) {
$qb
->andWhere($qb->expr()->eq('destination.country', ':country'))
->setParameter('country', $country)
;
}
return $qb->getQuery();
}
+7
View File
@@ -169,6 +169,13 @@ class AssignmentRepository extends ServiceEntityRepository
;
}
}
if (null !== $country = $filterDto->getCountry()) {
$qb
->andWhere($qb->expr()->eq('destination.country', ':country'))
->setParameter('country', $country)
;
}
}
public function getBookmarkQueryForTeamer(Teamer $teamer): Query
@@ -48,6 +48,9 @@ class ApplicationFilterHandler extends AbstractFilterHandler
if (isset($data['include_past'])) {
$filterDto->setIncludePast((bool) $data['include_past']);
}
if (isset($data['country'])) {
$filterDto->setCountry($data['country']);
}
return $filterDto;
}
@@ -66,6 +69,7 @@ class ApplicationFilterHandler extends AbstractFilterHandler
'duration' => $filterDto->getDuration(),
'status' => $filterDto->getStatus(),
'include_past' => $filterDto->isIncludePast(),
'country' => $filterDto->getCountry(),
]);
}
}
@@ -48,6 +48,9 @@ class AssignmentFilterHandler extends AbstractFilterHandler
if (isset($data['include_past'])) {
$filterDto->setIncludePast((bool) $data['include_past']);
}
if (isset($data['country'])) {
$filterDto->setCountry($data['country']);
}
return $filterDto;
}
@@ -66,6 +69,7 @@ class AssignmentFilterHandler extends AbstractFilterHandler
'duration' => $filterDto->getDuration(),
'status' => $filterDto->getStatus(),
'include_past' => $filterDto->isIncludePast(),
'country' => $filterDto->getCountry(),
]);
}
}
@@ -18,6 +18,7 @@
{{ form_row(filterForm.jobProfiles) }}
{{ form_row(filterForm.hotels) }}
{{ form_row(filterForm.duration) }}
{{ form_row(filterForm.country) }}
{{ form_row(filterForm.includePast) }}
</div>
<div class="flex items-center space-x-2">
@@ -18,6 +18,7 @@
{{ form_row(filterForm.jobProfiles) }}
{{ form_row(filterForm.hotels) }}
{{ form_row(filterForm.duration) }}
{{ form_row(filterForm.country) }}
{{ form_row(filterForm.includePast) }}
</div>
<div class="flex items-center space-x-2">