mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
[Export][List of accompanying periods] Add a list of persons, names and ids
This commit is contained in:
parent
0a2805f23f
commit
15a927a9f8
6
.changes/unreleased/Feature-20240122-124849.yaml
Normal file
6
.changes/unreleased/Feature-20240122-124849.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
kind: Feature
|
||||||
|
body: '[Export][List of accompanyign period] Add two columns: the list of persons
|
||||||
|
participating to the period, and their ids'
|
||||||
|
time: 2024-01-22T12:48:49.824833412+01:00
|
||||||
|
custom:
|
||||||
|
Issue: "241"
|
@ -18,6 +18,7 @@ use Chill\MainBundle\Export\Helper\ExportAddressHelper;
|
|||||||
use Chill\MainBundle\Export\Helper\UserHelper;
|
use Chill\MainBundle\Export\Helper\UserHelper;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
|
use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation;
|
||||||
use Chill\PersonBundle\Entity\Household\PersonHouseholdAddress;
|
use Chill\PersonBundle\Entity\Household\PersonHouseholdAddress;
|
||||||
use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
|
use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
|
||||||
use Chill\PersonBundle\Repository\PersonRepository;
|
use Chill\PersonBundle\Repository\PersonRepository;
|
||||||
@ -40,6 +41,8 @@ final readonly class ListAccompanyingPeriodHelper
|
|||||||
'closingDate',
|
'closingDate',
|
||||||
'referrer',
|
'referrer',
|
||||||
'referrerSince',
|
'referrerSince',
|
||||||
|
'acpParticipantPersons',
|
||||||
|
'acpParticipantPersonsIds',
|
||||||
'administrativeLocation',
|
'administrativeLocation',
|
||||||
'locationIsPerson',
|
'locationIsPerson',
|
||||||
'locationIsTemp',
|
'locationIsTemp',
|
||||||
@ -79,6 +82,7 @@ final readonly class ListAccompanyingPeriodHelper
|
|||||||
private TranslatableStringHelperInterface $translatableStringHelper,
|
private TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
private TranslatorInterface $translator,
|
private TranslatorInterface $translator,
|
||||||
private UserHelper $userHelper,
|
private UserHelper $userHelper,
|
||||||
|
private LabelPersonHelper $labelPersonHelper,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,7 +114,20 @@ final readonly class ListAccompanyingPeriodHelper
|
|||||||
return $this->translatableStringHelper->localize(json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR));
|
return $this->translatableStringHelper->localize(json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR));
|
||||||
},
|
},
|
||||||
'acpCreatedBy', 'acpUpdatedBy', 'referrer' => $this->userHelper->getLabel($key, $values, 'export.list.acp.'.$key),
|
'acpCreatedBy', 'acpUpdatedBy', 'referrer' => $this->userHelper->getLabel($key, $values, 'export.list.acp.'.$key),
|
||||||
'acpParticipantsPersons' => function ($value) {
|
|
||||||
|
'acpParticipantPersons' => $this->labelPersonHelper->getLabelMulti($key, $values, 'export.list.acp.'.$key),
|
||||||
|
'acpParticipantPersonsIds' => function ($value) use ($key): string {
|
||||||
|
if ('_header' === $value) {
|
||||||
|
return 'export.list.acp.'.$key;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null === $value || '' === $value) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$keys = json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR);
|
||||||
|
|
||||||
|
return implode('|', $keys);
|
||||||
},
|
},
|
||||||
'locationPersonName', 'requestorPerson' => function ($value) use ($key) {
|
'locationPersonName', 'requestorPerson' => function ($value) use ($key) {
|
||||||
if ('_header' === $value) {
|
if ('_header' === $value) {
|
||||||
@ -224,6 +241,11 @@ final readonly class ListAccompanyingPeriodHelper
|
|||||||
->addSelect(sprintf('%s_t.%s AS %s', $entity, $field, $entity));
|
->addSelect(sprintf('%s_t.%s AS %s', $entity, $field, $entity));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// persons
|
||||||
|
$qb
|
||||||
|
->addSelect(sprintf('(SELECT AGGREGATE(IDENTITY(participant_persons_n.person)) FROM %s participant_persons_n WHERE participant_persons_n.accompanyingPeriod = acp) AS acpParticipantPersons', AccompanyingPeriodParticipation::class))
|
||||||
|
->addSelect(sprintf('(SELECT AGGREGATE(IDENTITY(participant_persons_ids.person)) FROM %s participant_persons_ids WHERE participant_persons_ids.accompanyingPeriod = acp) AS acpParticipantPersonsIds', AccompanyingPeriodParticipation::class));
|
||||||
|
|
||||||
// step at date
|
// step at date
|
||||||
$qb
|
$qb
|
||||||
->addSelect('stepHistory.step AS step')
|
->addSelect('stepHistory.step AS step')
|
||||||
|
@ -1296,6 +1296,8 @@ export:
|
|||||||
socialIssues: Problématiques sociales
|
socialIssues: Problématiques sociales
|
||||||
requestorPerson: Demandeur (personne)
|
requestorPerson: Demandeur (personne)
|
||||||
requestorThirdParty: Demandeur (tiers)
|
requestorThirdParty: Demandeur (tiers)
|
||||||
|
acpParticipantPersons: Usagers concernés
|
||||||
|
acpParticipantPersonsIds: Usagers concernés (identifiants)
|
||||||
|
|
||||||
eval:
|
eval:
|
||||||
List of evaluations: Liste des évaluations
|
List of evaluations: Liste des évaluations
|
||||||
|
Loading…
x
Reference in New Issue
Block a user