improve layout

This commit is contained in:
2017-08-19 21:46:09 +02:00
parent 1afcf75112
commit 47e194b1ed
10 changed files with 69 additions and 30 deletions

View File

@@ -29,6 +29,7 @@ use Chill\PersonBundle\Form\CreationPersonType;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Role\Role;
use Chill\PersonBundle\Security\Authorization\PersonVoter;
class PersonController extends Controller
{
@@ -281,9 +282,17 @@ class PersonController extends Controller
if ($this->container
->getParameter('cl_chill_person.search.use_double_metaphone')) {
$dql .= ' OR DOUBLEMETAPHONE(p.lastName) LIKE DOUBLEMETAPHONE(:lastName)';
$dql .= ' OR DOUBLEMETAPHONE(p.lastName) LIKE DOUBLEMETAPHONE(:lastName) ';
}
// add authorized centers
$centers = $this->get('chill.main.security.authorization.helper')
->getReachableCenters($this->getUser(), new Role(PersonVoter::SEE));
$dql.=' and p.center IN (:centers) ';
$query->setParameter('centers', $centers);
// run query
$query->setDql($dql);
$alternatePersons = $query->getResult();