diff --git a/CHANGELOG.md b/CHANGELOG.md index 99488850e..b0377b0cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ and this project adheres to * [workflow]: added pagination to workflow list page * [homepage_widget]: null error on tasks widget fixed +* [person-thirdparty]: fix quick-add of names that consist of multiple parts (eg. De Vlieger) within onthefly modal person/thirdparty +* [search]: Order of birthdate fields changed in advanced search to avoid confusion. +* [workflow]: Constraint added to workflow (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/675) +* [action]: Agents traitants should be prefilled with referrer of the parcours or left empty if there is no referrer (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/696) ## Test releases diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/list.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/list.html.twig index f8b68eabd..79c946f17 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/list.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/list.html.twig @@ -2,12 +2,30 @@ {% if is_granted('CHILL_ACTIVITY_SEE_DETAILS', activity) %} {% if no_action is not defined or no_action == false %}
  • - - - {{ 'notification.Notify'|trans }} + {% set showGroup = activity.accompanyingPeriod is not null and activity.accompanyingPeriod.hasUser and activity.accompanyingPeriod.user is not same as(app.user) %} +
    + {% if showGroup %} + + + {% else %} + + {{ 'notification.Notify'|trans }} + + {% endif %} +
  • {% endif %} {% if context == 'person' and activity.accompanyingPeriod is not empty %} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig index bf4c5c7b6..49e71bfad 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig @@ -217,9 +217,30 @@
  • - - {{ 'notification.Notify'|trans }} - + {% set showGroup = entity.accompanyingPeriod is not null and entity.accompanyingPeriod.hasUser and entity.accompanyingPeriod.user is not same as(app.user) %} +
    + {% if showGroup %} + + + {% else %} + + {{ 'notification.Notify'|trans }} + + {% endif %} +
  • {% if is_granted('CHILL_ACTIVITY_UPDATE', entity) %}
  • diff --git a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php index 9a2fd1b6c..3eba23b37 100644 --- a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php +++ b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php @@ -109,6 +109,7 @@ class WorkflowStepType extends AbstractType 'multiple' => false, 'expanded' => true, 'choices' => $choices, + 'constraints' => [new NotNull()], 'choice_label' => function (Transition $transition) use ($workflow) { $meta = $workflow->getMetadataStore()->getTransitionMetadata($transition); @@ -208,24 +209,28 @@ class WorkflowStepType extends AbstractType $transition = $form['transition']->getData(); $toFinal = true; - foreach ($transition->getTos() as $to) { - $meta = $workflow->getMetadataStore()->getPlaceMetadata($to); - - if ( - !array_key_exists('isFinal', $meta) || false === $meta['isFinal'] - ) { - $toFinal = false; - } - } - - $destUsers = $form['future_dest_users']->getData(); - $destEmails = $form['future_dest_emails']->getData(); - - if (!$toFinal && [] === $destUsers && [] === $destEmails) { + if (null === $transition) { $context - ->buildViolation('workflow.You must add at least one dest user or email') - ->atPath('future_dest_users') - ->addViolation(); + ->buildViolation('workflow.You must select a next step, pick another decision if no next steps are available'); + } else { + foreach ($transition->getTos() as $to) { + $meta = $workflow->getMetadataStore()->getPlaceMetadata($to); + + if ( + !array_key_exists('isFinal', $meta) || false === $meta['isFinal'] + ) { + $toFinal = false; + } + } + $destUsers = $form['future_dest_users']->getData(); + $destEmails = $form['future_dest_emails']->getData(); + + if (!$toFinal && [] === $destUsers && [] === $destEmails) { + $context + ->buildViolation('workflow.You must add at least one dest user or email') + ->atPath('future_dest_users') + ->addViolation(); + } } } ), diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue index 4be073991..68e673ccc 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue @@ -15,26 +15,60 @@ {{ $t('wait_redirection') }} -
    -

    - {{ $t('not_yet_address') }} -

    +
    +
    + +

    + {{ $t('not_yet_address') }} +

    + + + + +
    +
    + +
    + + +
    - - - +
    + + + +
    @@ -58,6 +92,9 @@ export default { 'useDatePane' ], emits: ['openEditPane'], + mounted() { + console.log('context', this.context) + }, computed: { address() { return this.entity.address; @@ -91,13 +128,29 @@ export default { forceRedirect() { return (!(this.context.backUrl === null || typeof this.context.backUrl === 'undefined')); }, - showMessageWhenNoAddress() { - let showMessageWhenNoAddress = this.options.showMessageWhenNoAddress === undefined ? this.defaultz.showMessageWhenNoAddress : this.options.showMessageWhenNoAddress; - if (showMessageWhenNoAddress === true || showMessageWhenNoAddress === false) { - return !this.context.edit && !this.address.id && showMessageWhenNoAddress; - } - return !this.context.edit && !this.address.id && this.options.stickyActions; - } + // showMessageWhenNoAddress() { + // let showMessageWhenNoAddress = this.options.showMessageWhenNoAddress === undefined ? this.defaultz.showMessageWhenNoAddress : this.options.showMessageWhenNoAddress; + // if (showMessageWhenNoAddress === true || showMessageWhenNoAddress === false) { + // return !this.context.edit && !this.address.id && showMessageWhenNoAddress; + // } + // return !this.context.edit && !this.address.id && this.options.stickyActions; + // } } }; + + diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index c5ab02d6b..376806292 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -463,6 +463,7 @@ workflow: Previous transitionned: Anciens workflows Previous workflow transitionned help: Workflows où vous avez exécuté une action. For: Pour + You must select a next step, pick another decision if no next steps are available: Il faut une prochaine étape. Choissisez une autre décision si nécessaire. Subscribe final: Recevoir une notification à l'étape finale diff --git a/src/Bundle/ChillPersonBundle/EventListener/AccompanyingPeriodWorkEventListener.php b/src/Bundle/ChillPersonBundle/EventListener/AccompanyingPeriodWorkEventListener.php index 83f9ca460..ba7a2bbc8 100644 --- a/src/Bundle/ChillPersonBundle/EventListener/AccompanyingPeriodWorkEventListener.php +++ b/src/Bundle/ChillPersonBundle/EventListener/AccompanyingPeriodWorkEventListener.php @@ -26,8 +26,9 @@ class AccompanyingPeriodWorkEventListener public function prePersistAccompanyingPeriodWork(AccompanyingPeriodWork $work): void { - if ($this->security->getUser() instanceof User) { - $work->addReferrer($this->security->getUser()); + $referrer = $work->getAccompanyingPeriod()->getUser(); + if (null !== $referrer) { + $work->addReferrer($referrer); } } } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue index 799bc3caf..4f8909233 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue @@ -333,10 +333,10 @@ export default { addQueryItem(field, queryItem) { switch (field) { case 'lastName': - this.person.lastName ? this.person.lastName += ` ${queryItem}` : this.person.lastName = queryItem; + this.person.lastName = this.person.lastName ? this.person.lastName += ` ${queryItem}` : queryItem; break; case 'firstName': - this.person.firstName ? this.person.firstName += ` ${queryItem}` : this.person.firstName = queryItem; + this.person.firstName = this.person.firstName ? this.person.firstName += ` ${queryItem}` : queryItem; break; } }, diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_js/i18n.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_js/i18n.js index df8d05a9c..d7ac10676 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_js/i18n.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_js/i18n.js @@ -45,7 +45,7 @@ const personMessages = { }, address: { create_address: "Ajouter une adresse", - show_address_form: "Créer un ménage et ajouter une adresse", + show_address_form: "Ajouter une adresse pour un usager non suivi et seul dans un ménage", warning: "Un nouveau ménage va être créé. L'usager sera membre de ce ménage." } }, diff --git a/src/Bundle/ChillPersonBundle/Search/PersonSearch.php b/src/Bundle/ChillPersonBundle/Search/PersonSearch.php index 7691ff923..75724bde6 100644 --- a/src/Bundle/ChillPersonBundle/Search/PersonSearch.php +++ b/src/Bundle/ChillPersonBundle/Search/PersonSearch.php @@ -86,6 +86,10 @@ class PersonSearch extends AbstractSearch implements HasAdvancedSearchFormInterf 'label' => 'Birthdate', 'required' => false, ]) + ->add('birthdate-after', ChillDateType::class, [ + 'label' => 'Birthdate after', + 'required' => false, + ]) ->add('birthdate-before', ChillDateType::class, [ 'label' => 'Birthdate before', 'required' => false, diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index f62e996ae..a93c51296 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -86,7 +86,7 @@ Civility: Civilité choose civility: -- All genders: tous les genres Any person selected: Aucune personne sélectionnée -Create a household and add an address: Créer un ménage et ajouter une adresse +Create a household and add an address: Ajouter une adresse pour un usager non suivi et seul dans un ménage A new household will be created. The person will be member of this household.: Un nouveau ménage va être créé. L'usager sera membre de ce ménage. # dédoublonnage