Commit 30aaa703 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Affinage des queries

parent dc17a057
Loading
Loading
Loading
Loading
+28
Changes for module/Application/src/Application/Service/Individu/IndividuService.php: 28 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -150,8 +150,22 @@ class IndividuService extends BaseService
    public function getActeurSansMail()
    {
        $qb = $this->getEntityManager()->getRepository(Acteur::class)->createQueryBuilder("acteur")
            ->addSelect("these")
            ->addSelect("individu")
            ->addSelect("etablissement")
            ->addSelect("ecoleDoctorale")
            ->addSelect("uniteRecherche")
            ->addSelect("structure_etab")
            ->addSelect("structure_ed")
            ->addSelect("structure_ur")
            ->leftJoin("acteur.individu", "individu")
            ->leftJoin("acteur.these", "these")
            ->leftJoin("these.etablissement", "etablissement")
            ->leftJoin("etablissement.structure", "structure_etab")
            ->leftJoin("these.ecoleDoctorale", "ecoleDoctorale")
            ->leftJoin("ecoleDoctorale.structure", "structure_ed")
            ->leftJoin("these.uniteRecherche", "uniteRecherche")
            ->leftJoin("uniteRecherche.structure", "structure_ur")
            ->andWhere("individu.email is NULL")
            ->andWhere("these.etatThese = 'E'")
            ->orderBy("these.sourceCode")
@@ -164,8 +178,22 @@ class IndividuService extends BaseService
    public function getDoctorantSansMail()
    {
        $qb = $this->getEntityManager()->getRepository(These::class)->createQueryBuilder("these")
            ->addSelect("doctorant")
            ->addSelect("individu")
            ->leftJoin("these.doctorant", "doctorant")
            ->leftJoin("doctorant.individu", "individu")
            ->addSelect("etablissement")
            ->addSelect("ecoleDoctorale")
            ->addSelect("uniteRecherche")
            ->addSelect("structure_etab")
            ->addSelect("structure_ed")
            ->addSelect("structure_ur")
            ->leftJoin("these.etablissement", "etablissement")
            ->leftJoin("etablissement.structure", "structure_etab")
            ->leftJoin("these.ecoleDoctorale", "ecoleDoctorale")
            ->leftJoin("ecoleDoctorale.structure", "structure_ed")
            ->leftJoin("these.uniteRecherche", "uniteRecherche")
            ->leftJoin("uniteRecherche.structure", "structure_ur")
            ->andWhere("individu.email is NULL")
            ->andWhere("these.etatThese = 'E'")
            ->orderBy("these.sourceCode")
+32
Changes for module/Application/src/Application/Service/These/TheseService.php: 32 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -233,6 +233,22 @@ class TheseService extends BaseService
    public function getTheseEnCoursPostSoutenance()
    {
        $qb = $this->getEntityManager()->getRepository(These::class)->createQueryBuilder("these")
            ->addSelect("doctorant")
            ->addSelect("individu")
            ->leftJoin("these.doctorant", "doctorant")
            ->leftJoin("doctorant.individu", "individu")
            ->addSelect("etablissement")
            ->addSelect("ecoleDoctorale")
            ->addSelect("uniteRecherche")
            ->addSelect("structure_etab")
            ->addSelect("structure_ed")
            ->addSelect("structure_ur")
            ->leftJoin("these.etablissement", "etablissement")
            ->leftJoin("etablissement.structure", "structure_etab")
            ->leftJoin("these.ecoleDoctorale", "ecoleDoctorale")
            ->leftJoin("ecoleDoctorale.structure", "structure_ed")
            ->leftJoin("these.uniteRecherche", "uniteRecherche")
            ->leftJoin("uniteRecherche.structure", "structure_ur")
            ->andWhere("these.etatThese = :encours")
            ->andWhere("these.dateSoutenance < :today")
            ->setParameter("encours", These::ETAT_EN_COURS)
@@ -283,6 +299,22 @@ class TheseService extends BaseService
        $dateLimite = \DateTime::createFromFormat('d/m/Y', "01/".$mois."/".$annee);

        $qb = $this->getEntityManager()->getRepository(These::class)->createQueryBuilder("these")
            ->addSelect("doctorant")
            ->addSelect("individu")
            ->leftJoin("these.doctorant", "doctorant")
            ->leftJoin("doctorant.individu", "individu")
            ->addSelect("etablissement")
            ->addSelect("ecoleDoctorale")
            ->addSelect("uniteRecherche")
            ->addSelect("structure_etab")
            ->addSelect("structure_ed")
            ->addSelect("structure_ur")
            ->leftJoin("these.etablissement", "etablissement")
            ->leftJoin("etablissement.structure", "structure_etab")
            ->leftJoin("these.ecoleDoctorale", "ecoleDoctorale")
            ->leftJoin("ecoleDoctorale.structure", "structure_ed")
            ->leftJoin("these.uniteRecherche", "uniteRecherche")
            ->leftJoin("uniteRecherche.structure", "structure_ur")
            ->andWhere("these.etatThese = :encours")
            ->andWhere("these.datePremiereInscription <= :date")
            ->setParameter("encours", These::ETAT_EN_COURS)
+23
Changes for module/Indicateur/config/module.config.php: 23 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -30,6 +30,29 @@ return array(
    ],
    'doctrine'     => [],

    'navigation'      => [
        'default' => [
            'home' => [
                'pages' => [
                    'admin' => [
                        'pages' => [
                            'indicateur' => [
                                'label'    => 'Indicateurs',
                                'route'    => 'indicateur',
                                //'resource' => PrivilegeController::getResourceId('Application\Controller\EcoleDoctorale', 'index'),
                                'roles' => [
                                    'Administrateur technique',
                                ],

                                'order'    => 1,
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],

    'router' => [
        'routes' => [
            'indicateur' => [
+15 −12
Changes for module/Indicateur/view/indicateur/indicateur/index.phtml: 15 added lines, 12 removed lines.
Original line number Diff line number Diff line
@@ -16,11 +16,14 @@ use Application\Entity\Db\These;
?>


<h1>
<h1 class="page-header first">
    Indicateurs de SyGAL
</h1>

<div>

    <div class="row">

        <div class="col-md-4">
            <div class="panel panel-info">
                <div class="panel-heading">
@@ -29,7 +32,7 @@ use Application\Entity\Db\These;
                        $annee= $date->format("Y");
                        ?>
                    <h4>
                    Thèses par établissements pour l'année <?php echo $annee; ?>
                        État des thèses pour l'année <?php echo $annee; ?>
                    </h4>
                </div>
                <div class="panel-body">
@@ -56,11 +59,12 @@ use Application\Entity\Db\These;
                </div>
            </div>
        </div>

        <div class="col-md-4">
            <div class="panel panel-warning">
                <div class="panel-heading">
                    <h4>
                    Thèses en cours malgré soutenance dépassée
                        Thèses avec soutenance dépassée
                        <span class="badge"> <?echo count($theses); ?> </span>
                    </h4>
                </div>
@@ -96,7 +100,6 @@ use Application\Entity\Db\These;
                </div>
            </div>
        </div>
</div>

        <div class="col-md-4">
            <div class="panel panel-warning">
@@ -141,12 +144,15 @@ use Application\Entity\Db\These;
            </div>
        </div>

<div>
    </div>

    <div class="row">

        <div class="col-md-4">
            <div class="panel panel-warning">
                <div class="panel-heading">
                    <h4>
                    Doctorants sans adresse électronique
                        Doctorants sans eMail
                        <span class="badge"> <?echo count($doctorantsSansMail); ?> </span>
                    </h4>
                </div>
@@ -184,15 +190,12 @@ use Application\Entity\Db\These;
                </div>
            </div>
        </div>
</div>


<div>
        <div class="col-md-4">
            <div class="panel panel-warning">
                <div class="panel-heading">
                    <h4>
                    Acteurs sans adresse électronique
                        Acteurs sans eMail
                        <span class="badge"> <?echo count($acteursSansMail); ?> </span>
                    </h4>
                </div>
@@ -230,9 +233,7 @@ use Application\Entity\Db\These;
                </div>
            </div>
        </div>
</div>

<div>
        <div class="col-md-4">
            <div class="panel panel-danger">
                <div class="panel-heading">
@@ -276,3 +277,5 @@ use Application\Entity\Db\These;
            </div>
        </div>
    </div>

</div>