mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix page "my accompanying period" and do not show drafts periods in
homepage (+ ordering)
This commit is contained in:
parent
f2221565c5
commit
aebb21935b
@ -30,7 +30,7 @@ class UserAccompanyingPeriodController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/{_locale}/accompanying-periods", name="chill_person_accompanying_period_user")
|
||||
* @Route("/{_locale}/person/accompanying-periods/my", name="chill_person_accompanying_period_user")
|
||||
*/
|
||||
public function listAction(Request $request)
|
||||
{
|
||||
@ -44,13 +44,13 @@ class UserAccompanyingPeriodController extends AbstractController
|
||||
);
|
||||
|
||||
return $this->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)
|
||||
{
|
||||
|
@ -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)
|
||||
|
@ -20,6 +20,8 @@
|
||||
<div class="flex-table accompanyingcourse-list">
|
||||
{% for period in accompanyingPeriods %}
|
||||
{% include '@ChillPerson/AccompanyingPeriod/_list_item.html.twig' with {'period': period, 'recordAction': _self.recordAction(period)} %}
|
||||
{% else %}
|
||||
<p class="chill-no-data-statement">{{ 'Any accompanying period'|trans }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user