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',
|
||||
'required' => false,
|
||||
])
|
||||
->add('syncedWithBusProNet', CheckboxType::class, [
|
||||
'label' => 'in BusProNet hinterlegt',
|
||||
->add('notSyncedWithBusProNet', CheckboxType::class, [
|
||||
'label' => 'nicht in BusProNet hinterlegt',
|
||||
'required' => false,
|
||||
])
|
||||
->add('country', ChoiceType::class, [
|
||||
|
||||
@@ -18,7 +18,7 @@ class AssignmentFilterDto extends AbstractFilterDto
|
||||
protected array $status = [];
|
||||
protected bool $includePast = false;
|
||||
protected ?string $country = null;
|
||||
protected bool $syncedWithBusProNet = false;
|
||||
protected bool $notSyncedWithBusProNet = false;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
@@ -128,14 +128,14 @@ class AssignmentFilterDto extends AbstractFilterDto
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -186,10 +186,10 @@ class AssignmentRepository extends ServiceEntityRepository
|
||||
;
|
||||
}
|
||||
|
||||
if (true === $filterDto->isSyncedWithBusProNet()) {
|
||||
if (true === $filterDto->isNotSyncedWithBusProNet()) {
|
||||
$qb
|
||||
->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'])) {
|
||||
$filterDto->setCountry($data['country']);
|
||||
}
|
||||
if (isset($data['synced_with_bus_pro_net'])) {
|
||||
$filterDto->setSyncedWithBusProNet((bool) $data['synced_with_bus_pro_net']);
|
||||
if (isset($data['not_synced_with_bus_pro_net'])) {
|
||||
$filterDto->setNotSyncedWithBusProNet((bool) $data['not_synced_with_bus_pro_net']);
|
||||
}
|
||||
|
||||
return $filterDto;
|
||||
@@ -73,7 +73,7 @@ class AssignmentFilterHandler extends AbstractFilterHandler
|
||||
'status' => $filterDto->getStatus(),
|
||||
'include_past' => $filterDto->isIncludePast(),
|
||||
'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) }}
|
||||
<div class="grid grid-cols-2 gap-x-4 gap-y-2">
|
||||
{{ form_row(filterForm.includePast) }}
|
||||
{{ form_row(filterForm.syncedWithBusProNet) }}
|
||||
{{ form_row(filterForm.notSyncedWithBusProNet) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center space-x-2">
|
||||
|
||||
Reference in New Issue
Block a user