diff --git a/db/migrations/20260604080000_add_genre_to_users_speakers_and_tickets.php b/db/migrations/20260604080000_add_genre_to_users_speakers_and_tickets.php new file mode 100644 index 000000000..ebb62193b --- /dev/null +++ b/db/migrations/20260604080000_add_genre_to_users_speakers_and_tickets.php @@ -0,0 +1,68 @@ +table('afup_personnes_physiques') + ->addColumn('genre', 'string', [ + 'null' => true, + 'after' => 'civilite', + 'limit' => MysqlAdapter::TEXT_TINY, + ]) + ->save(); + + $this->query(<<table('afup_conferenciers') + ->addColumn('genre', 'string', [ + 'null' => true, + 'after' => 'civilite', + 'limit' => MysqlAdapter::TEXT_TINY, + ]) + ->save(); + + $this->query(<<table('afup_inscription_forum') + ->addColumn('genre', 'string', [ + 'null' => true, + 'after' => 'civilite', + 'limit' => MysqlAdapter::TEXT_TINY, + ]) + ->save(); + + $this->query(<< self::ID_CONFERENCIER, 'id_forum' => Event::ID_FORUM, - 'civilite' => 'M.', + 'genre' => Genre::Homme->value, 'nom' => 'Bachelet', 'prenom' => 'Geoffrey', 'email' => 'foo@bar.baz', @@ -34,7 +35,7 @@ public function run(): void [ 'conferencier_id' => 2, 'id_forum' => Event::ID_FORUM, - 'civilite' => 'M.', + 'genre' => Genre::Homme->value, 'nom' => 'Gallou', 'prenom' => 'Adrien', 'email' => 'foo@bar.baz', @@ -54,7 +55,7 @@ public function run(): void [ 'conferencier_id' => 3, 'id_forum' => Event::ID_FORUM, - 'civilite' => 'M.', + 'genre' => Genre::Homme->value, 'nom' => 'Doe', 'prenom' => 'John', 'email' => 'john.do@bar.baz', diff --git a/db/seeds/Inscriptions.php b/db/seeds/Inscriptions.php index 982741725..f3bcc018e 100644 --- a/db/seeds/Inscriptions.php +++ b/db/seeds/Inscriptions.php @@ -2,6 +2,7 @@ declare(strict_types=1); +use AppBundle\Association\Genre; use AppBundle\Association\MemberType; use AppBundle\Event\Model\Ticket; use Phinx\Seed\AbstractSeed; @@ -17,7 +18,7 @@ public function run(): void 'reference' => 'REF-TEST-001', 'type_inscription' => Tarif::TYPE_2_DAYS['id'], 'montant' => Tarif::TYPE_2_DAYS['default_price'], - 'civilite' => 'Mme', + 'genre' => Genre::Femme->value, 'nom' => 'Michu', 'prenom' => 'Bernadette', 'email' => 'bernadette@yahoo.fr', @@ -34,7 +35,7 @@ public function run(): void 'reference' => 'REF-TEST-002', 'type_inscription' => Tarif::TYPE_2_DAYS['id'], 'montant' => Tarif::TYPE_2_DAYS['default_price'], - 'civilite' => 'Mme', + 'genre' => Genre::Femme->value, 'nom' => 'Jean', 'prenom' => 'Maurice', 'email' => 'jean@yahoo.fr', @@ -51,7 +52,7 @@ public function run(): void 'reference' => 'REF-TEST-003', 'type_inscription' => Tarif::TYPE_2_DAYS['id'], 'montant' => Tarif::TYPE_2_DAYS['default_price'], - 'civilite' => 'Mme', + 'genre' => Genre::Femme->value, 'nom' => 'Kirk', 'prenom' => 'James Tiberius', 'email' => 'james@starfleet.fr', @@ -68,7 +69,7 @@ public function run(): void 'reference' => 'REF-TEST-004', 'type_inscription' => Tarif::TYPE_2_DAYS_AFUP['id'], 'montant' => Tarif::TYPE_2_DAYS_AFUP['default_price'], - 'civilite' => 'Mme', + 'genre' => Genre::Femme->value, 'nom' => 'Sans', 'prenom' => 'Cotisation', 'email' => 'sans@cotisation.fr', @@ -85,7 +86,7 @@ public function run(): void 'reference' => 'REF-TEST-005', 'type_inscription' => Tarif::TYPE_2_DAYS_AFUP['id'], 'montant' => Tarif::TYPE_2_DAYS_AFUP['default_price'], - 'civilite' => 'M', + 'genre' => Genre::Homme->value, 'nom' => 'Personne', 'prenom' => 'Paul', 'email' => 'paul.personne@mycorp.fr', @@ -103,7 +104,7 @@ public function run(): void 'reference' => 'REF-TEST-006', 'type_inscription' => Tarif::TYPE_2_DAYS_AFUP['id'], 'montant' => Tarif::TYPE_2_DAYS_AFUP['default_price'], - 'civilite' => 'M', + 'genre' => Genre::Homme->value, 'nom' => 'Maurice', 'prenom' => 'Jean', 'email' => 'userexpire@yahoo.fr', @@ -121,7 +122,7 @@ public function run(): void 'reference' => 'REF-TEST-007', 'type_inscription' => Tarif::TYPE_2_DAYS['id'], 'montant' => Tarif::TYPE_2_DAYS['default_price'], - 'civilite' => 'Mme', + 'genre' => Genre::Femme->value, 'nom' => 'Annulé', 'prenom' => 'Lepaiement', 'email' => 'annule@example.com', @@ -138,7 +139,7 @@ public function run(): void 'reference' => 'REF-TEST-008', 'type_inscription' => Tarif::TYPE_ORGANIZATION['id'], 'montant' => Tarif::TYPE_ORGANIZATION['default_price'], - 'civilite' => 'Mme', + 'genre' => Genre::Femme->value, 'nom' => 'Super', 'prenom' => 'Bénévole', 'email' => 'benevole@example.com', diff --git a/db/seeds/Users.php b/db/seeds/Users.php index 40ed8561c..91369930a 100644 --- a/db/seeds/Users.php +++ b/db/seeds/Users.php @@ -24,7 +24,6 @@ public function run(): void $data = [ [ 'id' => self::ID_PERSONNE_MORALE_MY_CORP, - 'civilite' => '1', 'nom' => 'Dupont', 'prenom' => 'Raoul', 'email' => 'raoul.dupont@mycorp.fr', @@ -40,7 +39,6 @@ public function run(): void ], [ 'id' => self::ID_PERSONNE_MORALE_HELIOS_AEROSPACE, - 'civilite' => '1', 'nom' => 'Ayesa', 'prenom' => 'Dev', 'email' => 'dev.ayesa@helios-aerospace.com', diff --git a/sources/AppBundle/Association/Factory/UserFactory.php b/sources/AppBundle/Association/Factory/UserFactory.php index f32a7f430..c5c1a5c1c 100644 --- a/sources/AppBundle/Association/Factory/UserFactory.php +++ b/sources/AppBundle/Association/Factory/UserFactory.php @@ -14,7 +14,6 @@ public function createForRegister(): User return $user - ->setCivility(User::CIVILITE_M) ->setCountry('FR') ->setLevel(User::LEVEL_MEMBER) ->setStatus(User::STATUS_ACTIVE) diff --git a/sources/AppBundle/Association/Form/RegisterUserType.php b/sources/AppBundle/Association/Form/RegisterUserType.php index c269bc29e..8d71c38a4 100644 --- a/sources/AppBundle/Association/Form/RegisterUserType.php +++ b/sources/AppBundle/Association/Form/RegisterUserType.php @@ -4,10 +4,11 @@ namespace AppBundle\Association\Form; +use AppBundle\Association\Genre; use AppBundle\Association\Model\User; use Symfony\Component\Form\AbstractType; -use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\CountryType; +use Symfony\Component\Form\Extension\Core\Type\EnumType; use Symfony\Component\Form\Extension\Core\Type\TelType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; @@ -33,9 +34,12 @@ public function buildForm(FormBuilderInterface $builder, array $options): void ->add('nearestOffice', NearestOfficeChoiceType::class, [ 'required' => false, ]) - ->add('civility', ChoiceType::class, [ - 'choices' => ['M.' => User::CIVILITE_M, 'Mme' => User::CIVILITE_MME], - 'required' => true, + ->add('genre', EnumType::class, [ + 'required' => false, + 'class' => Genre::class, + 'label' => 'Genre', + 'placeholder' => 'Ne se prononce pas', + 'choice_label' => fn(Genre $genre): string => $genre->label(), ]) ; diff --git a/sources/AppBundle/Association/Form/UserEditFormData.php b/sources/AppBundle/Association/Form/UserEditFormData.php index c2ac9aabc..c6c495718 100644 --- a/sources/AppBundle/Association/Form/UserEditFormData.php +++ b/sources/AppBundle/Association/Form/UserEditFormData.php @@ -4,6 +4,7 @@ namespace AppBundle\Association\Form; +use AppBundle\Association\Genre; use AppBundle\Association\Model\Repository\UserRepository; use AppBundle\Association\Model\User; use AppBundle\Validator\Constraints as AppAssert; @@ -15,9 +16,7 @@ class UserEditFormData { public $companyId; - #[Assert\NotBlank] - #[Assert\Choice(choices: ['M.', 'Mme'], strict: true)] - public $civility = 'M.'; + public ?Genre $genre = null; #[Assert\NotBlank] public $lastname; #[Assert\NotBlank] diff --git a/sources/AppBundle/Association/Form/UserEditType.php b/sources/AppBundle/Association/Form/UserEditType.php index 77edc069b..70383b72f 100644 --- a/sources/AppBundle/Association/Form/UserEditType.php +++ b/sources/AppBundle/Association/Form/UserEditType.php @@ -5,6 +5,7 @@ namespace AppBundle\Association\Form; use Afup\Site\Utils\Pays; +use AppBundle\Association\Genre; use AppBundle\Association\Model\Repository\CompanyMemberRepository; use AppBundle\Association\Model\User; use Symfony\Component\Form\AbstractType; @@ -12,6 +13,7 @@ use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\EmailType; +use Symfony\Component\Form\Extension\Core\Type\EnumType; use Symfony\Component\Form\Extension\Core\Type\PasswordType; use Symfony\Component\Form\Extension\Core\Type\RepeatedType; use Symfony\Component\Form\Extension\Core\Type\SubmitType; @@ -32,17 +34,18 @@ public function __construct( public function buildForm(FormBuilderInterface $builder, array $options): void { - $civilities = ['M.', 'Mme']; $builder ->add('companyId', ChoiceType::class, [ 'label' => 'Personne morale', 'required' => false, 'choices' => array_flip($this->companyMemberRepository->getList()), ]) - ->add('civility', ChoiceType::class, [ - 'label' => 'Civilité', - 'required' => true, - 'choices' => array_combine($civilities, $civilities), + ->add('genre', EnumType::class, [ + 'required' => false, + 'class' => Genre::class, + 'label' => 'Genre', + 'placeholder' => 'Ne se prononce pas', + 'choice_label' => fn(Genre $genre): string => $genre->label(), ]) ->add('lastname', TextType::class, [ 'label' => 'Nom', diff --git a/sources/AppBundle/Association/Genre.php b/sources/AppBundle/Association/Genre.php new file mode 100644 index 000000000..5cb5ef4fc --- /dev/null +++ b/sources/AppBundle/Association/Genre.php @@ -0,0 +1,21 @@ + 'Femme', + self::Homme => 'Homme', + self::NonBinaire => 'Non-binaire', + }; + } +} diff --git a/sources/AppBundle/Association/Model/Repository/UserRepository.php b/sources/AppBundle/Association/Model/Repository/UserRepository.php index 28fc1559a..ab52ff31f 100644 --- a/sources/AppBundle/Association/Model/Repository/UserRepository.php +++ b/sources/AppBundle/Association/Model/Repository/UserRepository.php @@ -4,6 +4,7 @@ namespace AppBundle\Association\Model\Repository; +use AppBundle\Association\Genre; use AppBundle\Association\MemberType; use AppBundle\Association\Model\CompanyMember; use AppBundle\Association\Model\User; @@ -15,6 +16,7 @@ use CCMBenchmark\Ting\Repository\Metadata; use CCMBenchmark\Ting\Repository\MetadataInitializer; use CCMBenchmark\Ting\Repository\Repository; +use CCMBenchmark\Ting\Serializer\BackedEnum; use CCMBenchmark\Ting\Serializer\SerializerFactoryInterface; use Exception; use InvalidArgumentException; @@ -375,7 +377,7 @@ private function getQueryBuilderWithCompleteUser() ->getQueryBuilderWithSubscriptions() ->cols([ 'app.`id`', 'app.`id_personne_morale`', 'app.`login`', 'app.`mot_de_passe`', 'app.`niveau`', - 'app.`niveau_modules`', 'app.`roles`', 'app.`civilite`', 'app.`nom`', 'app.`prenom`', 'app.`email`', + 'app.`niveau_modules`', 'app.`roles`', 'app.`genre`', 'app.`nom`', 'app.`prenom`', 'app.`email`', 'app.`adresse`', 'app.`code_postal`', 'app.`ville`', 'app.`id_pays`', 'app.`telephone_fixe`', 'app.`telephone_portable`', 'app.`etat`', 'app.`date_relance`', 'app.`compte_svn`', 'app.`slack_invite_status`', 'app.`slack_alternate_email`', 'app.`needs_up_to_date_membership`', @@ -508,9 +510,13 @@ public static function initMetadata(SerializerFactoryInterface $serializerFactor 'type' => 'string', ]) ->addField([ - 'columnName' => 'civilite', - 'fieldName' => 'civility', - 'type' => 'string', + 'columnName' => 'genre', + 'fieldName' => 'genre', + 'type' => 'enum', + 'serializer' => BackedEnum::class, + 'serializer_options' => [ + 'unserialize' => ['enum' => Genre::class], + ], ]) ->addField([ 'columnName' => 'prenom', diff --git a/sources/AppBundle/Association/Model/User.php b/sources/AppBundle/Association/Model/User.php index cb512e021..c9fcc5abb 100644 --- a/sources/AppBundle/Association/Model/User.php +++ b/sources/AppBundle/Association/Model/User.php @@ -5,6 +5,7 @@ namespace AppBundle\Association\Model; use AppBundle\Antennes\AntenneRepository; +use AppBundle\Association\Genre; use AppBundle\Association\Model\Repository\UserRepository; use AppBundle\Association\NotifiableInterface; use AppBundle\Model\HasUniqueId; @@ -31,9 +32,6 @@ class User implements NotifyPropertyInterface, NotifiableInterface, UserInterfac public const SLACK_INVITE_STATUS_NONE = 0; public const SLACK_INVITE_STATUS_REQUESTED = 1; - public const CIVILITE_M = 0; - public const CIVILITE_MME = 1; - /** * @var int */ @@ -69,10 +67,7 @@ class User implements NotifyPropertyInterface, NotifiableInterface, UserInterfac */ private $roles = []; - /** - * @var string - */ - private $civility; + private ?Genre $genre = null; /** * @var string @@ -317,22 +312,15 @@ public function setLevelModules($levelModules): self return $this; } - /** - * @return string - */ - public function getCivility() + public function getGenre(): ?Genre { - return $this->civility; + return $this->genre; } - /** - * @param string $civility - */ - public function setCivility($civility): self + public function setGenre(?Genre $genre): void { - $this->propertyChanged('civility', $this->civility, $civility); - $this->civility = $civility; - return $this; + $this->propertyChanged('genre', $this->genre, $genre); + $this->genre = $genre; } /** diff --git a/sources/AppBundle/Controller/Admin/Members/UserAddAction.php b/sources/AppBundle/Controller/Admin/Members/UserAddAction.php index 0ef81a263..17a5cb6a6 100644 --- a/sources/AppBundle/Controller/Admin/Members/UserAddAction.php +++ b/sources/AppBundle/Controller/Admin/Members/UserAddAction.php @@ -12,7 +12,6 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface; class UserAddAction extends AbstractController @@ -26,15 +25,8 @@ public function __construct( public function __invoke(Request $request): Response { - /** @var Session $session */ - $session = $request->getSession(); - if ($session->has('generer_personne_physique')) { - $user = $this->fromSession($session->get('generer_personne_physique')); - $session->remove('generer_personne_physique'); - } else { - $user = new User(); - $user->setRoles([]); - } + $user = new User(); + $user->setRoles([]); $form = $this->createForm(UserEditType::class, $user); $form->handleRequest($request); @@ -60,23 +52,4 @@ public function __invoke(Request $request): Response 'form' => $form->createView(), ]); } - - private function fromSession(array $session): User - { - $user = new User(); - - $user->setCity($session['civilite']); - $user->setLastname($session['nom']); - $user->setFirstname($session['prenom']); - $user->setEmail($session['email']); - $user->setAddress($session['adresse']); - $user->setZipCode($session['code_postal']); - $user->setCity($session['ville']); - $user->setCountry($session['id_pays']); - $user->setPhone($session['telephone_fixe']); - $user->setMobilephone($session['telephone_portable']); - $user->setStatus($session['etat']); - - return $user; - } } diff --git a/sources/AppBundle/Controller/Admin/Speaker/SpeakerAddAction.php b/sources/AppBundle/Controller/Admin/Speaker/SpeakerAddAction.php index 2ee2e8ecb..121e4c933 100644 --- a/sources/AppBundle/Controller/Admin/Speaker/SpeakerAddAction.php +++ b/sources/AppBundle/Controller/Admin/Speaker/SpeakerAddAction.php @@ -37,7 +37,7 @@ public function __invoke(Request $request): Response if ($form->isSubmitted() && $form->isValid()) { $speaker = new Speaker(); $speaker->setEventId($event->getId()); - $speaker->setCivility($data->civility); + $speaker->setGenre($data->genre); $speaker->setFirstname($data->firstname); $speaker->setLastname($data->lastname); $speaker->setBiography($data->biography); diff --git a/sources/AppBundle/Controller/Admin/Speaker/SpeakerEditAction.php b/sources/AppBundle/Controller/Admin/Speaker/SpeakerEditAction.php index 8b85eee0a..465863e01 100644 --- a/sources/AppBundle/Controller/Admin/Speaker/SpeakerEditAction.php +++ b/sources/AppBundle/Controller/Admin/Speaker/SpeakerEditAction.php @@ -59,7 +59,7 @@ public function __invoke(Request $request) } $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { - $speaker->setCivility($data->civility); + $speaker->setGenre($data->genre); $speaker->setFirstname($data->firstname); $speaker->setLastname($data->lastname); $speaker->setBiography($data->biography); diff --git a/sources/AppBundle/Controller/Admin/Speaker/SpeakerRegisterAction.php b/sources/AppBundle/Controller/Admin/Speaker/SpeakerRegisterAction.php index a64ad3925..1243da411 100644 --- a/sources/AppBundle/Controller/Admin/Speaker/SpeakerRegisterAction.php +++ b/sources/AppBundle/Controller/Admin/Speaker/SpeakerRegisterAction.php @@ -11,6 +11,7 @@ use AppBundle\Event\Model\Repository\SpeakerRepository; use AppBundle\Event\Model\Repository\TalkRepository; use AppBundle\Event\Model\Repository\TicketRepository; +use AppBundle\Event\Model\Speaker; use AppBundle\Event\Model\Talk; use AppBundle\Event\Model\Ticket; use DateTime; @@ -41,6 +42,7 @@ public function __invoke(Request $request, AdminEventSelection $eventSelection): continue; } + /** @var array $speakers */ $speakers = $this->speakerRepository->getSpeakersByTalk($talkAggregate->talk); foreach ($speakers as $speaker) { @@ -57,7 +59,7 @@ public function __invoke(Request $request, AdminEventSelection $eventSelection): $ticket->setForumId($event->getId()); $ticket->setReference($reference); $ticket->setTicketTypeId(Ticket::TYPE_SPEAKER); - $ticket->setCivility($speaker->getCivility()); + $ticket->setGenre($speaker->getGenre()); $ticket->setLastname($speaker->getLastname()); $ticket->setFirstname($speaker->getFirstname()); $ticket->setEmail($speaker->getEmail()); diff --git a/sources/AppBundle/Controller/Website/Membership/MemberInvitationAction.php b/sources/AppBundle/Controller/Website/Membership/MemberInvitationAction.php index ab82575ec..cd5cf2d41 100644 --- a/sources/AppBundle/Controller/Website/Membership/MemberInvitationAction.php +++ b/sources/AppBundle/Controller/Website/Membership/MemberInvitationAction.php @@ -49,7 +49,6 @@ public function __invoke(Request $request, int $invitationId, string $token): Re * @var User $user */ $user = $userForm->getData(); - $user->setCivility(''); $hash = $this->passwordHasher->hashPassword($user, $user->getPassword()); $user->setPassword($hash); $user diff --git a/sources/AppBundle/Event/Form/SpeakerFormData.php b/sources/AppBundle/Event/Form/SpeakerFormData.php index 3ea0c5e9d..0a57696f6 100644 --- a/sources/AppBundle/Event/Form/SpeakerFormData.php +++ b/sources/AppBundle/Event/Form/SpeakerFormData.php @@ -4,17 +4,15 @@ namespace AppBundle\Event\Form; +use AppBundle\Association\Genre; use AppBundle\Event\Model\GithubUser; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\Validator\Constraints as Assert; class SpeakerFormData { - /** - * @var string - */ - #[Assert\NotBlank] - public $civility; + public ?Genre $genre = null; + /** * @var string */ diff --git a/sources/AppBundle/Event/Form/SpeakerFormDataFactory.php b/sources/AppBundle/Event/Form/SpeakerFormDataFactory.php index 0d81b19f9..525d420f4 100644 --- a/sources/AppBundle/Event/Form/SpeakerFormDataFactory.php +++ b/sources/AppBundle/Event/Form/SpeakerFormDataFactory.php @@ -11,7 +11,7 @@ class SpeakerFormDataFactory public function fromSpeaker(Speaker $speaker): SpeakerFormData { $data = new SpeakerFormData(); - $data->civility = $speaker->getCivility(); + $data->genre = $speaker->getGenre(); $data->firstname = $speaker->getFirstname(); $data->lastname = $speaker->getLastname(); $data->email = $speaker->getEmail(); diff --git a/sources/AppBundle/Event/Form/SpeakerType.php b/sources/AppBundle/Event/Form/SpeakerType.php index e5fcd285f..0c3afde9f 100644 --- a/sources/AppBundle/Event/Form/SpeakerType.php +++ b/sources/AppBundle/Event/Form/SpeakerType.php @@ -4,6 +4,7 @@ namespace AppBundle\Event\Form; +use AppBundle\Association\Genre; use AppBundle\Event\Model\GithubUser; use AppBundle\Event\Model\Repository\GithubUserRepository; use AppBundle\Event\Model\Repository\SpeakerRepository; @@ -12,6 +13,7 @@ use Symfony\Component\Form\ChoiceList\Loader\CallbackChoiceLoader; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\EmailType; +use Symfony\Component\Form\Extension\Core\Type\EnumType; use Symfony\Component\Form\Extension\Core\Type\FileType; use Symfony\Component\Form\Extension\Core\Type\HiddenType; use Symfony\Component\Form\Extension\Core\Type\SubmitType; @@ -39,7 +41,13 @@ public function __construct( public function buildForm(FormBuilderInterface $builder, array $options): void { $builder - ->add('civility', ChoiceType::class, ['choices' => ['M' => 'M', 'Mme' => 'Mme']]) + ->add('genre', EnumType::class, [ + 'required' => false, + 'class' => Genre::class, + 'label' => 'Genre', + 'placeholder' => 'Ne se prononce pas', + 'choice_label' => fn(Genre $genre): string => $genre->label(), + ]) ->add('firstname', TextType::class) ->add('lastname', TextType::class) ->add('email', EmailType::class) @@ -93,7 +101,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void if ($user instanceof GithubUser && $speaker instanceof Speaker && $speaker->getId() === null) { $previousSpeakerInfos = $this->speakerRepository->getFromLastEventAndUserId($speaker->getEventId(), $user->getId()); if ($previousSpeakerInfos instanceof Speaker) { - $speaker->setCivility($previousSpeakerInfos->getCivility()); + $speaker->setGenre($previousSpeakerInfos->getGenre()); $speaker->setFirstname($previousSpeakerInfos->getFirstname()); $speaker->setLastname($previousSpeakerInfos->getLastname()); $speaker->setEmail($previousSpeakerInfos->getEmail()); diff --git a/sources/AppBundle/Event/Form/SponsorTicketType.php b/sources/AppBundle/Event/Form/SponsorTicketType.php index 4024c1f08..8a7118115 100644 --- a/sources/AppBundle/Event/Form/SponsorTicketType.php +++ b/sources/AppBundle/Event/Form/SponsorTicketType.php @@ -4,10 +4,12 @@ namespace AppBundle\Event\Form; +use AppBundle\Association\Genre; use AppBundle\Event\Model\Ticket; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\EmailType; +use Symfony\Component\Form\Extension\Core\Type\EnumType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -18,12 +20,12 @@ class SponsorTicketType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options): void { $builder - ->add('civility', ChoiceType::class, [ - 'label' => 'Civilité', - 'choices' => [ - 'M.' => 'M.', - 'Mme' => 'Mme', - ], + ->add('genre', EnumType::class, [ + 'required' => false, + 'class' => Genre::class, + 'label' => 'Genre', + 'placeholder' => 'Ne se prononce pas', + 'choice_label' => fn(Genre $genre): string => $genre->label(), ]) ->add('firstname', TextType::class, [ 'label' => 'Prénom', diff --git a/sources/AppBundle/Event/Form/TicketAdminType.php b/sources/AppBundle/Event/Form/TicketAdminType.php index afd1eab83..21449c979 100644 --- a/sources/AppBundle/Event/Form/TicketAdminType.php +++ b/sources/AppBundle/Event/Form/TicketAdminType.php @@ -4,6 +4,7 @@ namespace AppBundle\Event\Form; +use AppBundle\Association\Genre; use AppBundle\Event\Model\Event; use AppBundle\Event\Model\Ticket; use AppBundle\Event\Model\TicketOffer; @@ -12,6 +13,7 @@ use Symfony\Component\Form\CallbackTransformer; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\EmailType; +use Symfony\Component\Form\Extension\Core\Type\EnumType; use Symfony\Component\Form\Extension\Core\Type\TextareaType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; @@ -44,12 +46,12 @@ public function buildForm(FormBuilderInterface $builder, array $options): void usort($ticketOffers, static fn(TicketOffer $a, TicketOffer $b) => $a->name > $b->name ? 1 : -1); $builder - ->add('civility', ChoiceType::class, [ - 'label' => 'Civilité', - 'choices' => [ - 'M.' => 'M.', - 'Mme' => 'Mme', - ], + ->add('genre', EnumType::class, [ + 'required' => false, + 'class' => Genre::class, + 'label' => 'Genre', + 'placeholder' => 'Ne se prononce pas', + 'choice_label' => fn(Genre $genre): string => $genre->label(), ]) ->add('firstname', TextType::class, [ 'label' => 'Prénom', diff --git a/sources/AppBundle/Event/Form/TicketType.php b/sources/AppBundle/Event/Form/TicketType.php index cd16e2eca..907b51622 100644 --- a/sources/AppBundle/Event/Form/TicketType.php +++ b/sources/AppBundle/Event/Form/TicketType.php @@ -5,6 +5,7 @@ namespace AppBundle\Event\Form; use AppBundle\Antennes\AntenneRepository; +use AppBundle\Association\Genre; use AppBundle\Event\Model\Repository\EventRepository; use AppBundle\Event\Model\Repository\TicketEventTypeRepository; use AppBundle\Event\Model\Repository\TicketSpecialPriceRepository; @@ -16,6 +17,7 @@ use Symfony\Component\Form\Exception\RuntimeException; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\EmailType; +use Symfony\Component\Form\Extension\Core\Type\EnumType; use Symfony\Component\Form\Extension\Core\Type\HiddenType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; @@ -52,12 +54,12 @@ public function buildForm(FormBuilderInterface $builder, array $options): void } $builder - ->add('civility', ChoiceType::class, [ - 'label' => 'Civilité', - 'choices' => [ - 'M.' => 'M.', - 'Mme' => 'Mme', - ], + ->add('genre', EnumType::class, [ + 'required' => false, + 'class' => Genre::class, + 'label' => 'Genre', + 'placeholder' => 'Ne se prononce pas', + 'choice_label' => fn(Genre $genre): string => $genre->label(), ]) ->add('firstname', TextType::class, [ 'label' => 'Prénom', diff --git a/sources/AppBundle/Event/Model/Repository/InvoiceRepository.php b/sources/AppBundle/Event/Model/Repository/InvoiceRepository.php index e92f4bd3a..10eec2934 100644 --- a/sources/AppBundle/Event/Model/Repository/InvoiceRepository.php +++ b/sources/AppBundle/Event/Model/Repository/InvoiceRepository.php @@ -95,7 +95,7 @@ public function getPendingBankwires(Event $event) 'invoices.id_forum', 'invoices.date_facture', 'inscriptions.id', 'inscriptions.date', 'inscriptions.reference', 'inscriptions.coupon', 'inscriptions.type_inscription', - 'inscriptions.montant', 'inscriptions.informations_reglement', 'inscriptions.civilite', 'inscriptions.nom', 'inscriptions.prenom', + 'inscriptions.montant', 'inscriptions.informations_reglement', 'inscriptions.genre', 'inscriptions.nom', 'inscriptions.prenom', 'inscriptions.email', 'inscriptions.telephone', 'inscriptions.citer_societe', 'inscriptions.newsletter_afup', 'inscriptions.commentaires', 'inscriptions.etat', 'inscriptions.facturation', 'inscriptions.id_forum', 'inscriptions.mail_partenaire', 'inscriptions.presence_day1', 'inscriptions.presence_day2', diff --git a/sources/AppBundle/Event/Model/Repository/SpeakerRepository.php b/sources/AppBundle/Event/Model/Repository/SpeakerRepository.php index a84f833b9..30b68f76e 100644 --- a/sources/AppBundle/Event/Model/Repository/SpeakerRepository.php +++ b/sources/AppBundle/Event/Model/Repository/SpeakerRepository.php @@ -4,6 +4,7 @@ namespace AppBundle\Event\Model\Repository; +use AppBundle\Association\Genre; use AppBundle\Event\Model\Event; use AppBundle\Event\Model\Speaker; use AppBundle\Event\Model\Talk; @@ -29,7 +30,7 @@ class SpeakerRepository extends Repository implements MetadataInitializer */ public function getSpeakersByTalk(Talk $talk) { - $query = $this->getPreparedQuery('SELECT c.conferencier_id, c.id_forum, c.civilite, c.nom, c.prenom, c.email,c.societe, + $query = $this->getPreparedQuery('SELECT c.conferencier_id, c.id_forum, c.genre, c.nom, c.prenom, c.email,c.societe, c.biographie, c.twitter, c.user_github, c.photo, c.bluesky, c.mastodon, c.linkedin FROM afup_conferenciers c LEFT JOIN afup_conferenciers_sessions cs ON cs.conferencier_id = c.conferencier_id @@ -54,7 +55,7 @@ public function getScheduledSpeakersByEvent(Event $event, $returnTalksThatWillBe $publishedAtFilter = '(1 = 1)'; } - $query = $this->getPreparedQuery('SELECT speaker.conferencier_id, speaker.id_forum, speaker.civilite, speaker.nom, speaker.prenom, speaker.email, speaker.societe, + $query = $this->getPreparedQuery('SELECT speaker.conferencier_id, speaker.id_forum, speaker.genre, speaker.nom, speaker.prenom, speaker.email, speaker.societe, speaker.biographie, speaker.twitter, speaker.mastodon, speaker.bluesky, speaker.user_github, speaker.photo, talk.titre, talk.session_id, speaker.will_attend_speakers_diner, speaker.has_special_diet, @@ -204,9 +205,13 @@ public static function initMetadata(SerializerFactoryInterface $serializerFactor 'type' => 'int', ]) ->addField([ - 'columnName' => 'civilite', - 'fieldName' => 'civility', - 'type' => 'string', + 'columnName' => 'genre', + 'fieldName' => 'genre', + 'type' => 'enum', + 'serializer' => BackedEnum::class, + 'serializer_options' => [ + 'unserialize' => ['enum' => Genre::class], + ], ]) ->addField([ 'columnName' => 'nom', diff --git a/sources/AppBundle/Event/Model/Repository/TalkRepository.php b/sources/AppBundle/Event/Model/Repository/TalkRepository.php index 6c05d32dd..3a4a6aea3 100644 --- a/sources/AppBundle/Event/Model/Repository/TalkRepository.php +++ b/sources/AppBundle/Event/Model/Repository/TalkRepository.php @@ -82,7 +82,7 @@ public function getTalksBySpeaker(Event $event, Speaker $speaker) public function getTalksBySpeakerWithVotes(Event $event, Speaker $speaker) { $query = $this->getPreparedQuery( - 'SELECT sessions.session_id, titre, abstract, id_forum, sessions.plannifie, skill, genre, votes.* + 'SELECT sessions.session_id, titre, abstract, id_forum, sessions.plannifie, skill, sessions.genre, votes.* FROM afup_sessions sessions LEFT JOIN afup_conferenciers_sessions cs ON cs.session_id = sessions.session_id LEFT JOIN afup_sessions_vote_github votes ON votes.session_id = sessions.session_id @@ -138,7 +138,7 @@ public function getPreviousTalksBySpeaker(Event $event, Speaker $speaker) public function getAllTalksAndRatingsForUser(Event $event, GithubUser $user, $randomSeed, $page = 1, $limit = 10) { $query = $this->getPreparedQuery( - 'SELECT sessions.session_id, titre, abstract, skill, genre, id_forum, asvg.id, asvg.comment, asvg.vote + 'SELECT sessions.session_id, titre, abstract, skill, sessions.genre, id_forum, asvg.id, asvg.comment, asvg.vote FROM afup_sessions sessions LEFT JOIN afup_sessions_vote_github asvg ON (asvg.session_id = sessions.session_id AND asvg.user = :user) WHERE plannifie = 0 AND id_forum = :event @@ -181,7 +181,7 @@ public function getTalkOfTheDay(\DateTime $currentDate) public function getNewTalksToRate(Event $event, GithubUser $user, $randomSeed, $page = 1, $limit = 10) { $query = $this->getPreparedQuery( - 'SELECT sessions.session_id, titre, skill, genre, abstract, id_forum + 'SELECT sessions.session_id, titre, skill, sessions.genre, abstract, id_forum FROM afup_sessions sessions LEFT JOIN afup_sessions_vote_github asvg ON (asvg.session_id = sessions.session_id AND asvg.user = :user) WHERE plannifie = 0 AND id_forum = :event @@ -213,7 +213,7 @@ public function getByTalkWithSpeakers(Talk $talk) $hydrator->aggregateOn('talk', 'speaker', 'getId'); $query = $this->getPreparedQuery( - 'SELECT talk.session_id, talk.titre, skill, genre, abstract, talk.plannifie, + 'SELECT talk.session_id, talk.titre, skill, talk.genre, abstract, talk.plannifie, speaker.conferencier_id, speaker.nom, speaker.prenom, speaker.id_forum, speaker.photo, speaker.societe, speaker.biographie, planning.debut, planning.fin, room.id, room.nom, event.date_annonce_planning FROM afup_sessions AS talk @@ -271,7 +271,7 @@ public function getByEventsWithSpeakers(array $events, $applyPublicationdateFilt $inEvents = implode(',', $inEventsKeys); $query = $this->getPreparedQuery( - sprintf('SELECT talk.id_forum, talk.session_id, titre, skill, genre, abstract, talk.plannifie, talk.language_code, + sprintf('SELECT talk.id_forum, talk.session_id, titre, skill, talk.genre, abstract, talk.plannifie, talk.language_code, talk.joindin, speaker.conferencier_id, speaker.nom, speaker.prenom, speaker.id_forum, speaker.photo, speaker.societe, planning.id, planning.debut, planning.fin, room.id, room.nom @@ -306,7 +306,7 @@ public function getByEventsWithSpeakers(array $events, $applyPublicationdateFilt public function getByEventWithSpeakersAndVotes(Event $event, string $search = '', string $orderBy = 'talk.date_soumission ASC', bool $planned = false, bool $needMentoring = false): array { $sql = <<aggregateOn('talk', 'speaker', 'getId'); $query = $this->getPreparedQuery( - 'SELECT talk.session_id, titre, skill, genre, abstract, talk.plannifie, talk.language_code, talk.needs_mentoring, talk.staff_notes, talk.youtube_id, + 'SELECT talk.session_id, titre, skill, talk.genre, abstract, talk.plannifie, talk.language_code, talk.needs_mentoring, talk.staff_notes, talk.youtube_id, speaker.conferencier_id, speaker.nom, speaker.prenom, speaker.id_forum, speaker.photo, speaker.ville, speaker.societe, speaker.email, speaker.conferencier_id FROM afup_sessions AS talk LEFT JOIN afup_conferenciers_sessions acs ON acs.session_id = talk.session_id diff --git a/sources/AppBundle/Event/Model/Repository/TicketRepository.php b/sources/AppBundle/Event/Model/Repository/TicketRepository.php index d0b6e1da0..739942909 100644 --- a/sources/AppBundle/Event/Model/Repository/TicketRepository.php +++ b/sources/AppBundle/Event/Model/Repository/TicketRepository.php @@ -4,6 +4,7 @@ namespace AppBundle\Event\Model\Repository; +use AppBundle\Association\Genre; use AppBundle\Event\Model\Event; use AppBundle\Event\Model\Invoice; use AppBundle\Event\Model\Ticket; @@ -17,6 +18,7 @@ use CCMBenchmark\Ting\Repository\Metadata; use CCMBenchmark\Ting\Repository\MetadataInitializer; use CCMBenchmark\Ting\Repository\Repository; +use CCMBenchmark\Ting\Serializer\BackedEnum; use CCMBenchmark\Ting\Serializer\SerializerFactoryInterface; /** @@ -94,7 +96,7 @@ public function getByInvoiceWithDetail(Invoice $invoice) return $this->getPreparedQuery( 'SELECT inscriptions.id, inscriptions.date, inscriptions.reference, inscriptions.coupon, inscriptions.type_inscription, - inscriptions.montant, inscriptions.informations_reglement, inscriptions.civilite, inscriptions.nom, inscriptions.prenom, + inscriptions.montant, inscriptions.informations_reglement, inscriptions.genre, inscriptions.nom, inscriptions.prenom, inscriptions.email, inscriptions.telephone, inscriptions.citer_societe, inscriptions.newsletter_afup, inscriptions.newsletter_nexen, inscriptions.commentaires, inscriptions.etat, inscriptions.facturation, inscriptions.id_forum, inscriptions.mail_partenaire, inscriptions.presence_day1, inscriptions.presence_day2, @@ -267,7 +269,7 @@ public function getAllTicketsForExport() $this ->getPreparedQuery( 'SELECT inscriptions.id, inscriptions.date, inscriptions.reference, inscriptions.coupon, inscriptions.type_inscription, - inscriptions.montant, inscriptions.informations_reglement, inscriptions.civilite, inscriptions.nom, inscriptions.prenom, + inscriptions.montant, inscriptions.informations_reglement, inscriptions.genre, inscriptions.nom, inscriptions.prenom, inscriptions.email, inscriptions.id_forum FROM afup_inscription_forum inscriptions WHERE inscriptions.etat = :state @@ -350,9 +352,13 @@ public static function initMetadata(SerializerFactoryInterface $serializerFactor 'type' => 'string', ]) ->addField([ - 'columnName' => 'civilite', - 'fieldName' => 'civility', - 'type' => 'string', + 'columnName' => 'genre', + 'fieldName' => 'genre', + 'type' => 'enum', + 'serializer' => BackedEnum::class, + 'serializer_options' => [ + 'unserialize' => ['enum' => Genre::class], + ], ]) ->addField([ 'columnName' => 'nom', diff --git a/sources/AppBundle/Event/Model/Speaker.php b/sources/AppBundle/Event/Model/Speaker.php index d686aefbf..f45838332 100644 --- a/sources/AppBundle/Event/Model/Speaker.php +++ b/sources/AppBundle/Event/Model/Speaker.php @@ -4,6 +4,7 @@ namespace AppBundle\Event\Model; +use AppBundle\Association\Genre; use AppBundle\Event\Speaker\MicrophoneType; use CCMBenchmark\Ting\Entity\NotifyProperty; use CCMBenchmark\Ting\Entity\NotifyPropertyInterface; @@ -37,11 +38,7 @@ class Speaker implements NotifyPropertyInterface #[Assert\GreaterThan(0)] private $user; - /** - * @var string - */ - #[Assert\NotBlank] - private $civility; + private ?Genre $genre = null; /** * @var string @@ -186,21 +183,15 @@ public function setEventId($eventId): self return $this; } - /** - * @return string - */ - public function getCivility() + public function getGenre(): ?Genre { - return $this->civility; + return $this->genre; } - /** - * @param string $civility - */ - public function setCivility($civility): self + public function setGenre(?Genre $genre): self { - $this->propertyChanged('civility', $this->civility, $civility); - $this->civility = $civility; + $this->propertyChanged('genre', $this->genre, $genre); + $this->genre = $genre; return $this; } diff --git a/sources/AppBundle/Event/Model/Ticket.php b/sources/AppBundle/Event/Model/Ticket.php index e27ed2c09..b076fe5d9 100644 --- a/sources/AppBundle/Event/Model/Ticket.php +++ b/sources/AppBundle/Event/Model/Ticket.php @@ -4,6 +4,7 @@ namespace AppBundle\Event\Model; +use AppBundle\Association\Genre; use AppBundle\Event\Validator\Constraints as Assert; use CCMBenchmark\Ting\Entity\NotifyProperty; use CCMBenchmark\Ting\Entity\NotifyPropertyInterface; @@ -97,10 +98,7 @@ class Ticket implements NotifyPropertyInterface */ private $paymentInfo; - /** - * @var string - */ - private $civility; + private ?Genre $genre = null; /** * @var string @@ -343,22 +341,15 @@ public function setPaymentInfo($paymentInfo): self return $this; } - /** - * @return string - */ - public function getCivility() + public function getGenre(): ?Genre { - return $this->civility; + return $this->genre; } - /** - * @param string $civility - */ - public function setCivility($civility): self + public function setGenre(?Genre $genre): void { - $this->propertyChanged('civility', $this->civility, $civility); - $this->civility = $civility; - return $this; + $this->propertyChanged('genre', $this->genre, $genre); + $this->genre = $genre; } /** diff --git a/templates/admin/association/membership/register.html.twig b/templates/admin/association/membership/register.html.twig index 5f5b888bd..4eaebe648 100644 --- a/templates/admin/association/membership/register.html.twig +++ b/templates/admin/association/membership/register.html.twig @@ -16,7 +16,7 @@ Information
{{ form_errors(form) }} - {{ form_row(form.civility) }} + {{ form_row(form.genre) }} {{ form_row(form.userCommonInfo.lastName) }} {{ form_row(form.userCommonInfo.firstName) }} {{ form_row(form.userCommonInfo.username) }} diff --git a/templates/admin/event/ticket/form.html.twig b/templates/admin/event/ticket/form.html.twig index 624fe29c7..c1cd3c2f0 100644 --- a/templates/admin/event/ticket/form.html.twig +++ b/templates/admin/event/ticket/form.html.twig @@ -5,7 +5,7 @@

Informations

{{ form_row(form.ticket.ticketTypeId) }} - {{ form_row(form.ticket.civility) }} + {{ form_row(form.ticket.genre) }} {{ form_row(form.ticket.lastname) }} {{ form_row(form.ticket.firstname) }} {{ form_row(form.ticket.email) }} diff --git a/templates/admin/members/user_add.html.twig b/templates/admin/members/user_add.html.twig index 3fcac53b7..15775c081 100644 --- a/templates/admin/members/user_add.html.twig +++ b/templates/admin/members/user_add.html.twig @@ -12,7 +12,7 @@
{{ form_errors(form) }} {{ form_row(form.companyId) }} - {{ form_row(form.civility) }} + {{ form_row(form.genre) }} {{ form_row(form.lastname, {attr: {'data-role': 'field-lastname'}}) }} {{ form_row(form.firstname, {attr: {'data-role': 'field-firstname'}}) }} {{ form_row(form.email) }} diff --git a/templates/admin/members/user_edit.html.twig b/templates/admin/members/user_edit.html.twig index 1e629eaf8..8b0064e84 100644 --- a/templates/admin/members/user_edit.html.twig +++ b/templates/admin/members/user_edit.html.twig @@ -50,7 +50,7 @@
{{ form_errors(form) }} {{ form_row(form.companyId) }} - {{ form_row(form.civility) }} + {{ form_row(form.genre) }} {{ form_row(form.lastname, {attr: {'data-role': 'field-lastname'}}) }} {{ form_row(form.firstname, {attr: {'data-role': 'field-firstname'}}) }} {{ form_row(form.email) }} diff --git a/templates/admin/speaker/add.html.twig b/templates/admin/speaker/add.html.twig index 63c332c92..8411db7af 100644 --- a/templates/admin/speaker/add.html.twig +++ b/templates/admin/speaker/add.html.twig @@ -10,7 +10,7 @@
{{ form_start(form) }}
- {{ form_row(form.civility) }} + {{ form_row(form.genre) }} {{ form_row(form.firstname) }} {{ form_row(form.lastname) }} {{ form_row(form.email) }} diff --git a/templates/admin/speaker/edit.html.twig b/templates/admin/speaker/edit.html.twig index 7522018ab..7faba66cb 100644 --- a/templates/admin/speaker/edit.html.twig +++ b/templates/admin/speaker/edit.html.twig @@ -9,7 +9,7 @@
{{ form_start(form) }}
- {{ form_row(form.civility) }} + {{ form_row(form.genre) }} {{ form_row(form.firstname) }} {{ form_row(form.lastname) }} {{ form_row(form.email) }} diff --git a/templates/event/ticket/sponsor.html.twig b/templates/event/ticket/sponsor.html.twig index c4b755865..328210421 100644 --- a/templates/event/ticket/sponsor.html.twig +++ b/templates/event/ticket/sponsor.html.twig @@ -94,7 +94,7 @@

Vous avez utilisé toutes vos invitations. Nous avons hâte de vous retrouver lors de cet évènement !

{% else %} {{ form_start(ticketForm, {attr: {class: 'sponsor--ticket-edit'}}) }} - {{ form_row(ticketForm.civility) }} + {{ form_row(ticketForm.genre) }} {{ form_row(ticketForm.firstname) }} {{ form_row(ticketForm.lastname) }} {{ form_row(ticketForm.email) }} diff --git a/templates/event/ticket/ticket.html.twig b/templates/event/ticket/ticket.html.twig index 2f0d5ca2f..80ba8f1a4 100644 --- a/templates/event/ticket/ticket.html.twig +++ b/templates/event/ticket/ticket.html.twig @@ -140,7 +140,7 @@ {{ key+1 }} Billet {{ key+1 }}
- {{ form_row(ticket.civility) }} + {{ form_row(ticket.genre) }} {{ form_row(ticket.firstname) }} {{ form_row(ticket.lastname) }} {{ form_row(ticket.email) }} diff --git a/tests/behat/features/Admin/AdminPersonnesPhysiques.feature b/tests/behat/features/Admin/AdminPersonnesPhysiques.feature index e26f417e1..1dcdb0e0e 100644 --- a/tests/behat/features/Admin/AdminPersonnesPhysiques.feature +++ b/tests/behat/features/Admin/AdminPersonnesPhysiques.feature @@ -8,7 +8,7 @@ Feature: Administration - Partie Personnes physiques # ajout d'une personne physique When I follow "Ajouter" Then I should see "Ajouter une personne physique" - Then The "user_edit[civility]" field should only contain the follow values '["M.", "Mme"]' + Then The "user_edit[genre]" field should only contain the follow values '["Ne se prononce pas", "Femme", "Homme", "Non-binaire"]' When I press "Ajouter" Then I should see "Cette valeur ne doit pas être vide" When I fill in "user_edit[lastname]" with "Mon nom" diff --git a/tests/behat/features/Admin/Events/Inscriptions.feature b/tests/behat/features/Admin/Events/Inscriptions.feature index 7ab2ebf1f..d6ecfed01 100644 --- a/tests/behat/features/Admin/Events/Inscriptions.feature +++ b/tests/behat/features/Admin/Events/Inscriptions.feature @@ -46,7 +46,7 @@ Feature: Administration - Évènements - Inscriptions Then the ".content h2" element should contain "Inscriptions" When I follow "Ajouter" Then I should see "Ajouter une inscription pour le forum" - Then The "ticket_admin_with_invoice[ticket][civility]" field should only contain the follow values '["M.", "Mme"]' + Then The "ticket_admin_with_invoice[ticket][genre]" field should only contain the follow values '["Ne se prononce pas", "Femme", "Homme", "Non-binaire"]' When I select "2" from "ticket_admin_with_invoice[ticket][ticketTypeId]" And I fill in "ticket_admin_with_invoice[ticket][lastname]" with "Nom participant" And I fill in "ticket_admin_with_invoice[ticket][firstname]" with "Prénom participant" diff --git a/tests/behat/features/Admin/Events/TokensSponsors.feature b/tests/behat/features/Admin/Events/TokensSponsors.feature index 3ed5640fc..1730c83f8 100644 --- a/tests/behat/features/Admin/Events/TokensSponsors.feature +++ b/tests/behat/features/Admin/Events/TokensSponsors.feature @@ -28,7 +28,7 @@ Feature: Administration - Évènements - Tokens Sponsors # Vérifie le markdown depuis sponsor_management_ And the response should contain "Sponsors, venez, vous serez très visible !" # Ajout d'une invitation - And The "sponsor_ticket[civility]" field should only contain the follow values '["M.", "Mme"]' + And The "sponsor_ticket[genre]" field should only contain the follow values '["Ne se prononce pas", "Femme", "Homme", "Non-binaire"]' When I fill in "sponsor_ticket[firstname]" with "Nom personne invitée" And I fill in "sponsor_ticket[lastname]" with "Prénom personne invitée" And I fill in "sponsor_ticket[email]" with "personneinvitee@masociete.com" diff --git a/tests/behat/features/EventPages/Cfp.feature b/tests/behat/features/EventPages/Cfp.feature index 3d8b39b12..1b3cffbe3 100644 --- a/tests/behat/features/EventPages/Cfp.feature +++ b/tests/behat/features/EventPages/Cfp.feature @@ -10,7 +10,7 @@ Feature: Event pages - CFP And I should see "Vous n'avez pas encore rempli votre profil conférencier." When I follow "Mon profil conférencier" Then I should see "Photo de profil" - Then The "speaker[civility]" field should only contain the follow values '["M", "Mme"]' + Then The "speaker[genre]" field should only contain the follow values '["Ne se prononce pas", "Femme", "Homme", "Non-binaire"]' When I fill in "speaker[firstname]" with "Mon prénom" And I fill in "speaker[lastname]" with "Mon prénom" And I fill in "speaker[email]" with "monemail@provider.fr" diff --git a/tests/behat/features/EventPages/CfpEn.feature b/tests/behat/features/EventPages/CfpEn.feature index 0412fb0d1..4cd887369 100644 --- a/tests/behat/features/EventPages/CfpEn.feature +++ b/tests/behat/features/EventPages/CfpEn.feature @@ -10,7 +10,7 @@ Feature: Event pages - CFP - en anglais And I should see "Your speaker profile is empty." When I follow "My speaker profile" Then I should see "Profile picture" - Then The "speaker[civility]" field should only contain the follow values '["Mr.", "Mrs."]' + Then The "speaker[genre]" field should only contain the follow values '["Prefer not to say", "Female", "Male", "Nonbinary"]' When I fill in "speaker[firstname]" with "Mon prénom" And I fill in "speaker[lastname]" with "Mon nom de famille" And I fill in "speaker[email]" with "monemail@provider.fr" diff --git a/tests/behat/features/EventPages/Ticketing.feature b/tests/behat/features/EventPages/Ticketing.feature index 46d7d6268..e3350db96 100644 --- a/tests/behat/features/EventPages/Ticketing.feature +++ b/tests/behat/features/EventPages/Ticketing.feature @@ -8,7 +8,7 @@ Feature: Event pages - Ticketing And I should see "Si vous rencontrez le moindre problème, n'hésitez pas à nous contacter à l'adresse bonjour [@] afup.org." # Choix du règlement par CB And I select "0" from "purchase[paymentType]" - Then The "purchase[tickets][0][civility]" field should only contain the follow values '["M.", "Mme"]' + Then The "purchase[tickets][0][genre]" field should only contain the follow values '["Ne se prononce pas", "Femme", "Homme", "Non-binaire"]' When I fill in "purchase[tickets][0][firstname]" with "Prénom personne 1" And I fill in "purchase[tickets][0][lastname]" with "Nom personne 1" And I fill in "purchase[tickets][0][email]" with "personne1@yahoo.fr" @@ -54,7 +54,7 @@ Feature: Event pages - Ticketing And I should see "Si vous rencontrez le moindre problème, n'hésitez pas à nous contacter à l'adresse bonjour [@] afup.org." # Choix du règlement par virement And I select "2" from "purchase[paymentType]" - Then The "purchase[tickets][0][civility]" field should only contain the follow values '["M.", "Mme"]' + Then The "purchase[tickets][0][genre]" field should only contain the follow values '["Ne se prononce pas", "Femme", "Homme", "Non-binaire"]' When I fill in "purchase[tickets][0][firstname]" with "Prénom personne 1" And I fill in "purchase[tickets][0][lastname]" with "Nom personne 1" And I fill in "purchase[tickets][0][email]" with "personne1@yahoo.fr" @@ -80,7 +80,7 @@ Feature: Event pages - Ticketing Then I should see "Billetterie: forum" # Formule Tarif membre And I select "0" from "purchase[tickets][0][ticketEventType]" - Then The "purchase[tickets][0][civility]" field should only contain the follow values '["M.", "Mme"]' + Then The "purchase[tickets][0][genre]" field should only contain the follow values '["Ne se prononce pas", "Femme", "Homme", "Non-binaire"]' When I fill in "purchase[tickets][0][firstname]" with "Prénom personne 1" And I fill in "purchase[tickets][0][lastname]" with "Nom personne 1" And I fill in "purchase[tickets][0][email]" with "paul.personne@mycorp.fr" diff --git a/tests/behat/features/EventPages/TicketingEn.feature b/tests/behat/features/EventPages/TicketingEn.feature index 5fbc7d9d4..033db6136 100644 --- a/tests/behat/features/EventPages/TicketingEn.feature +++ b/tests/behat/features/EventPages/TicketingEn.feature @@ -4,4 +4,4 @@ Feature: Event pages - Ticketing - en anglais Scenario: Achat de billet en anglais Given I am on "/event/forum/tickets?_locale=en" Then I should see "Ticketing: forum" - Then The "purchase[tickets][0][civility]" field should only contain the follow values '["M.", "Mrs."]' + Then The "purchase[tickets][0][genre]" field should only contain the follow values '["Prefer not to say", "Female", "Male", "Nonbinary"]' diff --git a/tests/behat/features/PublicSite/Register.feature b/tests/behat/features/PublicSite/Register.feature index 22a71d100..1e264e4c2 100644 --- a/tests/behat/features/PublicSite/Register.feature +++ b/tests/behat/features/PublicSite/Register.feature @@ -28,7 +28,7 @@ Feature: Site Public - Register Then I should see "Devenir membre de l'AFUP" When I follow "Adhérer en tant que particulier" Then I should see "Formulaire d'inscription à l'AFUP" - Then The "register_user_civility" field should only contain the follow values '["M.", "Mme"]' + Then The "register_user_genre" field should only contain the follow values '["Ne se prononce pas", "Femme", "Homme", "Non-binaire"]' When I fill in "register_user_userCommonInfo_lastName" with "Mon nom" And I fill in "register_user_userCommonInfo_firstName" with "Mon prénom" And I fill in "register_user_userCommonInfo_username" with "lelogin" diff --git a/tests/unit/AppBundle/Indexation/Talks/TransformerTest.php b/tests/unit/AppBundle/Indexation/Talks/TransformerTest.php index 0c2ea7513..e13ba8e0f 100644 --- a/tests/unit/AppBundle/Indexation/Talks/TransformerTest.php +++ b/tests/unit/AppBundle/Indexation/Talks/TransformerTest.php @@ -4,6 +4,7 @@ namespace AppBundle\Tests\Indexation\Talks; +use AppBundle\Association\Genre; use AppBundle\Event\Model\Event; use AppBundle\Event\Model\Planning; use AppBundle\Event\Model\Speaker; @@ -53,7 +54,7 @@ public function testTransform(): void ->setId(800) ->setEventId(10) ->setUser(0) - ->setCivility('M.') + ->setGenre(Genre::Homme) ->setFirstname('Dimitri') ->setLastname('Fontaine') ->setEmail('example@example.fr') diff --git a/translations/messages.en.yml b/translations/messages.en.yml index 3e442e6d9..00e697da3 100644 --- a/translations/messages.en.yml +++ b/translations/messages.en.yml @@ -58,7 +58,6 @@ N/A: N/A 'Pour pouvoir proposer une conférence, il vous sera nécessaire de vous authentifier avec Github.': 'To submit a talk, you have to connect to your github account.' 'Pour pouvoir voter, il vous sera nécessaire de vous authentifier avec Github.': 'To rate submitted ones, you have to connect to your github account.' 'Le CFP est terminé pour cet évènement': 'The call for paper is closed for this event' -Civility: Civility Firstname: Firstname Lastname: Lastname Email: Email @@ -231,3 +230,7 @@ speaker_infos.microphone.choice.handheld: "Handheld microphone" 'mail.cfp_submission.vote_section': '

Feel free to check the public comments and votes on the dedicated page. Please note these are advisory — the conference team has sole decision-making authority.

' 'mail.cfp_submission.abstract': 'Here is an abstract of your submission:' 'mail.cfp_submission.signature': 'Thank you for your contribution,' +'Ne se prononce pas': 'Prefer not to say' +'Femme': 'Female' +'Homme': 'Male' +'Non-binaire': 'Nonbinary' \ No newline at end of file diff --git a/translations/messages.fr.yml b/translations/messages.fr.yml index 59ad582df..4966d26da 100644 --- a/translations/messages.fr.yml +++ b/translations/messages.fr.yml @@ -1,4 +1,3 @@ -'Civility': 'Civilité' 'Firstname': 'Prénom' 'Lastname': 'Nom' 'Email': 'Email' @@ -254,4 +253,4 @@ speaker_infos.microphone.choice.handheld: "Micro à main"

Quel que soit le résultat, un courriel vous sera envoyé dans les semaines qui suivront la fin du CFP.

'mail.cfp_submission.vote_section': '

N''hésitez pas à consulter les commentaires et votes du public sur la page dédiée. Notez bien que ceux-ci sont indicatifs, le pôle conférences est seul décisionnaire sur la sélection.

' 'mail.cfp_submission.abstract': 'Voici un extrait de votre soumission :' -'mail.cfp_submission.signature': 'Merci pour votre contribution,' +'mail.cfp_submission.signature': 'Merci pour votre contribution,' \ No newline at end of file