filtre de recherche sur le nom du propriétaire (ref #147)

This commit is contained in:
afornerot 2020-06-08 09:01:52 +02:00
parent 1fc6d05bf5
commit 228993dbd6
3 changed files with 6 additions and 2 deletions

View File

@ -82,7 +82,9 @@ class GroupController extends Controller
$qb=$em->createQueryBuilder(); $qb=$em->createQueryBuilder();
$qb->select('COUNT(table)') $qb->select('COUNT(table)')
->from($this->labelentity,'table') ->from($this->labelentity,'table')
->leftJoin('CadolesCoreBundle:User', 'u', 'WITH', 'table.owner = u.id')
->where('table.label LIKE :value') ->where('table.label LIKE :value')
->orWhere('u.username LIKE :value')
->setParameter("value", "%".$search["value"]."%"); ->setParameter("value", "%".$search["value"]."%");
if($access=="user") { if($access=="user") {
$qb->from("CadolesCoreBundle:UserGroup","ug") $qb->from("CadolesCoreBundle:UserGroup","ug")
@ -107,19 +109,21 @@ class GroupController extends Controller
// Parcours des Enregistrement // Parcours des Enregistrement
$qb = $em->createQueryBuilder(); $qb = $em->createQueryBuilder();
$qb->select('table')->from($this->labelentity,'table'); $qb ->select('table')
->from($this->labelentity,'table')
->leftJoin('CadolesCoreBundle:User', 'u', 'WITH', 'table.owner = u.id');
if($access=="user") { if($access=="user") {
$qb->from("CadolesCoreBundle:UserGroup","ug") $qb->from("CadolesCoreBundle:UserGroup","ug")
->andWhere(("table.fgcanshare=:flag")) ->andWhere(("table.fgcanshare=:flag"))
->andWhere("table.id=ug.group") ->andWhere("table.id=ug.group")
->andWhere(":user=ug.user") ->andWhere(":user=ug.user")
->leftJoin('CadolesCoreBundle:User', 'u', 'WITH', 'table.owner = u.id')
->setParameter("flag", true) ->setParameter("flag", true)
->setParameter("user", $this->getUser()); ->setParameter("user", $this->getUser());
} }
if($search["value"]!="") { if($search["value"]!="") {
$qb ->andwhere('table.label LIKE :value') $qb ->andwhere('table.label LIKE :value')
->orWhere('u.username LIKE :value')
->setParameter("value", "%".$search["value"]."%"); ->setParameter("value", "%".$search["value"]."%");
} }
switch($order[0]["column"]) { switch($order[0]["column"]) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB