From a59e84b029442abac632559f13272a5fb96f5892 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Thu, 20 Apr 2023 14:54:36 +0200 Subject: [PATCH] Display too draft periods without creator in periods of a person --- .../Repository/AccompanyingPeriodACLAwareRepository.php | 3 ++- .../views/AccompanyingPeriod/user_draft_periods_list.html.twig | 1 + src/Bundle/ChillPersonBundle/translations/messages.fr.yml | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php index e28832bf9..9327172ac 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php @@ -174,7 +174,8 @@ final class AccompanyingPeriodACLAwareRepository implements AccompanyingPeriodAC ->andWhere( $qb->expr()->orX( $qb->expr()->neq('ap.step', ':draft'), - $qb->expr()->eq('ap.createdBy', ':creator') + $qb->expr()->orX($qb->expr()->eq('ap.createdBy', ':creator'), + $qb->expr()->isNull('ap.createdBy')) ) ) ->setParameter('draft', AccompanyingPeriod::STEP_DRAFT) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/user_draft_periods_list.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/user_draft_periods_list.html.twig index d7bd8eea6..ef38ee7b9 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/user_draft_periods_list.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/user_draft_periods_list.html.twig @@ -22,6 +22,7 @@

{{ 'My accompanying periods in draft'|trans }}

+

{{ 'Display draft periods created by me'|trans }}

{% for period in accompanyingPeriods %} diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 18e3ab13f..01634bb21 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -966,6 +966,7 @@ Linked evaluations: Évaluations associées # Accompanying period per user My accompanying periods: Mes parcours My accompanying periods in draft: Mes parcours brouillons +Display draft periods created by me: Affiche les parcours brouillon que j'ai créé (pas ceux dont je suis référent) Number of periods: Nombre de parcours workflow: