diff --git a/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php b/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php index e326b86d6..4bbf72b7d 100644 --- a/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php +++ b/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php @@ -57,7 +57,7 @@ class UserAccompanyingPeriodController extends AbstractController $total = $this->accompanyingPeriodRepository->countBy(['user' => $this->getUser(), 'step' => 'DRAFT']); $pagination = $this->paginatorFactory->create($total); $accompanyingPeriods = $this->accompanyingPeriodRepository->findBy( - ['user' => $this->getUser(), 'step' => 'DRAFT'], + ['createdBy' => $this->getUser(), 'step' => 'DRAFT'], ['id' => 'DESC'], $pagination->getItemsPerPage(), $pagination->getCurrentPageFirstItemNumber() diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/_list_item.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/_list_item.html.twig index c2f7f26a6..11517def2 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/_list_item.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/_list_item.html.twig @@ -55,65 +55,67 @@ -
-
- {% if period.requestorPerson is not null or period.requestorThirdParty is not null %} -
-

{{ 'Requestor'|trans({'gender': null }) }}

-
- {% if period.requestorPerson is not null %} - - {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { - action: 'show', displayBadge: true, - targetEntity: { name: 'person', id: period.requestorPerson.id }, - buttonText: period.requestorPerson|chill_entity_render_string, - isDead: period.requestorPerson.deathdate is not null - } %} - - {% endif %} - {% if period.requestorThirdParty is not null %} - - {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { - action: 'show', displayBadge: true, - targetEntity: { name: 'thirdparty', id: period.requestorThirdParty.id }, - buttonText: period.requestorThirdParty|chill_entity_render_string - } %} - - {% endif %} + {% if period.requestor is not null or period.participations.count > 0 or period.socialIssues.count > 0%} +
+
+ {% if period.requestorPerson is not null or period.requestorThirdParty is not null %} +
+

{{ 'Requestor'|trans({'gender': null }) }}

+
+ {% if period.requestorPerson is not null %} + + {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { + action: 'show', displayBadge: true, + targetEntity: { name: 'person', id: period.requestorPerson.id }, + buttonText: period.requestorPerson|chill_entity_render_string, + isDead: period.requestorPerson.deathdate is not null + } %} + + {% endif %} + {% if period.requestorThirdParty is not null %} + + {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { + action: 'show', displayBadge: true, + targetEntity: { name: 'thirdparty', id: period.requestorThirdParty.id }, + buttonText: period.requestorThirdParty|chill_entity_render_string + } %} + + {% endif %} +
-
- {% endif %} - {% if period.participations.count > 0 %} -
-

{{ 'Participants'|trans }}

-
- {% for p in period.getCurrentParticipations %} - - {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { - action: 'show', displayBadge: true, - targetEntity: { name: 'person', id: p.person.id }, - buttonText: p.person|chill_entity_render_string, - isDead: p.person.deathdate is not null - } %} - - {% endfor %} + {% endif %} + {% if period.participations.count > 0 %} +
+

{{ 'Participants'|trans }}

+
+ {% for p in period.getCurrentParticipations %} + + {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { + action: 'show', displayBadge: true, + targetEntity: { name: 'person', id: p.person.id }, + buttonText: p.person|chill_entity_render_string, + isDead: p.person.deathdate is not null + } %} + + {% endfor %} +
-
- {% endif %} - {% if period.socialIssues.count > 0 %} -
-

{{ 'Social issues'|trans }}

-
- {% for si in period.socialIssues %} -

- {{ si|chill_entity_render_box }} -

- {% endfor %} + {% endif %} + {% if period.socialIssues.count > 0 %} +
+

{{ 'Social issues'|trans }}

+
+ {% for si in period.socialIssues %} +

+ {{ si|chill_entity_render_box }} +

+ {% endfor %} +
-
- {% endif %} + {% endif %} +
-
+ {% endif %}
{% set notif_counter = chill_count_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', period.id) %} 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 5faaf378f..33317d51d 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 @@ -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 %}
@@ -27,4 +29,4 @@
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 3dfb4ec46..2c796c163 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -179,6 +179,7 @@ An accompanying period is open: Une période d'accompagnement est ouverte Accompanying period list: Périodes d'accompagnement Accompanying period list for person: Périodes d'accompagnement de la personne Accompanying period: Parcours d'accompagnement +Any accompanying period: Aucun parcours d'accompagnement period: Parcours New accompanying course: Nouveau parcours d'accompagnement Choose a motive: Motif de fermeture @@ -566,4 +567,4 @@ Linked evaluations: Évaluations associées # Accompanying period per user My accompanying periods: Mes parcours -My accompanying periods in draft: Mes parcours brouillons \ No newline at end of file +My accompanying periods in draft: Mes parcours brouillons