From 4fa1bb4341b6570f87bb7126cf1fb9915174cf88 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 31 Jan 2022 12:45:02 +0100 Subject: [PATCH 1/6] demandeur not displayed in search list if anonymous --- .../views/Person/list_with_period.html.twig | 61 ++++++++++--------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Person/list_with_period.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Person/list_with_period.html.twig index 6f107a593..708766dc2 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Person/list_with_period.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Person/list_with_period.html.twig @@ -99,11 +99,12 @@ {% endif %}
- {% if acp.requestorPerson == person %} + {% if acp.requestoranonymous == false and acp.requestorPerson == person %} {{ 'Requestor'|trans({'gender': person.gender}) }} {% endif %} + {% if acp.emergency %} {{- 'Emergency'|trans|upper -}} {% endif %} @@ -186,39 +187,39 @@ - - {% if (acp.requestorPerson is not null and acp.requestorPerson.id != person.id) or acp.requestorThirdParty is not null %} -
-
-

- {% if acp.requestorPerson is not null %} - {{ 'Requestor'|trans({'gender': acp.requestorPerson.gender}) }} + {% if acp.requestoranonymous == false %} + {% if (acp.requestorPerson is not null and acp.requestorPerson.id != person.id) or acp.requestorThirdParty is not null %} +
+
+

+ {% if acp.requestorPerson is not null %} + {{ 'Requestor'|trans({'gender': acp.requestorPerson.gender}) }} + {% else %} + {{ 'Requestor'|trans({'gender': 'other'})}} + {% endif %} +

+
+
+ {% if acp.requestorThirdParty is not null %} + {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { + targetEntity: { name: 'thirdparty', id: acp.requestorThirdParty.id }, + action: 'show', + displayBadge: true, + buttonText: acp.requestorThirdParty|chill_entity_render_string + } %} {% else %} - {{ 'Requestor'|trans({'gender': 'other'})}} + {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { + targetEntity: { name: 'person', id: acp.requestorPerson.id }, + action: 'show', + displayBadge: true, + buttonText: acp.requestorPerson|chill_entity_render_string, + isDead: acp.requestorPerson.deathdate is not null + } %} {% endif %} -

+
-
- {% if acp.requestorThirdParty is not null %} - {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { - targetEntity: { name: 'thirdparty', id: acp.requestorThirdParty.id }, - action: 'show', - displayBadge: true, - buttonText: acp.requestorThirdParty|chill_entity_render_string - } %} - {% else %} - {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { - targetEntity: { name: 'person', id: acp.requestorPerson.id }, - action: 'show', - displayBadge: true, - buttonText: acp.requestorPerson|chill_entity_render_string, - isDead: acp.requestorPerson.deathdate is not null - } %} - {% endif %} -
-
+ {% endif %} {% endif %} - {% endfor %} From 68d99050bc7554702dc594929429257e03797746 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 31 Jan 2022 13:06:59 +0100 Subject: [PATCH 2/6] commentfield for marital status is always visible --- .../ChillPersonBundle/Resources/views/Person/edit.html.twig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Person/edit.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Person/edit.html.twig index d394a75a8..dc71d9981 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Person/edit.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Person/edit.html.twig @@ -85,9 +85,11 @@
{{ form_row(form.maritalStatusDate, { 'label' : 'Date of last marital status change'} ) }} - {{ form_row(form.maritalStatusComment, { 'label' : 'Comment on the marital status'} ) }}
{%- endif -%} +
+ {{ form_row(form.maritalStatusComment, { 'label' : 'Comment on the marital status'} ) }} +
{%- endif -%} From faebb0fe30a7597d03dbc0a82d18436a83a9f3a7 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 31 Jan 2022 13:08:55 +0100 Subject: [PATCH 3/6] changelog updated --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dcd149841..92e3085e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,8 @@ and this project adheres to * [parcours]: component added to change the opening date of a parcours (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/411) * [search]: listing of parcours display changed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/410) * [user]: page with accompanying periods to which is user is referent (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/408) - +* [person]: Comment on marital status is possible even if marital status is not defined (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/421) +* [parcours]: In the list of person results the requestor is not displayed if defined as anonymous (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/424) ## Test releases From bc1a63354cfd497fa6cab56142b7e675c279ec7d Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 31 Jan 2022 13:11:25 +0100 Subject: [PATCH 4/6] php csfixes --- .../Controller/UserAccompanyingPeriodController.php | 11 ++++++----- .../ChillPersonBundle/Entity/AccompanyingPeriod.php | 2 +- src/Bundle/ChillPersonBundle/Menu/UserMenuBuilder.php | 3 --- .../Repository/AccompanyingPeriodRepository.php | 10 +++++----- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php b/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php index ddaf1b856..aa849ac2b 100644 --- a/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php +++ b/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php @@ -9,7 +9,6 @@ declare(strict_types=1); - namespace Chill\PersonBundle\Controller; use Chill\MainBundle\Pagination\PaginatorFactory; @@ -20,7 +19,6 @@ use Symfony\Component\Routing\Annotation\Route; class UserAccompanyingPeriodController extends AbstractController { - private AccompanyingPeriodRepository $accompanyingPeriodRepository; private PaginatorFactory $paginatorFactory; @@ -38,13 +36,16 @@ class UserAccompanyingPeriodController extends AbstractController { $total = $this->accompanyingPeriodRepository->countBy(['user' => $this->getUser()]); $pagination = $this->paginatorFactory->create($total); - $accompanyingPeriods = $this->accompanyingPeriodRepository->findBy(['user' => $this->getUser()], - ['openingDate' => 'DESC'], $pagination->getItemsPerPage(), $pagination->getCurrentPageFirstItemNumber()); + $accompanyingPeriods = $this->accompanyingPeriodRepository->findBy( + ['user' => $this->getUser()], + ['openingDate' => 'DESC'], + $pagination->getItemsPerPage(), + $pagination->getCurrentPageFirstItemNumber() + ); return $this->render('@ChillPerson/AccompanyingPeriod/user_periods_list.html.twig', [ 'accompanyingPeriods' => $accompanyingPeriods, 'pagination' => $pagination, ]); - } } diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php index c457d2863..e7a1c514b 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php @@ -212,7 +212,7 @@ class AccompanyingPeriod implements * * @ORM\Column(type="date") * @Groups({"read", "write", "docgen:read"}) - * @Assert\LessThan(value= "today", groups={AccompanyingPeriod::STEP_CONFIRMED}) + * @Assert\LessThan(value="today", groups={AccompanyingPeriod::STEP_CONFIRMED}) * @Assert\LessThan(propertyPath="closingDate", groups={AccompanyingPeriod::STEP_CONFIRMED}) */ private ?DateTime $openingDate = null; diff --git a/src/Bundle/ChillPersonBundle/Menu/UserMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/UserMenuBuilder.php index 3e56b423c..0a9d2a31c 100644 --- a/src/Bundle/ChillPersonBundle/Menu/UserMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/UserMenuBuilder.php @@ -12,9 +12,7 @@ declare(strict_types=1); namespace Chill\PersonBundle\Menu; use Chill\MainBundle\Routing\LocalMenuBuilderInterface; -use Chill\TaskBundle\Templating\UI\CountNotificationTask; use Knp\Menu\MenuItem; -use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface; use Symfony\Contracts\Translation\TranslatorInterface; @@ -25,7 +23,6 @@ class UserMenuBuilder implements LocalMenuBuilderInterface */ public $authorizationChecker; - /** * @var TranslatorInterface */ diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php index 9554f2a3b..edb4b4f3d 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php @@ -26,6 +26,11 @@ final class AccompanyingPeriodRepository implements ObjectRepository $this->repository = $entityManager->getRepository(AccompanyingPeriod::class); } + public function countBy(array $criteria): int + { + return $this->repository->count($criteria); + } + public function createQueryBuilder(string $alias, ?string $indexBy = null): QueryBuilder { return $this->repository->createQueryBuilder($alias, $indexBy); @@ -49,11 +54,6 @@ final class AccompanyingPeriodRepository implements ObjectRepository return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } - public function countBy(array $criteria): int - { - return $this->repository->count($criteria); - } - public function findOneBy(array $criteria): ?AccompanyingPeriod { return $this->findOneBy($criteria); From 695d22adbad74e7af87f148207a02542a729343c Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 31 Jan 2022 13:39:52 +0100 Subject: [PATCH 5/6] bugfix creation of person or thirdparty through onTheFly --- .../Resources/public/vuejs/_components/AddPersons.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue index 59647e160..c880ad2fd 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue @@ -299,6 +299,7 @@ export default { } }) } + this.canCloseOnTheFlyModal = false; } }, } From 15393d9da903188a32beb08e084ab609e55882d1 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 31 Jan 2022 13:45:41 +0100 Subject: [PATCH 6/6] changelog updated with bugfix --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92e3085e8..fe26e1978 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to * [user]: page with accompanying periods to which is user is referent (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/408) * [person]: Comment on marital status is possible even if marital status is not defined (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/421) * [parcours]: In the list of person results the requestor is not displayed if defined as anonymous (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/424) +* [bugfix]: modal closes and newly created person/thirdparty is selected when multiple persons/thirdparties are created through the modal (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/429) ## Test releases