Loading code/test2.php +35 −0 Original line number Diff line number Diff line Loading @@ -6,3 +6,38 @@ * @var $viewName string * @var $sl \Zend\ServiceManager\ServiceLocatorInterface */ $sql = " SELECT w.annee_id, w.intervenant_id, si.source_code statut_intervenant, s.libelle_court structure, w.etape_code, w.atteignable, w.objectif, w.realisation FROM tbl_workflow w JOIN wf_etape e ON e.id = w.etape_id JOIN statut_intervenant si ON si.id = w.statut_intervenant_id LEFT JOIN structure s ON s.id = w.structure_id ORDER BY w.intervenant_id, e.ordre "; /** @var $em \Doctrine\ORM\EntityManager */ $em = $container->get(\Application\Constants::BDD); $ids = $em->getConnection()->query($sql); $feuilles = []; foreach( $ids as $id ){ $intervenant = (int)$id['INTERVENANT_ID']; unset($id['INTERVENANT_ID']); $feuilles[$intervenant][] = $id; } var_dump($feuilles); No newline at end of file module/Application/src/Application/Service/ElementPedagogiqueService.php +1 −1 Original line number Diff line number Diff line Loading @@ -281,7 +281,7 @@ where rang = 1 public function delete($entity, $softDelete = true) { if (!$this->getAuthorize()->isAllowed($entity, Privileges::ODF_ELEMENT_EDITION)) { throw new \UnAuthorizedException('Vous n\'êtes pas autorisé(e) à supprimer cet enseignement.'); throw new UnAuthorizedException('Vous n\'êtes pas autorisé(e) à supprimer cet enseignement.'); } foreach ($entity->getCheminPedagogique() as $cp) { Loading module/Application/src/Application/Service/EtapeService.php +4 −3 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ use Application\Service\Traits\ContextServiceAwareTrait; use Application\Service\Traits\GroupeTypeFormationServiceAwareTrait; use Application\Service\Traits\StructureServiceAwareTrait; use Application\Service\Traits\TypeFormationServiceAwareTrait; use BjyAuthorize\Exception\UnAuthorizedException; use Doctrine\ORM\QueryBuilder; use Application\Entity\Db\Etape; Loading Loading @@ -151,7 +152,7 @@ class EtapeService extends AbstractEntityService } if (!$this->getAuthorize()->isAllowed($entity, Privileges::ODF_ETAPE_EDITION)) { throw new \UnAuthorizedException('Vous n\'êtes pas autorisé(e) à enregistrer cette formation.'); throw new UnAuthorizedException('Vous n\'êtes pas autorisé(e) à enregistrer cette formation.'); } return parent::save($entity); Loading @@ -162,7 +163,7 @@ class EtapeService extends AbstractEntityService public function saveModulateurs(Etape $etape) { if (!$this->getAuthorize()->isAllowed($etape, Privileges::ODF_MODULATEURS_EDITION)) { throw new \UnAuthorizedException('Vous n\'êtes pas autorisé(e) à enregistrer cette formation.'); throw new UnAuthorizedException('Vous n\'êtes pas autorisé(e) à enregistrer cette formation.'); } $serviceElementModulateur = $this->getServiceElementModulateur(); Loading Loading @@ -192,7 +193,7 @@ class EtapeService extends AbstractEntityService public function delete($entity, $softDelete = true) { if (!$this->getAuthorize()->isAllowed($entity, Privileges::ODF_ETAPE_EDITION)) { throw new \UnAuthorizedException('Vous n\'êtes pas autorisé(e) à supprimer cette formation.'); throw new UnAuthorizedException('Vous n\'êtes pas autorisé(e) à supprimer cette formation.'); } return parent::delete($entity, $softDelete); Loading Loading
code/test2.php +35 −0 Original line number Diff line number Diff line Loading @@ -6,3 +6,38 @@ * @var $viewName string * @var $sl \Zend\ServiceManager\ServiceLocatorInterface */ $sql = " SELECT w.annee_id, w.intervenant_id, si.source_code statut_intervenant, s.libelle_court structure, w.etape_code, w.atteignable, w.objectif, w.realisation FROM tbl_workflow w JOIN wf_etape e ON e.id = w.etape_id JOIN statut_intervenant si ON si.id = w.statut_intervenant_id LEFT JOIN structure s ON s.id = w.structure_id ORDER BY w.intervenant_id, e.ordre "; /** @var $em \Doctrine\ORM\EntityManager */ $em = $container->get(\Application\Constants::BDD); $ids = $em->getConnection()->query($sql); $feuilles = []; foreach( $ids as $id ){ $intervenant = (int)$id['INTERVENANT_ID']; unset($id['INTERVENANT_ID']); $feuilles[$intervenant][] = $id; } var_dump($feuilles); No newline at end of file
module/Application/src/Application/Service/ElementPedagogiqueService.php +1 −1 Original line number Diff line number Diff line Loading @@ -281,7 +281,7 @@ where rang = 1 public function delete($entity, $softDelete = true) { if (!$this->getAuthorize()->isAllowed($entity, Privileges::ODF_ELEMENT_EDITION)) { throw new \UnAuthorizedException('Vous n\'êtes pas autorisé(e) à supprimer cet enseignement.'); throw new UnAuthorizedException('Vous n\'êtes pas autorisé(e) à supprimer cet enseignement.'); } foreach ($entity->getCheminPedagogique() as $cp) { Loading
module/Application/src/Application/Service/EtapeService.php +4 −3 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ use Application\Service\Traits\ContextServiceAwareTrait; use Application\Service\Traits\GroupeTypeFormationServiceAwareTrait; use Application\Service\Traits\StructureServiceAwareTrait; use Application\Service\Traits\TypeFormationServiceAwareTrait; use BjyAuthorize\Exception\UnAuthorizedException; use Doctrine\ORM\QueryBuilder; use Application\Entity\Db\Etape; Loading Loading @@ -151,7 +152,7 @@ class EtapeService extends AbstractEntityService } if (!$this->getAuthorize()->isAllowed($entity, Privileges::ODF_ETAPE_EDITION)) { throw new \UnAuthorizedException('Vous n\'êtes pas autorisé(e) à enregistrer cette formation.'); throw new UnAuthorizedException('Vous n\'êtes pas autorisé(e) à enregistrer cette formation.'); } return parent::save($entity); Loading @@ -162,7 +163,7 @@ class EtapeService extends AbstractEntityService public function saveModulateurs(Etape $etape) { if (!$this->getAuthorize()->isAllowed($etape, Privileges::ODF_MODULATEURS_EDITION)) { throw new \UnAuthorizedException('Vous n\'êtes pas autorisé(e) à enregistrer cette formation.'); throw new UnAuthorizedException('Vous n\'êtes pas autorisé(e) à enregistrer cette formation.'); } $serviceElementModulateur = $this->getServiceElementModulateur(); Loading Loading @@ -192,7 +193,7 @@ class EtapeService extends AbstractEntityService public function delete($entity, $softDelete = true) { if (!$this->getAuthorize()->isAllowed($entity, Privileges::ODF_ETAPE_EDITION)) { throw new \UnAuthorizedException('Vous n\'êtes pas autorisé(e) à supprimer cette formation.'); throw new UnAuthorizedException('Vous n\'êtes pas autorisé(e) à supprimer cette formation.'); } return parent::delete($entity, $softDelete); Loading