From a59e84b029442abac632559f13272a5fb96f5892 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Thu, 20 Apr 2023 14:54:36 +0200 Subject: [PATCH 1/4] 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: From dde35be9c3cd29eca96ddc917f20f3300cfe7c66 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Thu, 20 Apr 2023 18:05:39 +0200 Subject: [PATCH 2/4] hide pagination if no periods --- .../AccompanyingPeriod/user_draft_periods_list.html.twig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 ef38ee7b9..60f6ae9e0 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 @@ -32,7 +32,9 @@ {% endfor %}
- {{ chill_pagination(pagination) }} + {% if accompanyingPeriods|length > 0 %} + {{ chill_pagination(pagination) }} + {% endif %}
From 631d65a57ff28d5fedabd5d5819a58e3c15f31c2 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Thu, 20 Apr 2023 18:09:25 +0200 Subject: [PATCH 3/4] improve indentation --- .../Repository/AccompanyingPeriodACLAwareRepository.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php index 9327172ac..0aaabd05f 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php @@ -174,8 +174,10 @@ final class AccompanyingPeriodACLAwareRepository implements AccompanyingPeriodAC ->andWhere( $qb->expr()->orX( $qb->expr()->neq('ap.step', ':draft'), - $qb->expr()->orX($qb->expr()->eq('ap.createdBy', ':creator'), - $qb->expr()->isNull('ap.createdBy')) + $qb->expr()->orX( + $qb->expr()->eq('ap.createdBy', ':creator'), + $qb->expr()->isNull('ap.createdBy') + ) ) ) ->setParameter('draft', AccompanyingPeriod::STEP_DRAFT) From 1e2ca764c1cffc18f132c02e7ae37723c89748e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 25 Apr 2023 14:20:24 +0200 Subject: [PATCH 4/4] UX: more precision for the explanation of course draft pages --- src/Bundle/ChillPersonBundle/translations/messages.fr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 01634bb21..d33957ea7 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -966,7 +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) +Display draft periods created by me: Affiche les parcours en attente de confirmation. Ils ne sont visibles que par moi-même. Ces parcours restent disponibles 15 jours après leur création, avant d'être supprimés automatiquement. Number of periods: Nombre de parcours workflow: