From 1781bd31a054c6c4a7686cd76c97ffd0bf1d80f2 Mon Sep 17 00:00:00 2001 From: Tchama Date: Thu, 5 Dec 2019 15:36:06 +0100 Subject: [PATCH] patch bundle changes --- Controller/ThirdPartyController.php | 14 ++++++++++---- Resources/views/ThirdParty/index.html.twig | 13 +++++++++---- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Controller/ThirdPartyController.php b/Controller/ThirdPartyController.php index dd03bf5a0..7e98b93f5 100644 --- a/Controller/ThirdPartyController.php +++ b/Controller/ThirdPartyController.php @@ -70,12 +70,18 @@ class ThirdPartyController extends Controller $nbThirdParties = $repository->countByMemberOfCenters($centers); $pagination = $this->paginatorFactory->create($nbThirdParties); - $thirdParties = $repository->findByMemberOfCenters($centers, - $pagination->getCurrentPage()->getFirstItemNumber(), - $pagination->getItemsPerPage()); + $pagination->setItemsPerPage(20); + + $thirdParties = $repository->findByMemberOfCenters( + $centers, + $pagination->getCurrentPage()->getFirstItemNumber(), + $pagination->getItemsPerPage() + ); + dump($pagination); return $this->render('ChillThirdPartyBundle:ThirdParty:index.html.twig', array( - 'third_parties' => $thirdParties + 'third_parties' => $thirdParties, + 'pagination' => $pagination )); } diff --git a/Resources/views/ThirdParty/index.html.twig b/Resources/views/ThirdParty/index.html.twig index bd3d58f55..89b62f567 100644 --- a/Resources/views/ThirdParty/index.html.twig +++ b/Resources/views/ThirdParty/index.html.twig @@ -14,17 +14,17 @@ + - - + {% for tp in third_parties %} + - {% set types = [] %} {% for t in tp.type %} {% set types = types|merge( [ ('chill_3party.key_label.'~t)|trans ] ) %} @@ -48,8 +48,13 @@ {% endfor %}
{{ 'Name'|trans }}{{ 'Active'|trans }}{{ 'type'|trans }}{{ 'Category'|trans }}  
{{ (tp.active ? '' : '')|raw }} {{ tp.name }}{{ (tp.active ? '' : '')|raw }}
+ + {% if third_parties|length < pagination.getTotalItems %} + {{ chill_pagination(pagination) }} + {% endif %} + {% endif %} - + {% if is_granted('CHILL_3PARTY_3PARTY_CREATE') %}