Merge branch 'master' into dist/envole/6/master
This commit is contained in:
commit
0ed4fec378
|
@ -16,7 +16,6 @@ class AppKernel extends Kernel
|
||||||
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
|
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
|
||||||
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
|
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
|
||||||
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
|
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
|
||||||
new \Symfony\Bundle\MakerBundle\MakerBundle(),
|
|
||||||
new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(),
|
new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(),
|
||||||
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
|
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
|
||||||
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
|
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
|
||||||
|
@ -47,6 +46,7 @@ class AppKernel extends Kernel
|
||||||
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
|
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
|
||||||
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
|
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
|
||||||
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
|
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
|
||||||
|
$bundles[] = new Symfony\Bundle\MakerBundle\MakerBundle();
|
||||||
|
|
||||||
if ('dev' === $this->getEnvironment()) {
|
if ('dev' === $this->getEnvironment()) {
|
||||||
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
|
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
|
||||||
|
|
|
@ -34,6 +34,7 @@ class ItemRepository extends EntityRepository
|
||||||
$items=new ArrayCollection();
|
$items=new ArrayCollection();
|
||||||
|
|
||||||
// Récupération des items par rôles
|
// Récupération des items par rôles
|
||||||
|
$itemsroles=[];
|
||||||
foreach($roles as $role) {
|
foreach($roles as $role) {
|
||||||
$qb = $this->getEntityManager()->createQueryBuilder();
|
$qb = $this->getEntityManager()->createQueryBuilder();
|
||||||
$qb->select('item')
|
$qb->select('item')
|
||||||
|
@ -57,6 +58,7 @@ class ItemRepository extends EntityRepository
|
||||||
}
|
}
|
||||||
|
|
||||||
// Récupération des items par group
|
// Récupération des items par group
|
||||||
|
$itemsgroups=[];
|
||||||
foreach($groups as $group) {
|
foreach($groups as $group) {
|
||||||
$qb = $this->getEntityManager()->createQueryBuilder();
|
$qb = $this->getEntityManager()->createQueryBuilder();
|
||||||
$qb->select('item')
|
$qb->select('item')
|
||||||
|
@ -75,7 +77,6 @@ class ItemRepository extends EntityRepository
|
||||||
}
|
}
|
||||||
|
|
||||||
$itemsgroups=$qb->getQuery()->getResult();
|
$itemsgroups=$qb->getQuery()->getResult();
|
||||||
|
|
||||||
foreach($itemsgroups as $itemgroup) {
|
foreach($itemsgroups as $itemgroup) {
|
||||||
if(!$bookmarksitems->contains($itemgroup) && !$items->contains($itemgroup)) $items->add($itemgroup);
|
if(!$bookmarksitems->contains($itemgroup) && !$items->contains($itemgroup)) $items->add($itemgroup);
|
||||||
}
|
}
|
||||||
|
@ -83,6 +84,7 @@ class ItemRepository extends EntityRepository
|
||||||
|
|
||||||
|
|
||||||
// Récupération des items par niveau01
|
// Récupération des items par niveau01
|
||||||
|
$itemsniveau01s=[];
|
||||||
if($niveau01) {
|
if($niveau01) {
|
||||||
$qb = $this->getEntityManager()->createQueryBuilder();
|
$qb = $this->getEntityManager()->createQueryBuilder();
|
||||||
$qb->select('item')
|
$qb->select('item')
|
||||||
|
@ -107,6 +109,7 @@ class ItemRepository extends EntityRepository
|
||||||
}
|
}
|
||||||
|
|
||||||
// Récupération des items par ssoitem
|
// Récupération des items par ssoitem
|
||||||
|
$itemsssoitems=[];
|
||||||
foreach($ssoitems as $ssoitem) {
|
foreach($ssoitems as $ssoitem) {
|
||||||
$qb = $this->getEntityManager()->createQueryBuilder();
|
$qb = $this->getEntityManager()->createQueryBuilder();
|
||||||
$qb->select('item')
|
$qb->select('item')
|
||||||
|
@ -125,12 +128,22 @@ class ItemRepository extends EntityRepository
|
||||||
}
|
}
|
||||||
|
|
||||||
$itemsssoitems=$qb->getQuery()->getResult();
|
$itemsssoitems=$qb->getQuery()->getResult();
|
||||||
|
|
||||||
foreach($itemsssoitems as $itemssoitem) {
|
foreach($itemsssoitems as $itemssoitem) {
|
||||||
if(!$bookmarksitems->contains($itemssoitem) && !$items->contains($itemssoitem)) $items->add($itemssoitem);
|
if(!$bookmarksitems->contains($itemssoitem) && !$items->contains($itemssoitem)) $items->add($itemssoitem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Pour chaque bookmark lié à un item : on vérifie qu'il est tjr la permission de voir cet item sinon on l'enlève de ses fav
|
||||||
|
foreach($bookmarks as $key => $bookmark) {
|
||||||
|
$item=$bookmark->getItem();
|
||||||
|
if($item) {
|
||||||
|
if(!in_array($item,$itemsroles) && !in_array($item,$itemsgroups) && !in_array($item,$itemsniveau01s) && !in_array($item,$itemsssoitems) ) {
|
||||||
|
unset($bookmarks[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Trie des items
|
// Trie des items
|
||||||
$itemsordered = $items->getIterator();
|
$itemsordered = $items->getIterator();
|
||||||
$itemsordered->uasort(function ($first, $second) {
|
$itemsordered->uasort(function ($first, $second) {
|
||||||
|
|
Loading…
Reference in New Issue