diff --git a/Resources/views/Person/list.html.twig b/Resources/views/Person/list.html.twig
index 04b06b9d9..dc90de4bd 100644
--- a/Resources/views/Person/list.html.twig
+++ b/Resources/views/Person/list.html.twig
@@ -74,3 +74,8 @@
{% endif %}
+
+{% if preview == false %}
+{{ chill_pagination(paginator) }}
+{% endif %}
+
diff --git a/Search/PersonSearch.php b/Search/PersonSearch.php
index 922d35d3a..e2678cb6c 100644
--- a/Search/PersonSearch.php
+++ b/Search/PersonSearch.php
@@ -36,7 +36,7 @@ class PersonSearch extends AbstractSearch implements ContainerAwareInterface
use ContainerAwareTrait;
/**
- *
+ *
* @var EntityManagerInterface
*/
private $em;
@@ -49,7 +49,7 @@ class PersonSearch extends AbstractSearch implements ContainerAwareInterface
/**
*
- * @var AuthorizationHelper
+ * @var AuthorizationHelper
*/
private $helper;
@@ -63,8 +63,8 @@ class PersonSearch extends AbstractSearch implements ContainerAwareInterface
public function __construct(
- EntityManagerInterface $em,
- TokenStorage $tokenStorage,
+ EntityManagerInterface $em,
+ TokenStorage $tokenStorage,
AuthorizationHelper $helper,
PaginatorFactory $paginatorFactory)
{
@@ -112,20 +112,21 @@ class PersonSearch extends AbstractSearch implements ContainerAwareInterface
$total = $this->count($terms);
$paginator = $this->paginatorFactory->create($total);
- return $this->container->get('templating')->render('ChillPersonBundle:Person:list.html.twig',
- array(
+ return $this->container->get('templating')->render('ChillPersonBundle:Person:list.html.twig',
+ array(
'persons' => $this->search($terms, $start, $limit, $options),
'pattern' => $this->recomposePattern($terms, array('nationality',
'firstname', 'lastname', 'birthdate', 'gender'), $terms['_domain']),
'total' => $total,
'start' => $start,
'search_name' => self::NAME,
- 'preview' => $options[SearchInterface::SEARCH_PREVIEW]
+ 'preview' => $options[SearchInterface::SEARCH_PREVIEW_OPTION],
+ 'paginator' => $paginator
));
}
/**
- *
+ *
* @param string $pattern
* @param int $start
* @param int $limit
@@ -161,11 +162,11 @@ class PersonSearch extends AbstractSearch implements ContainerAwareInterface
private $_cacheQuery = array();
/**
- *
+ *
* @param array $terms
* @return \Doctrine\ORM\QueryBuilder
*/
- protected function createQuery(array $terms)
+ protected function createQuery(array $terms)
{
//get from cache
$cacheKey = md5(serialize($terms));
@@ -237,7 +238,7 @@ class PersonSearch extends AbstractSearch implements ContainerAwareInterface
}
//restraint center for security
- $reachableCenters = $this->helper->getReachableCenters($this->user,
+ $reachableCenters = $this->helper->getReachableCenters($this->user,
new Role('CHILL_PERSON_SEE'));
$qb->andWhere($qb->expr()
->in('p.center', ':centers'))