From 3b13f711353fc37a58bb74848d5a0eb37fd03eb8 Mon Sep 17 00:00:00 2001 From: AntoineAresu Date: Mon, 18 Mar 2024 13:17:39 +0100 Subject: [PATCH] :recycle: :globe_with_meridians: [Admin] Big refacto on trans keys, only snake case on trans file --- .../AbstractWorkshopSectionCrudController.php | 23 ++++ .../Admin/AgeBreakpointCrudController.php | 16 +-- src/Controller/Admin/CenterCrudController.php | 10 +- .../Admin/CenterTagCrudController.php | 20 ++- src/Controller/Admin/DashboardController.php | 24 ++-- .../Admin/DurationCrudController.php | 17 +-- .../Admin/EquipmentSupplierCrudController.php | 17 +-- .../Admin/ParticipantKindCrudController.php | 17 +-- .../Admin/PermanenceCrudController.php | 54 ++++---- src/Controller/Admin/SkillCrudController.php | 18 ++- src/Controller/Admin/TopicCrudController.php | 16 +-- .../Admin/UsedEquipmentCrudController.php | 17 ++- src/Controller/Admin/UserCrudController.php | 6 +- .../Admin/WorkshopCrudController.php | 80 +++++------ translations/messages.fr.yaml | 128 +++++++----------- 15 files changed, 232 insertions(+), 231 deletions(-) create mode 100644 src/Controller/Admin/AbstractWorkshopSectionCrudController.php diff --git a/src/Controller/Admin/AbstractWorkshopSectionCrudController.php b/src/Controller/Admin/AbstractWorkshopSectionCrudController.php new file mode 100644 index 00000000..05a529c1 --- /dev/null +++ b/src/Controller/Admin/AbstractWorkshopSectionCrudController.php @@ -0,0 +1,23 @@ +hideOnForm(), + TextField::new('name')->setLabel('name'), + ]; + } +} diff --git a/src/Controller/Admin/AgeBreakpointCrudController.php b/src/Controller/Admin/AgeBreakpointCrudController.php index 32edf97f..b92ba9e4 100644 --- a/src/Controller/Admin/AgeBreakpointCrudController.php +++ b/src/Controller/Admin/AgeBreakpointCrudController.php @@ -3,23 +3,19 @@ namespace App\Controller\Admin; use App\Entity\AgeBreakpoint; -use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController; +use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; -class AgeBreakpointCrudController extends AbstractCrudController +class AgeBreakpointCrudController extends AbstractWorkshopSectionCrudController { public static function getEntityFqcn(): string { return AgeBreakpoint::class; } - /* - public function configureFields(string $pageName): iterable + public function configureCrud(Crud $crud): Crud { - return [ - IdField::new('id'), - TextField::new('title'), - TextEditorField::new('description'), - ]; + return $crud + ->setEntityLabelInSingular('age_breakpoint') + ->setEntityLabelInPlural('age_breakpoints'); } - */ } diff --git a/src/Controller/Admin/CenterCrudController.php b/src/Controller/Admin/CenterCrudController.php index 7249afdd..77097a74 100644 --- a/src/Controller/Admin/CenterCrudController.php +++ b/src/Controller/Admin/CenterCrudController.php @@ -20,18 +20,18 @@ public static function getEntityFqcn(): string public function configureCrud(Crud $crud): Crud { return $crud - ->setEntityLabelInSingular('Center') - ->setEntityLabelInPlural('Center') + ->setEntityLabelInSingular('center') + ->setEntityLabelInPlural('centers') ->setSearchFields(['id', 'name']); } public function configureFields(string $pageName): iterable { - $name = TextField::new('name'); - $place = TextField::new('place')->setRequired(false)->setEmptyData(Center::PLACE_DEFAULT_VALUE); + $name = TextField::new('name')->setLabel('name'); + $place = TextField::new('place')->setRequired(false)->setEmptyData(Center::PLACE_DEFAULT_VALUE)->setLabel('place'); $permanences = AssociationField::new('permanences')->setLabel('permanences_count'); $workshops = AssociationField::new('workshops')->setLabel('workshops_count'); - $tags = AssociationField::new('tags')->setFormTypeOption('by_reference', false); + $tags = AssociationField::new('tags')->setFormTypeOption('by_reference', false)->setLabel('center_tags'); $id = IntegerField::new('id', 'ID'); $workshop = BooleanField::new('workshop'); $permanence = BooleanField::new('permanence'); diff --git a/src/Controller/Admin/CenterTagCrudController.php b/src/Controller/Admin/CenterTagCrudController.php index 484ea102..bb1a060c 100644 --- a/src/Controller/Admin/CenterTagCrudController.php +++ b/src/Controller/Admin/CenterTagCrudController.php @@ -3,7 +3,10 @@ namespace App\Controller\Admin; use App\Entity\CenterTag; +use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController; +use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField; +use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; class CenterTagCrudController extends AbstractCrudController { @@ -12,14 +15,21 @@ public static function getEntityFqcn(): string return CenterTag::class; } - /* + public function configureCrud(Crud $crud): Crud + { + return $crud + ->setEntityLabelInSingular('center_tag') + ->setEntityLabelInPlural('center_tags') + ->setSearchFields(['id', 'name']); + } + public function configureFields(string $pageName): iterable { return [ - IdField::new('id'), - TextField::new('title'), - TextEditorField::new('description'), + IntegerField::new('id', 'ID')->hideOnForm(), + TextField::new('name')->setLabel('name'), + TextField::new('color')->setLabel('color'), + TextField::new('category')->setLabel('category'), ]; } - */ } diff --git a/src/Controller/Admin/DashboardController.php b/src/Controller/Admin/DashboardController.php index a46129b6..d580bc15 100644 --- a/src/Controller/Admin/DashboardController.php +++ b/src/Controller/Admin/DashboardController.php @@ -50,22 +50,22 @@ public function configureMenuItems(): iterable { yield MenuItem::linkToLogout('Logout', 'fas fa-sign-out-alt text-danger')->setCssClass('text-danger'); yield MenuItem::section('Interventions'); - yield MenuItem::linkToCrud('Permanence', 'fas fa-home', Permanence::class); - yield MenuItem::linkToCrud('Workshop', 'fas fa-briefcase', Workshop::class); + yield MenuItem::linkToCrud('permanences', 'fas fa-home', Permanence::class); + yield MenuItem::linkToCrud('workshops', 'fas fa-briefcase', Workshop::class); if ($this->isGranted('ROLE_SUPER_ADMIN')) { yield MenuItem::section('Utilisateurs et Centres'); - yield MenuItem::linkToCrud('User', 'fas fa-users', User::class); - yield MenuItem::linkToCrud('Center', 'fas fa-home', Center::class); - yield MenuItem::linkToCrud('Tag', 'fas fa-tags', CenterTag::class); + yield MenuItem::linkToCrud('users', 'fas fa-users', User::class); + yield MenuItem::linkToCrud('centers', 'fas fa-home', Center::class); + yield MenuItem::linkToCrud('center_tags', 'fas fa-tags', CenterTag::class); yield MenuItem::section('Données'); - yield MenuItem::linkToCrud('Topic', 'fas fa-comment', Topic::class); - yield MenuItem::linkToCrud('Skill', 'fas fa-hand-paper', Skill::class); - yield MenuItem::linkToCrud('AgeBreakpoint', 'fas fa-birthday-cake', AgeBreakpoint::class); - yield MenuItem::linkToCrud('Duration', 'fas fa-clock', Duration::class); - yield MenuItem::linkToCrud('ParticipantKind', 'fas fa-users', ParticipantKind::class); - yield MenuItem::linkToCrud('EquipmentSupplier', 'fas fa-truck', EquipmentSupplier::class); - yield MenuItem::linkToCrud('UsedEquipment', 'fas fa-tools', UsedEquipment::class); + yield MenuItem::linkToCrud('topics', 'fas fa-comment', Topic::class); + yield MenuItem::linkToCrud('skills', 'fas fa-hand-paper', Skill::class); + yield MenuItem::linkToCrud('age_breakpoints', 'fas fa-birthday-cake', AgeBreakpoint::class); + yield MenuItem::linkToCrud('durations', 'fas fa-clock', Duration::class); + yield MenuItem::linkToCrud('participant_kinds', 'fas fa-users', ParticipantKind::class); + yield MenuItem::linkToCrud('equipment_supplier', 'fas fa-truck', EquipmentSupplier::class); + yield MenuItem::linkToCrud('used_equipments', 'fas fa-tools', UsedEquipment::class); } } } diff --git a/src/Controller/Admin/DurationCrudController.php b/src/Controller/Admin/DurationCrudController.php index 530522fc..2048ffbf 100644 --- a/src/Controller/Admin/DurationCrudController.php +++ b/src/Controller/Admin/DurationCrudController.php @@ -3,23 +3,20 @@ namespace App\Controller\Admin; use App\Entity\Duration; -use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController; +use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; -class DurationCrudController extends AbstractCrudController +class DurationCrudController extends AbstractWorkshopSectionCrudController { public static function getEntityFqcn(): string { return Duration::class; } - /* - public function configureFields(string $pageName): iterable + public function configureCrud(Crud $crud): Crud { - return [ - IdField::new('id'), - TextField::new('title'), - TextEditorField::new('description'), - ]; + return $crud + ->setEntityLabelInSingular('duration') + ->setEntityLabelInPlural('durations') + ->setSearchFields(['id', 'name']); } - */ } diff --git a/src/Controller/Admin/EquipmentSupplierCrudController.php b/src/Controller/Admin/EquipmentSupplierCrudController.php index 98ffa9b1..1a875dfb 100644 --- a/src/Controller/Admin/EquipmentSupplierCrudController.php +++ b/src/Controller/Admin/EquipmentSupplierCrudController.php @@ -3,23 +3,20 @@ namespace App\Controller\Admin; use App\Entity\EquipmentSupplier; -use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController; +use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; -class EquipmentSupplierCrudController extends AbstractCrudController +class EquipmentSupplierCrudController extends AbstractWorkshopSectionCrudController { public static function getEntityFqcn(): string { return EquipmentSupplier::class; } - /* - public function configureFields(string $pageName): iterable + public function configureCrud(Crud $crud): Crud { - return [ - IdField::new('id'), - TextField::new('title'), - TextEditorField::new('description'), - ]; + return $crud + ->setEntityLabelInSingular('equipment_supplier') + ->setEntityLabelInPlural('equipment_supplier') + ->setSearchFields(['id', 'name']); } - */ } diff --git a/src/Controller/Admin/ParticipantKindCrudController.php b/src/Controller/Admin/ParticipantKindCrudController.php index 4d6ee023..1c738fca 100644 --- a/src/Controller/Admin/ParticipantKindCrudController.php +++ b/src/Controller/Admin/ParticipantKindCrudController.php @@ -3,23 +3,20 @@ namespace App\Controller\Admin; use App\Entity\ParticipantKind; -use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController; +use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; -class ParticipantKindCrudController extends AbstractCrudController +class ParticipantKindCrudController extends AbstractWorkshopSectionCrudController { public static function getEntityFqcn(): string { return ParticipantKind::class; } - /* - public function configureFields(string $pageName): iterable + public function configureCrud(Crud $crud): Crud { - return [ - IdField::new('id'), - TextField::new('title'), - TextEditorField::new('description'), - ]; + return $crud + ->setEntityLabelInSingular('participant_kind') + ->setEntityLabelInPlural('participant_kinds') + ->setSearchFields(['id', 'name']); } - */ } diff --git a/src/Controller/Admin/PermanenceCrudController.php b/src/Controller/Admin/PermanenceCrudController.php index 357a36ef..a9b101b3 100644 --- a/src/Controller/Admin/PermanenceCrudController.php +++ b/src/Controller/Admin/PermanenceCrudController.php @@ -15,7 +15,9 @@ use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField; use EasyCorp\Bundle\EasyAdminBundle\Field\TextareaField; use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; +use EasyCorp\Bundle\EasyAdminBundle\Filter\DateTimeFilter; use EasyCorp\Bundle\EasyAdminBundle\Filter\EntityFilter; +use EasyCorp\Bundle\EasyAdminBundle\Filter\TextFilter; use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider; use Symfony\Bridge\Doctrine\Form\Type\EntityType; @@ -63,11 +65,11 @@ public static function getEntityFqcn(): string public function configureFilters(Filters $filters): Filters { return $filters - ->add('date') - ->add('author') - ->add('attendees') - ->add('createdAt') - ->add('updatedAt') + ->add(DateTimeFilter::new('date', 'date')) + ->add(EntityFilter::new('author', 'author')) + ->add(TextFilter::new('attendees', 'attendees')) + ->add(DateTimeFilter::new('createdAt', 'created_at')) + ->add(DateTimeFilter::new('updatedAt', 'updated_at')) ->add(EntityFilter::new('center')->setFormTypeOption('value_type_options.multiple', 'true')) ->add(AssociationFilter::new('center.tags.id')->setLabel('tags')->setFormType(EntityType::class)->setFormTypeOption('class', CenterTag::class)); } @@ -76,32 +78,32 @@ public function configureCrud(Crud $crud): Crud { return $crud ->overrideTemplate('crud/index', 'bundles/EasyAdminBundle/Permanence/index.html.twig') - ->setEntityLabelInSingular('Permanence') - ->setEntityLabelInPlural('Permanences') + ->setEntityLabelInSingular('permanence') + ->setEntityLabelInPlural('permanences') ->setSearchFields(['id', 'hours', 'nbPros', 'nbProAccounts', 'nbBeneficiaries', 'nbBeneficiariesAccounts', 'nbStoredDocs', 'beneficiariesNotes', 'proNotes', 'reconnectNotes', 'attendees']); } public function configureFields(string $pageName): \Generator { yield IntegerField::new('id')->hideOnForm()->setColumns(3); - yield DateField::new('date')->setColumns(3); - yield IntegerField::new('hours')->setColumns(3); - yield TextField::new('place')->onlyOnForms()->setColumns(3); - yield TextField::new('attendees')->hideOnIndex()->setColumns(3); - yield AssociationField::new('author')->hideOnIndex()->setColumns(6); - yield AssociationField::new('center')->hideOnIndex()->setColumns(6); - yield IntegerField::new('nbPros')->setColumns(3); - yield IntegerField::new('nbBeneficiaries')->setColumns(3); - yield IntegerField::new('nbBeneficiariesAccounts')->setColumns(3); - yield IntegerField::new('nbUninterestedBeneficiaries', 'nbUninterestedBeneficiaries')->setColumns(3); - yield IntegerField::new('nbHelpedBeneficiaries', 'nbHelpedBeneficiaries')->setColumns(3); - yield IntegerField::new('nbStoredDocs')->setColumns(6)->hideOnIndex(); - yield IntegerField::new('maleCount')->setColumns(3)->setRequired(true)->hideOnIndex(); - yield IntegerField::new('femaleCount')->setColumns(3)->setRequired(true)->hideOnIndex(); - yield IntegerField::new('noGenderCount')->setColumns(3)->setRequired(true)->hideOnIndex(); - yield TextareaField::new('beneficiariesNotes')->hideOnIndex()->setColumns(6); - yield TextareaField::new('proNotes')->hideOnIndex()->setColumns(6); - yield DateTimeField::new('createdAt')->onlyOnDetail(); - yield DateTimeField::new('updatedAt')->onlyOnDetail(); + yield DateField::new('date')->setColumns(3)->setLabel('date'); + yield IntegerField::new('hours')->setColumns(3)->setLabel('hours'); + yield TextField::new('place')->onlyOnForms()->setColumns(3)->setLabel('place'); + yield TextField::new('attendees')->hideOnIndex()->setColumns(3)->setLabel('attendees'); + yield AssociationField::new('author')->hideOnIndex()->setColumns(6)->setLabel('author'); + yield AssociationField::new('center')->hideOnIndex()->setColumns(6)->setLabel('center'); + yield IntegerField::new('nbPros')->setColumns(3)->setLabel('pros_count'); + yield IntegerField::new('nbBeneficiaries')->setColumns(3)->setLabel('beneficiaries_count'); + yield IntegerField::new('nbBeneficiariesAccounts')->setColumns(3)->setLabel('beneficiaries_accounts_count'); + yield IntegerField::new('nbUninterestedBeneficiaries', 'nbUninterestedBeneficiaries')->setColumns(3)->setLabel('unintested_beneficiaries_count'); + yield IntegerField::new('nbHelpedBeneficiaries', 'nbHelpedBeneficiaries')->setColumns(3)->setLabel('helped_beneficiaries_count'); + yield IntegerField::new('nbStoredDocs')->setColumns(6)->hideOnIndex()->setLabel('stored_docs_count'); + yield IntegerField::new('maleCount')->setColumns(3)->setRequired(true)->hideOnIndex()->setLabel('male_count'); + yield IntegerField::new('femaleCount')->setColumns(3)->setRequired(true)->hideOnIndex()->setLabel('female_count'); + yield IntegerField::new('noGenderCount')->setColumns(3)->setRequired(true)->hideOnIndex()->setLabel('no_gender_count'); + yield TextareaField::new('beneficiariesNotes')->hideOnIndex()->setColumns(6)->setLabel('beneficiaries_notes'); + yield TextareaField::new('proNotes')->hideOnIndex()->setColumns(6)->setLabel('pro_notes'); + yield DateTimeField::new('createdAt')->onlyOnDetail()->setLabel('created_at'); + yield DateTimeField::new('updatedAt')->onlyOnDetail()->setLabel('updated_at'); } } diff --git a/src/Controller/Admin/SkillCrudController.php b/src/Controller/Admin/SkillCrudController.php index 8d1a79b6..0a5fa7cd 100644 --- a/src/Controller/Admin/SkillCrudController.php +++ b/src/Controller/Admin/SkillCrudController.php @@ -3,24 +3,28 @@ namespace App\Controller\Admin; use App\Entity\Skill; -use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController; +use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField; -use EasyCorp\Bundle\EasyAdminBundle\Field\IdField; -use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; -class SkillCrudController extends AbstractCrudController +class SkillCrudController extends AbstractWorkshopSectionCrudController { public static function getEntityFqcn(): string { return Skill::class; } + public function configureCrud(Crud $crud): Crud + { + return $crud + ->setEntityLabelInSingular('skill') + ->setEntityLabelInPlural('skills'); + } + public function configureFields(string $pageName): iterable { return [ - IdField::new('id')->hideOnForm(), - TextField::new('name'), - AssociationField::new('topic'), + ...parent::configureFields($pageName), + AssociationField::new('topic')->setLabel('topic'), ]; } } diff --git a/src/Controller/Admin/TopicCrudController.php b/src/Controller/Admin/TopicCrudController.php index 897e28b9..9da305b3 100644 --- a/src/Controller/Admin/TopicCrudController.php +++ b/src/Controller/Admin/TopicCrudController.php @@ -3,23 +3,19 @@ namespace App\Controller\Admin; use App\Entity\Topic; -use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController; +use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; -class TopicCrudController extends AbstractCrudController +class TopicCrudController extends AbstractWorkshopSectionCrudController { public static function getEntityFqcn(): string { return Topic::class; } - /* - public function configureFields(string $pageName): iterable + public function configureCrud(Crud $crud): Crud { - return [ - IdField::new('id'), - TextField::new('title'), - TextEditorField::new('description'), - ]; + return $crud + ->setEntityLabelInSingular('topic') + ->setEntityLabelInPlural('topics'); } - */ } diff --git a/src/Controller/Admin/UsedEquipmentCrudController.php b/src/Controller/Admin/UsedEquipmentCrudController.php index 10124be9..9eb5c052 100644 --- a/src/Controller/Admin/UsedEquipmentCrudController.php +++ b/src/Controller/Admin/UsedEquipmentCrudController.php @@ -3,7 +3,10 @@ namespace App\Controller\Admin; use App\Entity\UsedEquipment; +use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController; +use EasyCorp\Bundle\EasyAdminBundle\Field\IdField; +use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; class UsedEquipmentCrudController extends AbstractCrudController { @@ -12,14 +15,18 @@ public static function getEntityFqcn(): string return UsedEquipment::class; } - /* + public function configureCrud(Crud $crud): Crud + { + return $crud + ->setEntityLabelInSingular('used_equipment') + ->setEntityLabelInPlural('used_equipments'); + } + public function configureFields(string $pageName): iterable { return [ - IdField::new('id'), - TextField::new('title'), - TextEditorField::new('description'), + IdField::new('id')->hideOnForm(), + TextField::new('name')->setLabel('name'), ]; } - */ } diff --git a/src/Controller/Admin/UserCrudController.php b/src/Controller/Admin/UserCrudController.php index bc3e266f..1d5696a9 100644 --- a/src/Controller/Admin/UserCrudController.php +++ b/src/Controller/Admin/UserCrudController.php @@ -27,8 +27,8 @@ public static function getEntityFqcn(): string public function configureCrud(Crud $crud): Crud { return $crud - ->setEntityLabelInSingular('User') - ->setEntityLabelInPlural('User') + ->setEntityLabelInSingular('user') + ->setEntityLabelInPlural('users') ->setSearchFields(['id', 'email', 'roles']); } @@ -47,7 +47,7 @@ public function updateEntity(EntityManagerInterface $entityManager, mixed $entit public function configureFields(string $pageName): \Generator { yield TextField::new('email'); - yield TextField::new('plainPassword', 'Password')->onlyOnForms(); + yield TextField::new('plainPassword', 'password')->onlyOnForms(); yield AssociationField::new('permanences')->onlyOnIndex(); yield AssociationField::new('workshops')->onlyOnIndex(); yield IntegerField::new('id', 'ID')->onlyOnDetail(); diff --git a/src/Controller/Admin/WorkshopCrudController.php b/src/Controller/Admin/WorkshopCrudController.php index 773e8859..c48a45f0 100644 --- a/src/Controller/Admin/WorkshopCrudController.php +++ b/src/Controller/Admin/WorkshopCrudController.php @@ -14,6 +14,8 @@ use EasyCorp\Bundle\EasyAdminBundle\Field\DateTimeField; use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField; use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; +use EasyCorp\Bundle\EasyAdminBundle\Filter\BooleanFilter; +use EasyCorp\Bundle\EasyAdminBundle\Filter\DateTimeFilter; use EasyCorp\Bundle\EasyAdminBundle\Filter\EntityFilter; use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider; use Symfony\Bridge\Doctrine\Form\Type\EntityType; @@ -68,17 +70,17 @@ public static function getEntityFqcn(): string public function configureFilters(Filters $filters): Filters { return $filters - ->add('date') - ->add('author') - ->add('participantKinds') - ->add('topics') - ->add('ageBreakpoints') - ->add('equipmentSuppliers') - ->add('usedEquipments') - ->add('usedVault') - ->add('skills') - ->add('duration') - ->add(EntityFilter::new('center')->setFormTypeOption('value_type_options.multiple', 'true')) + ->add(DateTimeFilter::new('date', 'date')) + ->add(EntityFilter::new('author', 'author')) + ->add(EntityFilter::new('participantKinds', 'participant_kinds')) + ->add(EntityFilter::new('topics', 'topics')) + ->add(EntityFilter::new('ageBreakpoints', 'age_breakpoints')) + ->add(EntityFilter::new('equipmentSuppliers', 'equipment_supplier')) + ->add(EntityFilter::new('usedEquipments', 'used_equipments')) + ->add(BooleanFilter::new('usedVault', 'has_used_vault')) + ->add(EntityFilter::new('skills', 'skills')) + ->add(EntityFilter::new('duration', 'duration')) + ->add(EntityFilter::new('center', 'center')->setFormTypeOption('value_type_options.multiple', 'true')) ->add(AssociationFilter::new('center.tags.id')->setLabel('tags')->setFormType(EntityType::class)->setFormTypeOption('class', CenterTag::class)); } @@ -86,40 +88,40 @@ public function configureCrud(Crud $crud): Crud { return $crud ->overrideTemplate('crud/index', 'bundles/EasyAdminBundle/Workshop/index.html.twig') - ->setEntityLabelInSingular('Workshop') - ->setEntityLabelInPlural('Workshops') + ->setEntityLabelInSingular('workshop') + ->setEntityLabelInPlural('workshops') ->setSearchFields(['id', 'date', 'attendees', 'topics.name', 'skills.name', 'participantKinds.name']); } public function configureFields(string $pageName): iterable { $id = IntegerField::new('id', 'ID'); - $date = DateField::new('date'); - $place = TextField::new('place'); - $topicPrecision = TextField::new('topicPrecision'); - $nbParticipants = IntegerField::new('nbParticipants'); - $participantKinds = AssociationField::new('participantKinds'); - $globalReport = TextField::new('globalReport'); - $author = AssociationField::new('author'); - $createdAt = DateTimeField::new('createdAt'); - $updatedAt = DateTimeField::new('updatedAt'); - $center = AssociationField::new('center'); - $topics = AssociationField::new('topics'); - $ageBreakpoints = AssociationField::new('ageBreakpoints'); - $equipmentSuppliers = AssociationField::new('equipmentSuppliers'); - $usedEquipments = AssociationField::new('usedEquipments'); - $nbBeneficiariesAccounts = IntegerField::new('nbBeneficiariesAccounts'); - $nbStoredDocs = IntegerField::new('nbStoredDocs'); - $nbCreatedEvents = IntegerField::new('nbCreatedEvents'); - $nbCreatedContacts = IntegerField::new('nbCreatedContacts'); - $nbCreatedNotes = IntegerField::new('nbCreatedNotes'); - $skills = AssociationField::new('skills'); - $attendees = TextField::new('attendees'); - $improvementAxis = TextField::new('improvementAxis'); - $duration = AssociationField::new('duration'); - $maleCount = IntegerField::new('maleCount')->setRequired(true); - $femaleCount = IntegerField::new('femaleCount')->setRequired(true); - $noGenderCount = IntegerField::new('noGenderCount')->setRequired(true); + $date = DateField::new('date')->setLabel('date'); + $place = TextField::new('place')->setLabel('place'); + $topicPrecision = TextField::new('topicPrecision')->setLabel('topic_precision'); + $nbParticipants = IntegerField::new('nbParticipants')->setLabel('attendees_count'); + $participantKinds = AssociationField::new('participantKinds')->setLabel('participant_kinds'); + $globalReport = TextField::new('globalReport')->setLabel('global_report'); + $author = AssociationField::new('author')->setLabel('author'); + $createdAt = DateTimeField::new('createdAt')->setLabel('created_at'); + $updatedAt = DateTimeField::new('updatedAt')->setLabel('updated_at'); + $center = AssociationField::new('center')->setLabel('center'); + $topics = AssociationField::new('topics')->setLabel('topics'); + $ageBreakpoints = AssociationField::new('ageBreakpoints')->setLabel('age_breakpoints'); + $equipmentSuppliers = AssociationField::new('equipmentSuppliers')->setLabel('equipment_supplier'); + $usedEquipments = AssociationField::new('usedEquipments')->setLabel('used_equipments'); + $nbBeneficiariesAccounts = IntegerField::new('nbBeneficiariesAccounts')->setLabel('beneficiaries_accounts_count'); + $nbStoredDocs = IntegerField::new('nbStoredDocs')->setLabel('stored_docs_count'); + $nbCreatedEvents = IntegerField::new('nbCreatedEvents')->setLabel('created_events_count'); + $nbCreatedContacts = IntegerField::new('nbCreatedContacts')->setLabel('created_contacts_count'); + $nbCreatedNotes = IntegerField::new('nbCreatedNotes')->setLabel('created_notes_count'); + $skills = AssociationField::new('skills')->setLabel('skills'); + $attendees = TextField::new('attendees')->setLabel('attendees'); + $improvementAxis = TextField::new('improvementAxis')->setLabel('improvement_axis'); + $duration = AssociationField::new('duration')->setLabel('duration'); + $maleCount = IntegerField::new('maleCount')->setRequired(true)->setLabel('male_count'); + $femaleCount = IntegerField::new('femaleCount')->setRequired(true)->setLabel('female_count'); + $noGenderCount = IntegerField::new('noGenderCount')->setRequired(true)->setLabel('no_gender_count'); if (Crud::PAGE_DETAIL === $pageName) { return [ diff --git a/translations/messages.fr.yaml b/translations/messages.fr.yaml index dcc30f78..6ce88a7e 100644 --- a/translations/messages.fr.yaml +++ b/translations/messages.fr.yaml @@ -1,93 +1,63 @@ -Age Breakpoints: Tranches d'âge -AgeBreakpoint: Tranches d'âge -AgeBreakpoints: Tranches d'âge -Attendees: Participants -Author: Créateur -Beneficiaries Notes: 'Bénéficiaires : bilan et axes d’amélioration' -BeneficiariesNotes: Remarques concernant les bénéficiaires -Category: Catégorie -Center: Centres -CenterTag: Label -Color: Couleur -Created At: Date de création -CreatedAt: Date de création -Date: Date -Duration: Durée -Equipment Suppliers: Equipement fourni par -EquipmentSupplier: Equipement fourni par -EquipmentSuppliers: Equipement fourni par -Female Count: Nb femmes -Global Report: Bilan global -Hours: Heures ID: Id -Improvement Axis: Axes d'amélioration -Male Count: Nb hommes -Name: Nom -Nb Beneficiaries Accounts: Nb CFN -Nb Beneficiaries: Nb Bénef -Nb Created Contacts: Nb de contacts créés -Nb Created Events: Nb d'événements créés -Nb Created Notes: Nb de notes créées -Nb Pro Accounts: Nb Comptes Pro -Nb Pros: Nb Pros -Nb Stored Docs: Nb docs stockés -NbStoredDocs: Nombre de documents stockés -No Gender Count: Nb autres -Participant Kind: Types de participants -Participant Kinds: Types de participants -ParticipantKind: Types de participants -ParticipantKinds: Types de participants -Password: Mot de passe -permanences_count: Nb Permanences -Permanence: Permanence -Permanences: Permanence -Place: Lieu -Pro Notes: 'Professionnels & Structure : bilan et axes d’amélioration' -ProNotes: Remarques concernant les bénéficiaires -Project: Projet -Reconnect Notes: Remarques concernant Reconnect -ReconnectNotes: Remarques concernant Reconnect -Skill: Compétence -Skills: Compétences -Tag: Label -Tags: Labels -Topic Precision: Précisions sur le thème -Topic: Thème -Topics: Thèmes -Updated At: Date de dernière mise à jour -UpdatedAt: Date de mise à jour -Used Equipments: Outils utilisés -UsedEquipment: Outils utilisés -UsedEquipments: Outils utilisés -UsedVault: Utilisation du CFN -User: Utilisateurs -workshops_count: Nb Ateliers -Workshop: Atelier -Workshops: Ateliers +age_breakpoint: Tranche d'âge +age_breakpoints: Tranches d'âges attendees: Participants +attendees_count: nbParticipants author: Créateur +beneficiaries_accounts_count: Nb CFN +beneficiaries_count: Nombre de Bénéficiaires rencontrés +beneficiaries_notes: 'Bénéficiaires : bilan et axes d’amélioration' beneficiariesNotes: 'Bénéficiaires : bilan et axes d’amélioration' +category: Categorie center: Centre -createdAt: Date de création +centers: Centres +center_tag: Label +center_tags: Labels +color: Couleur +created_at: Date de création +created_contacts_count: Nb de contacts créés +created_events_count: Nb d'événements créés +created_notes_count: Nb de notes créées date: Date +duration: Durée +durations: Durées +equipment_supplier: Equipement fourni par export: Exporter -femaleCount: Nb femmes +female_count: Nb femmes field_format_unknown: Format du champ inconnu +global_report: Bilan global +has_used_vault: Utilisation du CFN +helped_beneficiaries_count: Nb bénéf aidés sur le CFN hours: Heures id: Id -maleCount: Nb hommes -nbBeneficiaries: Nombre de bénéficiaires rencontrés +improvement_axis: Axes d'amélioration +male_count: Nb hommes +name: Nom nbBeneficiariesAccounts: Nombre de CFN -nbHelpedBeneficiaries: Nb bénéf aidés sur le CFN -nbNewParticipants: Nombre de nouveaux participants -nbProAccounts: Nombre de comptes Pro crées -nbPros: Nombre de Professionnels présents -nbStoredDocs: Nombre de documents stockés -nbUninterestedBeneficiaries: Nb benef pas intéressés -noGenderCount: Nb autres +no_gender_count: Nb autres +participant_kind: Type de participant +participant_kinds: Types de participants +password: Mot de passe +permanence: Permanence +permanences: Permanences +permanences_count: Nb Permanences place: Lieu -proNotes: 'Professionnels & Structure : bilan et axes d’amélioration' -reconnectNotes: Remarques concernant Reconnect +pro_notes: 'Professionnels & Structure : bilan et axes d’amélioration' +pros_count: Nombre de Professionnels présents +skill: Compétence +skills: Compétences +stored_docs_count: Nb docs stockés tags: Labels +topic: Thème +topic_precision: Précisions sur le thème +topics: Thèmes unfilled: Non renseigné -updatedAt: Date de mise à jour +unintested_beneficiaries_count: Nb benef pas intéressés +updated_at: Date de mise à jour +user: Utilisateur +users: Utilisateurs +used_equipment: Outil utilisé +used_equipments: Outils utilisés +workshops: Ateliers +workshops_count: Nb Ateliers +workshop: Atelier