From 4dd9bc11237e7af3543108c43d92fe62a532eb73 Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 11 Feb 2022 14:22:20 +0100 Subject: [PATCH 1/7] doc generation: do not set required fields for mainPerson, person1, person2 --- .../Service/DocGenerator/AccompanyingPeriodContext.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php index fc19b6590..ddbc66f27 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php @@ -165,6 +165,7 @@ class AccompanyingPeriodContext implements }, 'multiple' => false, 'expanded' => true, + 'required' => false, 'label' => $options[$key . 'Label'], ]); } From 692343aae427786be4095aa8c23156a1d4956ba7 Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 11 Feb 2022 14:24:12 +0100 Subject: [PATCH 2/7] doc generation: add age and obele in the mainPerson, person1 and person2 list + add obele in person renderString if addAge --- .../Service/DocGenerator/AccompanyingPeriodContext.php | 2 +- .../ChillPersonBundle/Templating/Entity/PersonRender.php | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php index ddbc66f27..96db9c2bd 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php @@ -161,7 +161,7 @@ class AccompanyingPeriodContext implements 'class' => Person::class, 'choices' => $persons, 'choice_label' => function (Person $p) { - return $this->personRender->renderString($p, []); + return $this->personRender->renderString($p, ['addAge' => true]); }, 'multiple' => false, 'expanded' => true, diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php index 0898bc32a..05b7e46c9 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php @@ -83,6 +83,13 @@ class PersonRender extends AbstractChillEntityRender . $this->addAltNames($person, false) . ' (' . $this->translator->trans('years_old', ['age' => $person->getAge()]) . ')'; } + if (null !== $person->getDeathDate() && $options['addAge']) { + return $person->getFirstName() . ' ' . $person->getLastName() + . ' (‡)' + . $this->addAltNames($person, false); + } + + return $person->getFirstName() . ' ' . $person->getLastName() . $this->addAltNames($person, false); } From c19099e76c14f36866680bed0ea14ff32ea9c5db Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 11 Feb 2022 14:28:37 +0100 Subject: [PATCH 3/7] upd CHANGELOG --- CHANGELOG.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92e765829..c66f238af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,10 @@ and this project adheres to ## Unreleased -* [person] accompanying course work: fix on-the-fly update of thirdParty +* [doc-generator] do not set required fields for mainPerson, person1, person2 (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement#456) +* [doc-generation] add age and obele in the mainPerson, person1 and person2 list + add obele in person renderString if addAge (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/370) + +* [person] accompanying course work: fix on-the-fly update of thirdParty * [on-the-fly] close modal only after validation * [person] correct thirdparty PATCH url + add email and altnames in AddPerson and serializer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/433) * change order for accompanying course work list @@ -34,7 +37,7 @@ and this project adheres to * [parcours]: validation + message for closing parcours adjusted. * [household]: household composition double edit button replaced by a delete action (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/426) [fast_actions] improve fast-actions buttons override mechanism, fix https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/413 -[homepage widget] add vue homepage_widget with asynchone loading, give a global view resume of the user concerned actions, notifications, etc. +[homepage widget] add vue homepage_widget with asynchone loading, give a global view resume of the user concerned actions, notifications, etc. * [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) @@ -42,7 +45,7 @@ and this project adheres to * [workflow][notification] improve how notifications and workflows are 'attached' to entities: contextual list, counter, buttons and vue modal * [AddAddress] disable multiselect search, and rely only on most pertinent Cities and Street computed backend * [fast_actions] improve fast-actions buttons override mechanism, fix https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/413 -* [homepage widget] add vue homepage_widget with asynchone loading, give a global view resume of the user concerned actions, notifications, etc. +* [homepage widget] add vue homepage_widget with asynchone loading, give a global view resume of the user concerned actions, notifications, etc. ### test release 2021-01-31 @@ -91,7 +94,7 @@ and this project adheres to * [popover] add popover html popup mechanism (used by workflow breadcrumb) * [templates] improve updatedBy macro in item metadatas * [parcours]: bug fix when comment is pinned all other comments remain in the collection (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/385) -* [workflow] +* [workflow] * add My workflow section with my opened subscriptions * apply workflow on documents, accompanyingCourseWork and Evaluations * [wopi-link] a new vue component allow to open wopi link in a fullscreen chill-themed modal From 1f5d529d333e452f32dfee927c8327b40f4b225d Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 11 Feb 2022 14:30:31 +0100 Subject: [PATCH 4/7] php code fix --- src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php index 05b7e46c9..c01476b2e 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php @@ -89,7 +89,6 @@ class PersonRender extends AbstractChillEntityRender . $this->addAltNames($person, false); } - return $person->getFirstName() . ' ' . $person->getLastName() . $this->addAltNames($person, false); } From eee38e95775d2009db2d9dc1ab5487d0bda07c02 Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 11 Feb 2022 15:18:54 +0100 Subject: [PATCH 5/7] remove isDead from insert vue on the fly as dead sign (obele) is included in personRender->renderString --- .../Resources/views/OnTheFly/_insert_vue_onthefly.html.twig | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/views/OnTheFly/_insert_vue_onthefly.html.twig b/src/Bundle/ChillMainBundle/Resources/views/OnTheFly/_insert_vue_onthefly.html.twig index 16e9cbf02..bbc5f20db 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/OnTheFly/_insert_vue_onthefly.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/OnTheFly/_insert_vue_onthefly.html.twig @@ -11,7 +11,6 @@ * buttonText string * displayBadge boolean (default: false) replace button by badge, need to define buttonText for content * parent object (optional) pass parent context of the targetEntity (used for course resource comment) - * isDead boolean (default: false) is the person dead #} Date: Mon, 14 Feb 2022 14:26:12 +0100 Subject: [PATCH 6/7] fix cs --- .../Security/Authorization/AccompanyingPeriodWorkVoter.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php index 750cdd2dd..7193c524e 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php @@ -62,7 +62,6 @@ class AccompanyingPeriodWorkVoter extends Voter case self::UPDATE: return $this->security->isGranted(AccompanyingPeriodVoter::EDIT, $subject->getAccompanyingPeriod()); - default: throw new UnexpectedValueException("attribute {$attribute} is not supported"); } From 6402962990ebc3323f3262f00d095ec8e3fafd5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 14 Feb 2022 14:36:37 +0100 Subject: [PATCH 7/7] customize the 'none' into something more user-frieldly --- .../Service/DocGenerator/AccompanyingPeriodContext.php | 1 + src/Bundle/ChillPersonBundle/translations/messages.fr.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php index 0578fb34f..d666c6928 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php @@ -167,6 +167,7 @@ class AccompanyingPeriodContext implements 'expanded' => true, 'required' => false, 'label' => $options[$key . 'Label'], + 'placeholder' => $this->translator->trans('Any person selected'), ]); } } diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 2c796c163..52b53553e 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -85,6 +85,7 @@ Course number: Parcours n° Civility: Civilité choose civility: -- All genders: tous les genres +Any person selected: Aucune personne sélectionnée # dédoublonnage Old person: Doublon