feat: filter assignments and applications by country
closes #8698fpqq5
This commit is contained in:
@@ -63,6 +63,17 @@ class ApplicationFilterType extends AbstractType
|
|||||||
'label' => 'vergangene Einsätze anzeigen',
|
'label' => 'vergangene Einsätze anzeigen',
|
||||||
'required' => false,
|
'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, [
|
->add('apply', SubmitType::class, [
|
||||||
'label' => 'filtern',
|
'label' => 'filtern',
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -66,6 +66,17 @@ class AssignmentFilterType extends AbstractType
|
|||||||
'label' => 'vergangene Einsätze anzeigen',
|
'label' => 'vergangene Einsätze anzeigen',
|
||||||
'required' => false,
|
'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, [
|
->add('apply', SubmitType::class, [
|
||||||
'label' => 'filtern',
|
'label' => 'filtern',
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ class ApplicationFilterDto extends AbstractFilterDto
|
|||||||
protected ?int $duration = null;
|
protected ?int $duration = null;
|
||||||
protected array $status = [];
|
protected array $status = [];
|
||||||
protected bool $includePast = false;
|
protected bool $includePast = false;
|
||||||
|
protected ?string $country = null;
|
||||||
|
|
||||||
public function getId(): ?int
|
public function getId(): ?int
|
||||||
{
|
{
|
||||||
@@ -113,4 +114,16 @@ class ApplicationFilterDto extends AbstractFilterDto
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getCountry(): ?string
|
||||||
|
{
|
||||||
|
return $this->country;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setCountry(?string $country): static
|
||||||
|
{
|
||||||
|
$this->country = $country;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -17,6 +17,7 @@ class AssignmentFilterDto extends AbstractFilterDto
|
|||||||
protected ?int $duration = null;
|
protected ?int $duration = null;
|
||||||
protected array $status = [];
|
protected array $status = [];
|
||||||
protected bool $includePast = false;
|
protected bool $includePast = false;
|
||||||
|
protected ?string $country = null;
|
||||||
|
|
||||||
public function getId(): ?int
|
public function getId(): ?int
|
||||||
{
|
{
|
||||||
@@ -113,4 +114,16 @@ class AssignmentFilterDto extends AbstractFilterDto
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getCountry(): ?string
|
||||||
|
{
|
||||||
|
return $this->country;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setCountry(?string $country): static
|
||||||
|
{
|
||||||
|
$this->country = $country;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
return $qb->getQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
public function getBookmarkQueryForTeamer(Teamer $teamer): Query
|
||||||
|
|||||||
@@ -48,6 +48,9 @@ class ApplicationFilterHandler extends AbstractFilterHandler
|
|||||||
if (isset($data['include_past'])) {
|
if (isset($data['include_past'])) {
|
||||||
$filterDto->setIncludePast((bool) $data['include_past']);
|
$filterDto->setIncludePast((bool) $data['include_past']);
|
||||||
}
|
}
|
||||||
|
if (isset($data['country'])) {
|
||||||
|
$filterDto->setCountry($data['country']);
|
||||||
|
}
|
||||||
|
|
||||||
return $filterDto;
|
return $filterDto;
|
||||||
}
|
}
|
||||||
@@ -66,6 +69,7 @@ class ApplicationFilterHandler extends AbstractFilterHandler
|
|||||||
'duration' => $filterDto->getDuration(),
|
'duration' => $filterDto->getDuration(),
|
||||||
'status' => $filterDto->getStatus(),
|
'status' => $filterDto->getStatus(),
|
||||||
'include_past' => $filterDto->isIncludePast(),
|
'include_past' => $filterDto->isIncludePast(),
|
||||||
|
'country' => $filterDto->getCountry(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,9 @@ class AssignmentFilterHandler extends AbstractFilterHandler
|
|||||||
if (isset($data['include_past'])) {
|
if (isset($data['include_past'])) {
|
||||||
$filterDto->setIncludePast((bool) $data['include_past']);
|
$filterDto->setIncludePast((bool) $data['include_past']);
|
||||||
}
|
}
|
||||||
|
if (isset($data['country'])) {
|
||||||
|
$filterDto->setCountry($data['country']);
|
||||||
|
}
|
||||||
|
|
||||||
return $filterDto;
|
return $filterDto;
|
||||||
}
|
}
|
||||||
@@ -66,6 +69,7 @@ class AssignmentFilterHandler extends AbstractFilterHandler
|
|||||||
'duration' => $filterDto->getDuration(),
|
'duration' => $filterDto->getDuration(),
|
||||||
'status' => $filterDto->getStatus(),
|
'status' => $filterDto->getStatus(),
|
||||||
'include_past' => $filterDto->isIncludePast(),
|
'include_past' => $filterDto->isIncludePast(),
|
||||||
|
'country' => $filterDto->getCountry(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
{{ form_row(filterForm.jobProfiles) }}
|
{{ form_row(filterForm.jobProfiles) }}
|
||||||
{{ form_row(filterForm.hotels) }}
|
{{ form_row(filterForm.hotels) }}
|
||||||
{{ form_row(filterForm.duration) }}
|
{{ form_row(filterForm.duration) }}
|
||||||
|
{{ form_row(filterForm.country) }}
|
||||||
{{ form_row(filterForm.includePast) }}
|
{{ form_row(filterForm.includePast) }}
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center space-x-2">
|
<div class="flex items-center space-x-2">
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
{{ form_row(filterForm.jobProfiles) }}
|
{{ form_row(filterForm.jobProfiles) }}
|
||||||
{{ form_row(filterForm.hotels) }}
|
{{ form_row(filterForm.hotels) }}
|
||||||
{{ form_row(filterForm.duration) }}
|
{{ form_row(filterForm.duration) }}
|
||||||
|
{{ form_row(filterForm.country) }}
|
||||||
{{ form_row(filterForm.includePast) }}
|
{{ form_row(filterForm.includePast) }}
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center space-x-2">
|
<div class="flex items-center space-x-2">
|
||||||
|
|||||||
Reference in New Issue
Block a user