feat: update filter value to be inversed
closes #869bhe07h
This commit is contained in:
@@ -63,8 +63,8 @@ class AssignmentFilterType extends AbstractType
|
|||||||
'label' => 'vergangene Einsätze anzeigen',
|
'label' => 'vergangene Einsätze anzeigen',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('syncedWithBusProNet', CheckboxType::class, [
|
->add('notSyncedWithBusProNet', CheckboxType::class, [
|
||||||
'label' => 'in BusProNet hinterlegt',
|
'label' => 'nicht in BusProNet hinterlegt',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('country', ChoiceType::class, [
|
->add('country', ChoiceType::class, [
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class AssignmentFilterDto extends AbstractFilterDto
|
|||||||
protected array $status = [];
|
protected array $status = [];
|
||||||
protected bool $includePast = false;
|
protected bool $includePast = false;
|
||||||
protected ?string $country = null;
|
protected ?string $country = null;
|
||||||
protected bool $syncedWithBusProNet = false;
|
protected bool $notSyncedWithBusProNet = false;
|
||||||
|
|
||||||
public function getId(): ?int
|
public function getId(): ?int
|
||||||
{
|
{
|
||||||
@@ -128,14 +128,14 @@ class AssignmentFilterDto extends AbstractFilterDto
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isSyncedWithBusProNet(): bool
|
public function isNotSyncedWithBusProNet(): bool
|
||||||
{
|
{
|
||||||
return $this->syncedWithBusProNet;
|
return $this->notSyncedWithBusProNet;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setSyncedWithBusProNet(bool $syncedWithBusProNet): static
|
public function setNotSyncedWithBusProNet(bool $notSyncedWithBusProNet): static
|
||||||
{
|
{
|
||||||
$this->syncedWithBusProNet = $syncedWithBusProNet;
|
$this->notSyncedWithBusProNet = $notSyncedWithBusProNet;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -186,10 +186,10 @@ class AssignmentRepository extends ServiceEntityRepository
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (true === $filterDto->isSyncedWithBusProNet()) {
|
if (true === $filterDto->isNotSyncedWithBusProNet()) {
|
||||||
$qb
|
$qb
|
||||||
->andWhere($qb->expr()->eq('disposition.syncedWithBusProNet', ':syncedWithBusProNet'))
|
->andWhere($qb->expr()->eq('disposition.syncedWithBusProNet', ':syncedWithBusProNet'))
|
||||||
->setParameter('syncedWithBusProNet', true)
|
->setParameter('syncedWithBusProNet', false)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ class AssignmentFilterHandler extends AbstractFilterHandler
|
|||||||
if (isset($data['country'])) {
|
if (isset($data['country'])) {
|
||||||
$filterDto->setCountry($data['country']);
|
$filterDto->setCountry($data['country']);
|
||||||
}
|
}
|
||||||
if (isset($data['synced_with_bus_pro_net'])) {
|
if (isset($data['not_synced_with_bus_pro_net'])) {
|
||||||
$filterDto->setSyncedWithBusProNet((bool) $data['synced_with_bus_pro_net']);
|
$filterDto->setNotSyncedWithBusProNet((bool) $data['not_synced_with_bus_pro_net']);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $filterDto;
|
return $filterDto;
|
||||||
@@ -73,7 +73,7 @@ class AssignmentFilterHandler extends AbstractFilterHandler
|
|||||||
'status' => $filterDto->getStatus(),
|
'status' => $filterDto->getStatus(),
|
||||||
'include_past' => $filterDto->isIncludePast(),
|
'include_past' => $filterDto->isIncludePast(),
|
||||||
'country' => $filterDto->getCountry(),
|
'country' => $filterDto->getCountry(),
|
||||||
'synced_with_bus_pro_net' => $filterDto->isSyncedWithBusProNet(),
|
'not_synced_with_bus_pro_net' => $filterDto->isNotSyncedWithBusProNet(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
{{ form_row(filterForm.country) }}
|
{{ form_row(filterForm.country) }}
|
||||||
<div class="grid grid-cols-2 gap-x-4 gap-y-2">
|
<div class="grid grid-cols-2 gap-x-4 gap-y-2">
|
||||||
{{ form_row(filterForm.includePast) }}
|
{{ form_row(filterForm.includePast) }}
|
||||||
{{ form_row(filterForm.syncedWithBusProNet) }}
|
{{ form_row(filterForm.notSyncedWithBusProNet) }}
|
||||||
</div>
|
</div>
|
||||||
</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