From 04359f27c6d1563b840980aae56be0ead9d271f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 24 May 2023 13:11:40 +0200 Subject: [PATCH 1/6] Revert "Revert "FIX [duplicates] reinstate gestion des doublons"" This reverts commit 5109490aad0a0c12db9a8f4c3729de11a131f6bd. --- .../Actions/Remove/PersonMove.php | 69 ++++++++++++++----- .../Controller/PersonDuplicateController.php | 6 +- .../Menu/PersonMenuBuilder.php | 25 ++++--- .../views/PersonDuplicate/_sidepane.html.twig | 2 +- .../views/PersonDuplicate/confirm.html.twig | 8 +-- 5 files changed, 75 insertions(+), 35 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php index 13a62094d..8363134fd 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php @@ -13,7 +13,11 @@ namespace Chill\PersonBundle\Actions\Remove; use Chill\PersonBundle\Actions\ActionEvent; use Chill\PersonBundle\Entity\AccompanyingPeriod; +use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation; +use Chill\PersonBundle\Entity\Household\HouseholdMember; +use Chill\PersonBundle\Entity\Household\PersonHouseholdAddress; use Chill\PersonBundle\Entity\Person; +use Chill\PersonBundle\Entity\Relationships\Relationship; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Mapping\ClassMetadata; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -42,9 +46,10 @@ class PersonMove protected $eventDispatcher; public function __construct( - EntityManagerInterface $em, + EntityManagerInterface $em, EventDispatcherInterface $eventDispatcher - ) { + ) + { $this->em = $em; $this->eventDispatcher = $eventDispatcher; } @@ -84,8 +89,11 @@ class PersonMove } foreach ($metadata->getAssociationMappings() as $field => $mapping) { - if (Person::class === $mapping['targetEntity']) { - if (in_array($metadata->getName(), $toDelete, true)) { + if (in_array($mapping['sourceEntity'], $this->getIgnoredEntities())) { + continue; + } + if (Person::class === $mapping['targetEntity'] and true === $mapping['isOwningSide']) { + if (in_array($mapping['sourceEntity'], $toDelete, true)) { $sql = $this->createDeleteSQL($metadata, $from, $field); $event = new ActionEvent( $from->getId(), @@ -117,10 +125,11 @@ class PersonMove $from->getId() ); + dump($sqls); return $sqls; } - protected function createDeleteSQL(ClassMetadata $metadata, Person $from, $field): string + private function createDeleteSQL(ClassMetadata $metadata, Person $from, $field): string { $mapping = $metadata->getAssociationMapping($field); @@ -137,26 +146,41 @@ class PersonMove ); } - protected function createMoveSQL(ClassMetadata $metadata, Person $from, Person $to, $field): string + private function createMoveSQL(ClassMetadata $metadata, Person $from, Person $to, $field): string { $mapping = $metadata->getAssociationMapping($field); // Set part of the query, aka in "UPDATE table SET " $sets = []; - - foreach ($mapping['joinColumns'] as $columns) { - $sets[] = sprintf('%s = %d', $columns['name'], $to->getId()); - } - $conditions = []; + dump($mapping); - foreach ($mapping['joinColumns'] as $columns) { - $conditions[] = sprintf('%s = %d', $columns['name'], $from->getId()); + if (array_key_exists('joinTable', $mapping)) { + $tableName = (null !== ($mapping['joinTable']['schema'] ?? null) ? $mapping['joinTable']['schema'] . '.' : '') + . $mapping['joinTable']['name']; + + foreach ($mapping['joinTable']['inverseJoinColumns'] as $columns) { + $sets[] = sprintf('%s = %d', $columns['name'], $to->getId()); + } + + foreach ($mapping['joinTable']['inverseJoinColumns'] as $columns) { + $conditions[] = sprintf('%s = %d', $columns['name'], $from->getId()); + } + } elseif (array_key_exists('joinColumns', $mapping)) { + $tableName = $this->getTableName($metadata); + foreach ($mapping['joinColumns'] as $columns) { + $sets[] = sprintf('%s = %d', $columns['name'], $to->getId()); + } + + + foreach ($mapping['joinColumns'] as $columns) { + $conditions[] = sprintf('%s = %d', $columns['name'], $from->getId()); + } } return sprintf( 'UPDATE %s SET %s WHERE %s', - $this->getTableName($metadata), + $tableName, implode(' ', $sets), implode(' AND ', $conditions) ); @@ -166,10 +190,23 @@ class PersonMove * return an array of classes where entities should be deleted * instead of moved. */ - protected function getDeleteEntities(): array + private function getDeleteEntities(): array { return [ - AccompanyingPeriod::class, + Person\PersonCenterHistory::class, + HouseholdMember::class, + AccompanyingPeriodParticipation::class, + AccompanyingPeriod\AccompanyingPeriodWork::class, + Relationship::class + ]; + } + + private function getIgnoredEntities(): array + { + return [ + Person\PersonCurrentAddress::class, + PersonHouseholdAddress::class, + Person\PersonCenterCurrent::class, ]; } diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php b/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php index 928112d2e..ab353c83e 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php @@ -247,7 +247,7 @@ class PersonDuplicateController extends Controller ); $duplicatePersons = $this->similarPersonMatcher-> - matchPerson($person, $personNotDuplicateRepository, 0.5, SimilarPersonMatcher::SIMILAR_SEARCH_ORDER_BY_ALPHABETICAL); + matchPerson($person, 0.5, SimilarPersonMatcher::SIMILAR_SEARCH_ORDER_BY_ALPHABETICAL, false, $personNotDuplicateRepository); $notDuplicatePersons = $personNotDuplicateRepository->findNotDuplicatePerson($person); @@ -264,14 +264,14 @@ class PersonDuplicateController extends Controller $nb_activity = $em->getRepository(Activity::class)->findBy(['person' => $id]); $nb_document = $em->getRepository(PersonDocument::class)->findBy(['person' => $id]); - $nb_event = $em->getRepository(Participation::class)->findBy(['person' => $id]); +// $nb_event = $em->getRepository(Participation::class)->findBy(['person' => $id]); $nb_task = $em->getRepository(SingleTask::class)->countByParameters(['person' => $id]); $person = $em->getRepository(Person::class)->findOneBy(['id' => $id]); return [ 'nb_activity' => count($nb_activity), 'nb_document' => count($nb_document), - 'nb_event' => count($nb_event), +// 'nb_event' => count($nb_event), 'nb_task' => $nb_task, 'nb_addresses' => count($person->getAddresses()), ]; diff --git a/src/Bundle/ChillPersonBundle/Menu/PersonMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/PersonMenuBuilder.php index 39ac557fb..b7934c2b2 100644 --- a/src/Bundle/ChillPersonBundle/Menu/PersonMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/PersonMenuBuilder.php @@ -15,6 +15,7 @@ use Chill\MainBundle\Routing\LocalMenuBuilderInterface; use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Repository\ResidentialAddressRepository; use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter; +use Chill\PersonBundle\Security\Authorization\PersonVoter; use Knp\Menu\MenuItem; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; use Symfony\Component\Security\Core\Security; @@ -106,17 +107,19 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface ->setExtras([ 'order' => 99999, ]); - /* - $menu->addChild($this->translator->trans('Person duplicate'), [ - 'route' => 'chill_person_duplicate_view', - 'routeParameters' => [ - 'person_id' => $parameters['person']->getId(), - ], - ]) - ->setExtras([ - 'order' => 99999, - ]); - */ + + if ($this->security->isGranted(PersonVoter::DUPLICATE, $parameters['person'])) { + $menu->addChild($this->translator->trans('Person duplicate'), [ + 'route' => 'chill_person_duplicate_view', + 'routeParameters' => [ + 'person_id' => $parameters['person']->getId(), + ], + ]) + ->setExtras([ + 'order' => 99999, + ]); + } + if ( 'visible' === $this->showAccompanyingPeriod && $this->security->isGranted(AccompanyingPeriodVoter::SEE, $parameters['person']) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/PersonDuplicate/_sidepane.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/PersonDuplicate/_sidepane.html.twig index 660fff7a6..1e770062a 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/PersonDuplicate/_sidepane.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/PersonDuplicate/_sidepane.html.twig @@ -39,7 +39,7 @@
  • {{ person.counters.nb_activity }} {{ (person.counters.nb_activity > 1)? 'échanges' : 'échange' }}
  • {{ person.counters.nb_task }} {{ (person.counters.nb_task > 1)? 'tâches' : 'tâche' }}
  • {{ person.counters.nb_document }} {{ (person.counters.nb_document > 1)? 'documents' : 'document' }}
  • -
  • {{ person.counters.nb_event }} {{ (person.counters.nb_event > 1)? 'événements' : 'événement' }}
  • +{#
  • {{ person.counters.nb_event }} {{ (person.counters.nb_event > 1)? 'événements' : 'événement' }}
  • #}
  • {{ person.counters.nb_addresses }} {{ (person.counters.nb_addresses > 1)? 'adresses' : 'adresse' }}
  • diff --git a/src/Bundle/ChillPersonBundle/Resources/views/PersonDuplicate/confirm.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/PersonDuplicate/confirm.html.twig index 304e78eb3..218b89f2a 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/PersonDuplicate/confirm.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/PersonDuplicate/confirm.html.twig @@ -25,7 +25,7 @@

    {{ 'Merge duplicate persons folders'|trans }}

    -
    +

    {{ 'Old person'|trans }}: {{ 'Old person explain'|trans }}

    @@ -43,7 +43,7 @@
    -
    +

    {{ 'New person'|trans }}: {{ 'New person explain'|trans }}

    @@ -63,10 +63,10 @@ {{ form_start(form) }} -
    +
    -
    +
    {{ form_widget(form.confirm) }}
    From a31c4063a19dfc27e3bb4f8502f05c06ed650b3e Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 24 May 2023 14:02:05 +0200 Subject: [PATCH 2/6] DX [cs-fixer] fixes --- .../Command/SynchronizeEntityInfoViewsCommand.php | 1 - .../Controller/PermissionsGroupController.php | 1 - .../ChillMainBundle/Controller/UserExportController.php | 1 - .../AccompanyingPeriodStepChangeMessageHandler.php | 1 - .../Lifecycle/AccompanyingPeriodStepChangeRequestor.php | 1 - .../Export/Export/ListHouseholdInPeriod.php | 1 - .../AccompanyingPeriod/AccompanyingPeriodInfoRepository.php | 1 - .../Lifecycle/AccompanyingPeriodStepChangeCronjobTest.php | 1 - .../Filter/SocialWorkFilters/SocialWorkTypeFilterTest.php | 6 +----- 9 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Command/SynchronizeEntityInfoViewsCommand.php b/src/Bundle/ChillMainBundle/Command/SynchronizeEntityInfoViewsCommand.php index c3dc8a87c..05fefe20f 100644 --- a/src/Bundle/ChillMainBundle/Command/SynchronizeEntityInfoViewsCommand.php +++ b/src/Bundle/ChillMainBundle/Command/SynchronizeEntityInfoViewsCommand.php @@ -36,5 +36,4 @@ class SynchronizeEntityInfoViewsCommand extends Command return 0; } - } diff --git a/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php b/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php index 488092931..97e80916c 100644 --- a/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php +++ b/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php @@ -163,7 +163,6 @@ final class PermissionsGroupController extends AbstractController */ public function deleteLinkRoleScopeAction(int $pgid, int $rsid): Response { - $permissionsGroup = $this->permissionsGroupRepository->find($pgid); $roleScope = $this->roleScopeRepository->find($rsid); diff --git a/src/Bundle/ChillMainBundle/Controller/UserExportController.php b/src/Bundle/ChillMainBundle/Controller/UserExportController.php index dc2674dbb..530ac19b7 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserExportController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserExportController.php @@ -141,5 +141,4 @@ final readonly class UserExportController ] ); } - } diff --git a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeMessageHandler.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeMessageHandler.php index 881b3999a..4a9873c6d 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeMessageHandler.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeMessageHandler.php @@ -34,5 +34,4 @@ class AccompanyingPeriodStepChangeMessageHandler implements MessageHandlerInterf ($this->changer)($period, $message->getTransition()); } - } diff --git a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeRequestor.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeRequestor.php index 3d4979608..f1c3563fc 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeRequestor.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeRequestor.php @@ -84,5 +84,4 @@ class AccompanyingPeriodStepChangeRequestor $this->messageBus->dispatch(new AccompanyingPeriodStepChangeRequestMessage($accompanyingPeriodId, 'mark_active')); } } - } diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php index 24d929c00..8894d145d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php @@ -107,7 +107,6 @@ class ListHouseholdInPeriod implements ListInterface, GroupedExportInterface return $this->aggregateStringHelper->getLabelMulti($key, $values, 'export.list.household.' . $key); case 'compositionType': - //dump($values); return $this->translatableStringHelper->getLabel($key, $values, 'export.list.household.' . $key); default: diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodInfoRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodInfoRepository.php index 57925b131..0296d00f1 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodInfoRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodInfoRepository.php @@ -89,5 +89,4 @@ readonly class AccompanyingPeriodInfoRepository implements AccompanyingPeriodInf { return AccompanyingPeriodInfo::class; } - } diff --git a/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjobTest.php b/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjobTest.php index 5c3c29179..5a5b50dbb 100644 --- a/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjobTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjobTest.php @@ -51,5 +51,4 @@ class AccompanyingPeriodStepChangeCronjobTest extends TestCase // can not run: not enough elapsed time yield ['2023-01-15T01:00:00+02:00', new \DateTimeImmutable('2023-01-15T00:30:00+02:00'), false]; } - } diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/SocialWorkTypeFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/SocialWorkTypeFilterTest.php index f462bc47e..5287ab844 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/SocialWorkTypeFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/SocialWorkTypeFilterTest.php @@ -78,17 +78,13 @@ final class SocialWorkTypeFilterTest extends AbstractFilterTest $goals = array_unique($goals); $results = array_unique($results); - $data = [ + return [ [ 'actionType' => implode(',', $actions), 'goal' => implode(',', $goals), 'result' => implode(',', $results), ], ]; - /// TODO ne fonctionne pas - var_dump($data); - - return $data; } public function getQueryBuilders(): array From f5448f9d95babf82d972d3ccc31eb0430cc4d9c7 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 24 May 2023 14:02:49 +0200 Subject: [PATCH 3/6] DX [phpstan] fixes --- .../ChillPersonBundle/Actions/Remove/PersonMove.php | 8 +++----- .../Controller/PersonDuplicateController.php | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php index 8363134fd..4e2f7468e 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php @@ -48,8 +48,7 @@ class PersonMove public function __construct( EntityManagerInterface $em, EventDispatcherInterface $eventDispatcher - ) - { + ) { $this->em = $em; $this->eventDispatcher = $eventDispatcher; } @@ -89,7 +88,7 @@ class PersonMove } foreach ($metadata->getAssociationMappings() as $field => $mapping) { - if (in_array($mapping['sourceEntity'], $this->getIgnoredEntities())) { + if (in_array($mapping['sourceEntity'], $this->getIgnoredEntities(), true)) { continue; } if (Person::class === $mapping['targetEntity'] and true === $mapping['isOwningSide']) { @@ -125,7 +124,6 @@ class PersonMove $from->getId() ); - dump($sqls); return $sqls; } @@ -153,7 +151,7 @@ class PersonMove // Set part of the query, aka in "UPDATE table SET " $sets = []; $conditions = []; - dump($mapping); + $tableName = ''; if (array_key_exists('joinTable', $mapping)) { $tableName = (null !== ($mapping['joinTable']['schema'] ?? null) ? $mapping['joinTable']['schema'] . '.' : '') diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php b/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php index ab353c83e..386e55039 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php @@ -247,7 +247,7 @@ class PersonDuplicateController extends Controller ); $duplicatePersons = $this->similarPersonMatcher-> - matchPerson($person, 0.5, SimilarPersonMatcher::SIMILAR_SEARCH_ORDER_BY_ALPHABETICAL, false, $personNotDuplicateRepository); + matchPerson($person, 0.5, SimilarPersonMatcher::SIMILAR_SEARCH_ORDER_BY_ALPHABETICAL, false); $notDuplicatePersons = $personNotDuplicateRepository->findNotDuplicatePerson($person); @@ -271,7 +271,7 @@ class PersonDuplicateController extends Controller return [ 'nb_activity' => count($nb_activity), 'nb_document' => count($nb_document), -// 'nb_event' => count($nb_event), + // 'nb_event' => count($nb_event), 'nb_task' => $nb_task, 'nb_addresses' => count($person->getAddresses()), ]; From dad36927f31fd9e707e052ccba57366e5c01d29f Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 24 May 2023 15:34:39 +0200 Subject: [PATCH 4/6] FEATURE [export] uncheck all centers button --- .../views/Export/new_centers_step.html.twig | 17 +++++++++++++++++ .../translations/messages.fr.yml | 2 ++ 2 files changed, 19 insertions(+) diff --git a/src/Bundle/ChillMainBundle/Resources/views/Export/new_centers_step.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Export/new_centers_step.html.twig index 9e37dc2cd..40366669c 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Export/new_centers_step.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Export/new_centers_step.html.twig @@ -39,8 +39,13 @@ {{ 'This will eventually restrict your possibilities in filtering the data.'|trans }}

    {{ 'Center'|trans }}

    + {{ form_widget(form.centers.center) }} +
    + +
    + {% if form.centers.regroupment is defined %}

    {{ 'Pick aggregated centers'|trans }}

    {{ form_widget(form.centers.regroupment) }} @@ -53,3 +58,15 @@
    {% endblock content %} + +{% block js %} + + + +{% endblock js %} diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index 13c300fdd..fa28feef6 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -285,6 +285,8 @@ The export will contains only data from the picked centers.: L'export ne contien This will eventually restrict your possibilities in filtering the data.: Les possibilités de filtrages seront adaptées aux droits de consultation pour les centres choisis. Go to export options: Vers la préparation de l'export Pick aggregated centers: Regroupement de centres +uncheck all: Désélectionner tout les centres +check all: Sélectionner tout les centres # export creation step 'export' : choose aggregators, filtering and formatter Formatter: Mise en forme Choose the formatter: Choisissez le format d'export voulu. From 6e618e688bf4b593702212559277a9aaed02bfcf Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 24 May 2023 15:50:25 +0200 Subject: [PATCH 5/6] DX [php-cs-fixer] --- .../ChillActivityBundle/Controller/ActivityController.php | 4 ++-- src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php | 4 ++-- .../Controller/PersonDuplicateController.php | 2 +- src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php index 97678af50..444c663fc 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php @@ -650,8 +650,8 @@ final class ActivityController extends AbstractController throw $this->createNotFoundException('Accompanying Period not found'); } - // TODO Add permission - // $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); + // TODO Add permission + // $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); } else { throw $this->createNotFoundException('Person or Accompanying Period not found'); } diff --git a/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php b/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php index 03a1b09ab..a3cebec38 100644 --- a/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php +++ b/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php @@ -26,12 +26,12 @@ final class PersonMenuBuilder implements LocalMenuBuilderInterface /** * @var AuthorizationCheckerInterface */ - protected $authorizationChecker; + private $authorizationChecker; /** * @var TranslatorInterface */ - protected $translator; + private $translator; public function __construct( AuthorizationCheckerInterface $authorizationChecker, diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php b/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php index 386e55039..7ade542e0 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php @@ -264,7 +264,7 @@ class PersonDuplicateController extends Controller $nb_activity = $em->getRepository(Activity::class)->findBy(['person' => $id]); $nb_document = $em->getRepository(PersonDocument::class)->findBy(['person' => $id]); -// $nb_event = $em->getRepository(Participation::class)->findBy(['person' => $id]); + // $nb_event = $em->getRepository(Participation::class)->findBy(['person' => $id]); $nb_task = $em->getRepository(SingleTask::class)->countByParameters(['person' => $id]); $person = $em->getRepository(Person::class)->findOneBy(['id' => $id]); diff --git a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php index b1446a543..6c4984f33 100644 --- a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php +++ b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php @@ -117,7 +117,7 @@ class ThirdPartyType extends AbstractType 'label' => 'thirdparty.Contact data are confidential', ]); - // Institutional ThirdParty (parent) + // Institutional ThirdParty (parent) } else { $builder ->add('nameCompany', TextType::class, [ From 77997e2b6f9b6512e1dcb16c9baac9ff928fbd97 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 24 May 2023 16:24:58 +0200 Subject: [PATCH 6/6] FIX [review] fix review comments --- .../Resources/views/Export/new_centers_step.html.twig | 6 +++--- src/Bundle/ChillMainBundle/translations/messages.fr.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/views/Export/new_centers_step.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Export/new_centers_step.html.twig index 40366669c..2e2dc0ec6 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Export/new_centers_step.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Export/new_centers_step.html.twig @@ -43,7 +43,7 @@ {{ form_widget(form.centers.center) }}
    - +
    {% if form.centers.regroupment is defined %} @@ -63,9 +63,9 @@ diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index fa28feef6..78de523c4 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -285,8 +285,8 @@ The export will contains only data from the picked centers.: L'export ne contien This will eventually restrict your possibilities in filtering the data.: Les possibilités de filtrages seront adaptées aux droits de consultation pour les centres choisis. Go to export options: Vers la préparation de l'export Pick aggregated centers: Regroupement de centres -uncheck all: Désélectionner tout les centres -check all: Sélectionner tout les centres +uncheck all centers: Désélectionner tous les centres +check all centers: Sélectionner tous les centres # export creation step 'export' : choose aggregators, filtering and formatter Formatter: Mise en forme Choose the formatter: Choisissez le format d'export voulu.