diff --git a/CHANGELOG.md b/CHANGELOG.md index 4155d66a1..492e21095 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,16 @@ and this project adheres to ## Unreleased +* Toggle emergency only by referrer + +## Test releases + +### test release 2022-02-14 + * AddPersons: remove ul-li html tags from AddPersons (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/419) +* [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 * fix normalisation of accompanying course requestor api (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/378) * [person] add a returnPath when clicking on some Person or ThirdParty badge (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/427) * [person] accompanying course work: fix on-the-fly update of thirdParty @@ -31,8 +40,7 @@ and this project adheres to * [address]: Correction residential address 'depuis le' (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/459) * [Documents]: List view adapted to display more information (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/414) * [Thirdparty_contact]: address blurred if confidential in view page (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/450) - -## Test releases +* [homepage_widget]: If no sender then display as 'notification automatique' (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/435) ### test release 2021-02-01 diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyNotifications.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyNotifications.vue index 135532f0b..897ea3a9a 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyNotifications.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyNotifications.vue @@ -17,7 +17,8 @@ {{ n.title }} - {{ n.sender.text }} + {{ n.sender.text }} + {{ $t('automatic_notification')}} diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/js/i18n.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/js/i18n.js index 29f9dac62..0845d0f02 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/js/i18n.js +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/js/i18n.js @@ -53,6 +53,7 @@ const appMessages = { }, emergency: "Urgent", confidential: "Confidentiel", + automatic_notification: "Notification automatique" } }; 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 #} render('@ChillPerson/AccompanyingPeriod/user_periods_list.html.twig', [ - 'accompanyingds' => $accompanyingPeriods, + 'accompanyingPeriods' => $accompanyingPeriods, 'pagination' => $pagination, ]); } /** - * @Route("/{_locale}/accompanying-periods/drafts", name="chill_person_accompanying_period_draft_user") + * @Route("/{_locale}/person/accompanying-periods/my/drafts", name="chill_person_accompanying_period_draft_user") */ public function listDraftsAction(Request $request) { diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php index 10b424cef..122b658bd 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php @@ -71,7 +71,7 @@ final class AccompanyingPeriodRepository implements ObjectRepository $qb = $this->buildQueryByRecentUserHistory($user, $since); return $qb->select('a') - ->distinct(true) + ->addOrderBy('userHistory.startDate', 'DESC') ->getQuery() ->setMaxResults($limit) ->setFirstResult($offset) @@ -95,6 +95,7 @@ final class AccompanyingPeriodRepository implements ObjectRepository $qb ->join('a.userHistories', 'userHistory') ->where($qb->expr()->eq('a.user', ':user')) + ->andWhere($qb->expr()->neq('a.step', "'" . AccompanyingPeriod::STEP_DRAFT . "'")) ->andWhere($qb->expr()->gte('userHistory.startDate', ':since')) ->andWhere($qb->expr()->isNull('userHistory.endDate')) ->setParameter('user', $user) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/user_periods_list.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/user_periods_list.html.twig index d30997bac..7395fceda 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/user_periods_list.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/user_periods_list.html.twig @@ -20,6 +20,8 @@
{% for period in accompanyingPeriods %} {% include '@ChillPerson/AccompanyingPeriod/_list_item.html.twig' with {'period': period, 'recordAction': _self.recordAction(period)} %} + {% else %} +

{{ 'Any accompanying period'|trans }}

{% endfor %}
diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php index 02cedaad8..d666c6928 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php @@ -161,11 +161,13 @@ 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, + 'required' => false, 'label' => $options[$key . 'Label'], + 'placeholder' => $this->translator->trans('Any person selected'), ]); } } diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php index 0898bc32a..c01476b2e 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php @@ -83,6 +83,12 @@ 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); } 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