patch bundle changes

This commit is contained in:
Tchama 2019-12-05 15:36:06 +01:00
parent 3f3bbc92d9
commit 1781bd31a0
2 changed files with 19 additions and 8 deletions

View File

@ -70,12 +70,18 @@ class ThirdPartyController extends Controller
$nbThirdParties = $repository->countByMemberOfCenters($centers);
$pagination = $this->paginatorFactory->create($nbThirdParties);
$thirdParties = $repository->findByMemberOfCenters($centers,
$pagination->setItemsPerPage(20);
$thirdParties = $repository->findByMemberOfCenters(
$centers,
$pagination->getCurrentPage()->getFirstItemNumber(),
$pagination->getItemsPerPage());
$pagination->getItemsPerPage()
);
dump($pagination);
return $this->render('ChillThirdPartyBundle:ThirdParty:index.html.twig', array(
'third_parties' => $thirdParties
'third_parties' => $thirdParties,
'pagination' => $pagination
));
}

View File

@ -14,17 +14,17 @@
<table>
<thead>
<tr>
<th style="width: 35px;"></th>
<th>{{ 'Name'|trans }}</th>
<th>{{ 'Active'|trans }}</th>
<th>{{ 'type'|trans }}</th>
<th>{{ 'Category'|trans }}</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for tp in third_parties %}
<tr>
<th>{{ (tp.active ? '<i class="fa fa-check chill-green">' : '<i class="fa fa-times chill-red">')|raw }}</th>
<td>{{ tp.name }}</td>
<td>{{ (tp.active ? '<i class="fa fa-check-square-o">' : '<i class="fa fa-square-o">')|raw }}</td>
{% set types = [] %}
{% for t in tp.type %}
{% set types = types|merge( [ ('chill_3party.key_label.'~t)|trans ] ) %}
@ -48,6 +48,11 @@
{% endfor %}
</tbody>
</table>
{% if third_parties|length < pagination.getTotalItems %}
{{ chill_pagination(pagination) }}
{% endif %}
{% endif %}
{% if is_granted('CHILL_3PARTY_3PARTY_CREATE') %}