mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Merge remote-tracking branch 'origin/issue267_filter_household_of_the_person'
This commit is contained in:
commit
0aef40f23f
@ -11,8 +11,9 @@ and this project adheres to
|
|||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
<!-- write down unreleased development here -->
|
<!-- write down unreleased development here -->
|
||||||
* [main] fix adding multiple AddresseDeRelais (combine PickAddressType with ChillCollection)
|
|
||||||
|
|
||||||
|
* [main] fix adding multiple AddresseDeRelais (combine PickAddressType with ChillCollection)
|
||||||
|
* [person]: do not suggest the current household of the person (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/51)
|
||||||
* unnecessary whitespace removed from person banner after person-id + double parentheses removed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/290)
|
* unnecessary whitespace removed from person banner after person-id + double parentheses removed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/290)
|
||||||
* [person]: delete accompanying period work, including related objects (cascade) (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/36)
|
* [person]: delete accompanying period work, including related objects (cascade) (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/36)
|
||||||
* [address]: Display of incomplete address adjusted.
|
* [address]: Display of incomplete address adjusted.
|
||||||
|
@ -47,13 +47,22 @@ class HouseholdApiController extends ApiController
|
|||||||
$count = $this->householdRepository->countByAccompanyingPeriodParticipation($person);
|
$count = $this->householdRepository->countByAccompanyingPeriodParticipation($person);
|
||||||
$paginator = $this->getPaginatorFactory()->create($count);
|
$paginator = $this->getPaginatorFactory()->create($count);
|
||||||
|
|
||||||
if ($count === 0) {
|
|
||||||
$households = [];
|
$households = [];
|
||||||
} else {
|
if ($count !== 0) {
|
||||||
$households = $this->householdRepository->findByAccompanyingPeriodParticipation($person,
|
$allHouseholds = $this->householdRepository->findByAccompanyingPeriodParticipation($person,
|
||||||
$paginator->getItemsPerPage(), $paginator->getCurrentPageFirstItemNumber());
|
$paginator->getItemsPerPage(), $paginator->getCurrentPageFirstItemNumber());
|
||||||
}
|
$currentHouseholdPerson = $person->getCurrentHousehold();
|
||||||
|
|
||||||
|
foreach ($allHouseholds as $h) {
|
||||||
|
if ($h !== $currentHouseholdPerson) {
|
||||||
|
array_push($households, $h);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (null !== $currentHouseholdPerson) {
|
||||||
|
$count = $count - 1;
|
||||||
|
$paginator = $this->getPaginatorFactory()->create($count);
|
||||||
|
}
|
||||||
|
}
|
||||||
$collection = new Collection($households, $paginator);
|
$collection = new Collection($households, $paginator);
|
||||||
|
|
||||||
return $this->json($collection, Response::HTTP_OK, [],
|
return $this->json($collection, Response::HTTP_OK, [],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user