Commit 8cb9d1e8 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Gestion du logo de cotutelle

parent 386af1b4
Loading
Loading
Loading
Loading
+16
Changes for module/Application/src/Application/Entity/Db/Repository/EtablissementRepository.php: 16 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -140,4 +140,20 @@ class EtablissementRepository extends DefaultEntityRepository

        return $etablissement;
    }

    public function findOneByLibelle($libelle)
    {
        $qb = $this->createQueryBuilder("e")
            ->addSelect("s")
            ->join("e.structure", "s")
            ->andWhere("s.libelle = :structureId")
            ->setParameter("structureId", $libelle);
        try {
            $etablissement = $qb->getQuery()->getOneOrNullResult();
        } catch (NonUniqueResultException $e) {
            throw new RuntimeException("Anomalie plusieurs établissements avec le même id.", 0, $e);
        }

        return $etablissement;
    }
}
 No newline at end of file
+12
Changes for module/Application/src/Application/Service/Fichier/FichierService.php: 12 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ namespace Application\Service\Fichier;
use Application\Command\ShellScriptRunner;
use Application\Controller\TheseController;
use Application\Entity\Db\Acteur;
use Application\Entity\Db\Etablissement;
use Application\Entity\Db\Fichier;
use Application\Entity\Db\NatureFichier;
use Application\Entity\Db\Repository\FichierRepository;
@@ -550,6 +551,17 @@ class FichierService extends BaseService
        $directeurs =  array_filter($acteurs, function($a) {return TheseController::estDirecteur($a); });
        $membres = array_diff($acteurs, $rapporteurs, $directeurs);
        $informations["ENSI"] = (TheseController::estENSI($directeurs))?"oui":"non";
        $informations["cotut-libelle"] = ($these->getLibelleEtabCotutelle())?($these->getLibelleEtabCotutelle()):"non";
        $informations["cotut-pays"]    = ($these->getLibellePaysCotutelle())?($these->getLibellePaysCotutelle()):"non";
        $informations["logo-cotutelle"]    = ($these->getLibelleEtabCotutelle())?"":"non";

        //fetch logo cotut
        /** @var Etablissement $etabCotut */
        $etabCotut = $this->getEtablissementService()->getRepository()->findOneByLibelle($informations["cotut-libelle"]);
        if ($etabCotut) {
            $logo = $etabCotut->getCheminLogo();
            if ($logo) $informations["logo-cotutelle"] = $logo;
        }

        $informations["nombre de membres"] = count($membres)?count($membres):"";
        $informations["nombre de rapporteurs"] = count($rapporteurs)?count($rapporteurs):"";
+20 −8
Changes for module/Application/src/Application/Service/These/PageDeGarde/pagedecouverture.phtml: 20 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -60,14 +60,17 @@ $PATH = Structure::PATH;
    <?php endif; ?>
    <br/>

<!-- TODO COTUTELLE -->
<!--    //Preparation des champs associés à la cotutelle-->
<!--    if ($these->getLibelleEtabCotutelle() !== null && $these->getLibellePaysCotutelle() === null) {-->
<!--    $texte .= "En cotutelle avec " . $these->getLibelleEtabCotutelle() . "<br/>";-->
<!--    }-->
<!--    if ($these->getLibelleEtabCotutelle() !== null && $these->getLibellePaysCotutelle() !== null) {-->
<!--    $texte .= "En cotutelle internationale de thèse avec " . $these->getLibelleEtabCotutelle() .", ". $these->getLibellePaysCotutelle() . "<br/>";-->
<!--    }-->
    <?php if ($informations["cotut-libelle"] !== "non"): ?>
        En cotutelle
        <?php if ($informations["cotut-pays"] !== "non"): ?>
            internationnale
        <?php endif; ?>
        avec
        <?php echo $informations["cotut-libelle"]; ?>
        <?php if ($informations["cotut-pays"] !== "non"): ?>
            , <?php echo ($informations["cotut-pays"]); ?>
        <?php endif; ?>
    <?php endif; ?>
</div>


@@ -153,6 +156,15 @@ $PATH = Structure::PATH;
        </td>
        <?php endif; ?>
        <!-- TODO COTUTELLE -->
        <?php if ($informations["cotut-libelle"] != "non"): ?>
            <td>
                <?php if ($informations["logo-cotutelle"]): ?>
                    <img class="logo_small" src="<?php echo $PATH . $informations["logo-cotutelle"]; ?>"/>
                <?php else: ?>
                    <span style='background-color:red;'> Établissement de cotutelle ou logo d'établissement non renseigné. </span>
                <?php endif; ?>
            </td>
        <?php endif; ?>
        <td>
            <?php if ($informations["logo-ecoleDoctorale"]): ?>
                <img class="logo_small" src="<?php echo $PATH . ($informations["logo-ecoleDoctorale"]); ?>"/>