Commit e933d503 by Julien Jorry

Revert operation admin and transfert admin for gestionnaire/contact : revert…

Revert operation admin and transfert admin for gestionnaire/contact : revert 9b772f29
parent d3e25ca3
...@@ -52,30 +52,30 @@ class OperationAdherentAdmin extends OperationAdmin ...@@ -52,30 +52,30 @@ class OperationAdherentAdmin extends OperationAdmin
$em = $this->getConfigurationPool()->getContainer()->get('doctrine')->getManager(); $em = $this->getConfigurationPool()->getContainer()->get('doctrine')->getManager();
$operationAdherenttable = $em->getMetadataFactory()->getMetadataFor(OperationAdherent::class)->getTableName(); $operationAdherenttable = $em->getMetadataFactory()->getMetadataFor(OperationAdherent::class)->getTableName();
// if ($user && ($this->security->isGranted('ROLE_GESTION_GROUPE') || $this->security->isGranted('ROLE_CONTACT') || $this->security->isGranted('ROLE_TRESORIER'))) { if ($user && ($this->security->isGranted('ROLE_GESTION_GROUPE') || $this->security->isGranted('ROLE_CONTACT') || $this->security->isGranted('ROLE_TRESORIER'))) {
// if ($this->hasRequest()) { if ($this->hasRequest()) {
// if (empty($this->getRequest()->getSession()->get('_groupegere'))) { if (empty($this->getRequest()->getSession()->get('_groupegere'))) {
// if (!$this->security->isGranted('ROLE_TRESORIER')) { if (!$this->security->isGranted('ROLE_TRESORIER')) {
// $query->andWhere('false = true'); $query->andWhere('false = true');
// } }
// } else { } else {
// $groupe = $this->getRequest()->getSession()->get('_groupegere'); $groupe = $this->getRequest()->getSession()->get('_groupegere');
// $connection = $em->getConnection(); $connection = $em->getConnection();
// $adherentTable = $em->getMetadataFactory()->getMetadataFor(Adherent::class)->getTableName(); $adherentTable = $em->getMetadataFactory()->getMetadataFor(Adherent::class)->getTableName();
// $accountTable = $em->getMetadataFactory()->getMetadataFor(AccountAdherent::class)->getTableName(); $accountTable = $em->getMetadataFactory()->getMetadataFor(AccountAdherent::class)->getTableName();
// $statement = $connection->prepare('SELECT f.id FROM ' . $operationAdherenttable . ' f WHERE f.account_id IN $statement = $connection->prepare('SELECT f.id FROM ' . $operationAdherenttable . ' f WHERE f.account_id IN
// (SELECT a.id FROM ' . $accountTable . ' a WHERE a.adherent_id IN (SELECT a.id FROM ' . $accountTable . ' a WHERE a.adherent_id IN
// (SELECT p.id FROM ' . $adherentTable . ' p WHERE p.groupe_id = "' . $groupe->getId() . '") (SELECT p.id FROM ' . $adherentTable . ' p WHERE p.groupe_id = "' . $groupe->getId() . '")
// )'); )');
// $statement->execute(); $statement->execute();
// $ids = $statement->fetchAll(); $ids = $statement->fetchAll();
// $query $query
// ->andWhere($query->expr()->in($query->getRootAliases()[0] . '.id', ':ids')) ->andWhere($query->expr()->in($query->getRootAliases()[0] . '.id', ':ids'))
// ->setParameter('ids', $ids) ->setParameter('ids', $ids)
// ; ;
// } }
// } }
// } }
return $query; return $query;
} }
......
...@@ -52,30 +52,30 @@ class OperationComptoirAdmin extends OperationAdmin ...@@ -52,30 +52,30 @@ class OperationComptoirAdmin extends OperationAdmin
$em = $this->getConfigurationPool()->getContainer()->get('doctrine')->getManager(); $em = $this->getConfigurationPool()->getContainer()->get('doctrine')->getManager();
$operationComptoirtable = $em->getMetadataFactory()->getMetadataFor(OperationComptoir::class)->getTableName(); $operationComptoirtable = $em->getMetadataFactory()->getMetadataFor(OperationComptoir::class)->getTableName();
// if ($user && ($this->security->isGranted('ROLE_GESTION_GROUPE') || $this->security->isGranted('ROLE_CONTACT') || $this->security->isGranted('ROLE_TRESORIER'))) { if ($user && ($this->security->isGranted('ROLE_GESTION_GROUPE') || $this->security->isGranted('ROLE_CONTACT') || $this->security->isGranted('ROLE_TRESORIER'))) {
// if ($this->hasRequest()) { if ($this->hasRequest()) {
// if (empty($this->getRequest()->getSession()->get('_groupegere'))) { if (empty($this->getRequest()->getSession()->get('_groupegere'))) {
// if (!$this->security->isGranted('ROLE_TRESORIER')) { if (!$this->security->isGranted('ROLE_TRESORIER')) {
// $query->andWhere('false = true'); $query->andWhere('false = true');
// } }
// } else { } else {
// $groupe = $this->getRequest()->getSession()->get('_groupegere'); $groupe = $this->getRequest()->getSession()->get('_groupegere');
// $connection = $em->getConnection(); $connection = $em->getConnection();
// $comptoirTable = $em->getMetadataFactory()->getMetadataFor(Comptoir::class)->getTableName(); $comptoirTable = $em->getMetadataFactory()->getMetadataFor(Comptoir::class)->getTableName();
// $accountTable = $em->getMetadataFactory()->getMetadataFor(AccountComptoir::class)->getTableName(); $accountTable = $em->getMetadataFactory()->getMetadataFor(AccountComptoir::class)->getTableName();
// $statement = $connection->prepare('SELECT f.id FROM ' . $operationComptoirtable . ' f WHERE f.account_id IN $statement = $connection->prepare('SELECT f.id FROM ' . $operationComptoirtable . ' f WHERE f.account_id IN
// (SELECT a.id FROM ' . $accountTable . ' a WHERE a.comptoir_id IN (SELECT a.id FROM ' . $accountTable . ' a WHERE a.comptoir_id IN
// (SELECT p.id FROM ' . $comptoirTable . ' p WHERE p.groupe_id = "' . $groupe->getId() . '") (SELECT p.id FROM ' . $comptoirTable . ' p WHERE p.groupe_id = "' . $groupe->getId() . '")
// )'); )');
// $statement->execute(); $statement->execute();
// $ids = $statement->fetchAll(); $ids = $statement->fetchAll();
// $query $query
// ->andWhere($query->expr()->in($query->getRootAliases()[0] . '.id', ':ids')) ->andWhere($query->expr()->in($query->getRootAliases()[0] . '.id', ':ids'))
// ->setParameter('ids', $ids) ->setParameter('ids', $ids)
// ; ;
// } }
// } }
// } }
return $query; return $query;
} }
......
...@@ -52,30 +52,30 @@ class OperationPrestataireAdmin extends OperationAdmin ...@@ -52,30 +52,30 @@ class OperationPrestataireAdmin extends OperationAdmin
$em = $this->getConfigurationPool()->getContainer()->get('doctrine')->getManager(); $em = $this->getConfigurationPool()->getContainer()->get('doctrine')->getManager();
$operationPrestatable = $em->getMetadataFactory()->getMetadataFor(OperationPrestataire::class)->getTableName(); $operationPrestatable = $em->getMetadataFactory()->getMetadataFor(OperationPrestataire::class)->getTableName();
// if ($user && ($this->security->isGranted('ROLE_GESTION_GROUPE') || $this->security->isGranted('ROLE_CONTACT') || $this->security->isGranted('ROLE_TRESORIER'))) { if ($user && ($this->security->isGranted('ROLE_GESTION_GROUPE') || $this->security->isGranted('ROLE_CONTACT') || $this->security->isGranted('ROLE_TRESORIER'))) {
// if ($this->hasRequest()) { if ($this->hasRequest()) {
// if (empty($this->getRequest()->getSession()->get('_groupegere'))) { if (empty($this->getRequest()->getSession()->get('_groupegere'))) {
// if (!$this->security->isGranted('ROLE_TRESORIER')) { if (!$this->security->isGranted('ROLE_TRESORIER')) {
// $query->andWhere('false = true'); $query->andWhere('false = true');
// } }
// } else { } else {
// $groupe = $this->getRequest()->getSession()->get('_groupegere'); $groupe = $this->getRequest()->getSession()->get('_groupegere');
// $connection = $em->getConnection(); $connection = $em->getConnection();
// $prestatable = $em->getMetadataFactory()->getMetadataFor(Prestataire::class)->getTableName(); $prestatable = $em->getMetadataFactory()->getMetadataFor(Prestataire::class)->getTableName();
// $accountTable = $em->getMetadataFactory()->getMetadataFor(AccountPrestataire::class)->getTableName(); $accountTable = $em->getMetadataFactory()->getMetadataFor(AccountPrestataire::class)->getTableName();
// $statement = $connection->prepare('SELECT f.id FROM ' . $operationPrestatable . ' f WHERE f.account_id IN $statement = $connection->prepare('SELECT f.id FROM ' . $operationPrestatable . ' f WHERE f.account_id IN
// (SELECT a.id FROM ' . $accountTable . ' a WHERE a.prestataire_id IN (SELECT a.id FROM ' . $accountTable . ' a WHERE a.prestataire_id IN
// (SELECT p.id FROM ' . $prestatable . ' p WHERE p.groupe_id = "' . $groupe->getId() . '") (SELECT p.id FROM ' . $prestatable . ' p WHERE p.groupe_id = "' . $groupe->getId() . '")
// )'); )');
// $statement->execute(); $statement->execute();
// $ids = $statement->fetchAll(); $ids = $statement->fetchAll();
// $query $query
// ->andWhere($query->expr()->in($query->getRootAliases()[0] . '.id', ':ids')) ->andWhere($query->expr()->in($query->getRootAliases()[0] . '.id', ':ids'))
// ->setParameter('ids', $ids) ->setParameter('ids', $ids)
// ; ;
// } }
// } }
// } }
return $query; return $query;
} }
......
...@@ -58,26 +58,25 @@ class TransfertAdmin extends FluxAdmin ...@@ -58,26 +58,25 @@ class TransfertAdmin extends FluxAdmin
$em = $this->getConfigurationPool()->getContainer()->get('doctrine')->getManager(); $em = $this->getConfigurationPool()->getContainer()->get('doctrine')->getManager();
$fluxtable = $em->getMetadataFactory()->getMetadataFor(Flux::class)->getTableName(); $fluxtable = $em->getMetadataFactory()->getMetadataFor(Flux::class)->getTableName();
if ($this->hasRequest()) { if ($this->hasRequest()) {
// if ($this->security->isGranted('ROLE_GESTION_GROUPE') || $this->security->isGranted('ROLE_CONTACT') || $this->security->isGranted('ROLE_TRESORIER')) { if ($this->security->isGranted('ROLE_GESTION_GROUPE') || $this->security->isGranted('ROLE_CONTACT') || $this->security->isGranted('ROLE_TRESORIER')) {
// if (empty($this->getRequest()->getSession()->get('_groupegere'))) { if (empty($this->getRequest()->getSession()->get('_groupegere'))) {
// if (!$this->security->isGranted('ROLE_TRESORIER')) { if (!$this->security->isGranted('ROLE_TRESORIER')) {
// $query->andWhere('false = true'); $query->andWhere('false = true');
// } }
// } else { } else {
// $groupe = $this->getRequest()->getSession()->get('_groupegere'); $groupe = $this->getRequest()->getSession()->get('_groupegere');
// $connection = $em->getConnection(); $connection = $em->getConnection();
// $prestatable = $em->getMetadataFactory()->getMetadataFor(Prestataire::class)->getTableName(); $prestatable = $em->getMetadataFactory()->getMetadataFor(Prestataire::class)->getTableName();
// $statement = $connection->prepare('SELECT f.id FROM ' . $fluxtable . ' f WHERE f.groupe_id = :groupe_id OR (f.prestataire_id IN (SELECT p.id FROM ' . $prestatable . ' p WHERE p.groupe_id = :groupe_id)) OR (f.prestataire_dest_id IN (SELECT p.id FROM ' . $prestatable . ' p WHERE p.groupe_id = :groupe_id))'); $statement = $connection->prepare('SELECT f.id FROM ' . $fluxtable . ' f WHERE f.groupe_id = :groupe_id OR (f.prestataire_id IN (SELECT p.id FROM ' . $prestatable . ' p WHERE p.groupe_id = :groupe_id)) OR (f.prestataire_dest_id IN (SELECT p.id FROM ' . $prestatable . ' p WHERE p.groupe_id = :groupe_id))');
// $statement->bindValue(':groupe_id', $groupe->getId()); $statement->bindValue(':groupe_id', $groupe->getId());
// $statement->execute(); $statement->execute();
// $ids = $statement->fetchAll(); $ids = $statement->fetchAll();
// $query $query
// ->andWhere($query->expr()->in($query->getRootAliases()[0] . '.id', ':ids')) ->andWhere($query->expr()->in($query->getRootAliases()[0] . '.id', ':ids'))
// ->setParameter('ids', $ids) ->setParameter('ids', $ids)
// ; ;
// } }
// } else } else if ($this->security->isGranted('ROLE_COMPTOIR')) {
if ($this->security->isGranted('ROLE_COMPTOIR')) {
if (empty($this->getRequest()->getSession()->get('_comptoirgere'))) { if (empty($this->getRequest()->getSession()->get('_comptoirgere'))) {
$query->andWhere('false = true'); $query->andWhere('false = true');
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment