Commit ab69eb28 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Merge branches 'develop' and 'master' of https://git.unicaen.fr/open-source/OSE

parents 3ec4a15c b91800eb
Loading
Loading
Loading
Loading
+35 −0
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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) {
+4 −3
Original line number Diff line number Diff line
@@ -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;

@@ -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);
@@ -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();
@@ -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);