mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Fix person list exports
This commit is contained in:
parent
a648fd09b0
commit
c79f030310
@ -16,6 +16,7 @@ use Chill\MainBundle\Export\Helper\ExportAddressHelper;
|
|||||||
use Chill\MainBundle\Repository\CenterRepositoryInterface;
|
use Chill\MainBundle\Repository\CenterRepositoryInterface;
|
||||||
use Chill\MainBundle\Repository\CivilityRepositoryInterface;
|
use Chill\MainBundle\Repository\CivilityRepositoryInterface;
|
||||||
use Chill\MainBundle\Repository\CountryRepository;
|
use Chill\MainBundle\Repository\CountryRepository;
|
||||||
|
use Chill\MainBundle\Repository\GenderRepository;
|
||||||
use Chill\MainBundle\Repository\LanguageRepositoryInterface;
|
use Chill\MainBundle\Repository\LanguageRepositoryInterface;
|
||||||
use Chill\MainBundle\Repository\UserRepositoryInterface;
|
use Chill\MainBundle\Repository\UserRepositoryInterface;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||||
@ -80,6 +81,7 @@ final readonly class ListPersonHelper
|
|||||||
private TranslatableStringHelper $translatableStringHelper,
|
private TranslatableStringHelper $translatableStringHelper,
|
||||||
private TranslatorInterface $translator,
|
private TranslatorInterface $translator,
|
||||||
private UserRepositoryInterface $userRepository,
|
private UserRepositoryInterface $userRepository,
|
||||||
|
private GenderRepository $genderRepository,
|
||||||
/**
|
/**
|
||||||
* @var iterable<CustomizeListPersonHelperInterface>
|
* @var iterable<CustomizeListPersonHelperInterface>
|
||||||
*/
|
*/
|
||||||
@ -173,6 +175,11 @@ final readonly class ListPersonHelper
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'gender':
|
||||||
|
$qb->addSelect('IDENTITY(person.gender) AS gender');
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
case 'maritalStatus':
|
case 'maritalStatus':
|
||||||
$qb->addSelect('IDENTITY(person.maritalStatus) AS maritalStatus');
|
$qb->addSelect('IDENTITY(person.maritalStatus) AS maritalStatus');
|
||||||
|
|
||||||
@ -325,7 +332,13 @@ final readonly class ListPersonHelper
|
|||||||
return $this->translator->trans($key);
|
return $this->translator->trans($key);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->translator->trans($value);
|
if (null === $value) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$gender = $this->genderRepository->find($value);
|
||||||
|
|
||||||
|
return $this->translatableStringHelper->localize($gender->getLabel());
|
||||||
};
|
};
|
||||||
|
|
||||||
case 'maritalStatus':
|
case 'maritalStatus':
|
||||||
|
@ -226,7 +226,8 @@ final class PersonControllerCreateTest extends WebTestCase
|
|||||||
) {
|
) {
|
||||||
$creationForm->get(self::FIRSTNAME_INPUT)->setValue($firstname.'_'.uniqid());
|
$creationForm->get(self::FIRSTNAME_INPUT)->setValue($firstname.'_'.uniqid());
|
||||||
$creationForm->get(self::LASTNAME_INPUT)->setValue($lastname.'_'.uniqid());
|
$creationForm->get(self::LASTNAME_INPUT)->setValue($lastname.'_'.uniqid());
|
||||||
$creationForm->get(self::GENDER_INPUT)->select('man');
|
// Todo change hardcoded id
|
||||||
|
$creationForm->get(self::GENDER_INPUT)->select(5);
|
||||||
$date = $birthdate ?? new \DateTime('1947-02-01');
|
$date = $birthdate ?? new \DateTime('1947-02-01');
|
||||||
$creationForm->get(self::BIRTHDATE_INPUT)->setValue($date->format('Y-m-d'));
|
$creationForm->get(self::BIRTHDATE_INPUT)->setValue($date->format('Y-m-d'));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user