Commit 7cf8a297 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Merge branch 'FixPDC'

parents a5f4a826 a4f82829
Loading
Loading
Loading
Loading
+14
Changes for module/Application/src/Application/Controller/TheseController.php: 14 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -1446,6 +1446,7 @@ class TheseController extends AbstractController

    /** Vrai si un des acteurs à pour etablissement : '14 ENSI de Caen' ou 'ENSI DE CAEN'
     * @param Acteur[] $acteurs
     * @return bool
     */
    public static function estENSI($acteurs) {
        foreach ($acteurs as $acteur) {
@@ -1456,6 +1457,19 @@ class TheseController extends AbstractController
        return false;
    }

    /** Vrai si un des acteurs à pour etablissement : '14 ENSI de Caen' ou 'ENSI DE CAEN'
     * @param Acteur[] $acteurs
     * @return bool
     */
    public static function estESITC($acteurs) {
        foreach ($acteurs as $acteur) {
            if ($acteur->getEtablissement() == 'ESITC' || $acteur->getEtablissement() == 'ESITC Caen') {
                return true;
            }
        }
        return false;
    }

    /**
     * Prédicat testant si un acteur est un rapporteur de thèse
     * @param Acteur $var
+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
+14 −1
Changes for module/Application/src/Application/Service/Fichier/FichierService.php: 14 added lines, 1 removed line.
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;
@@ -549,7 +550,19 @@ class FichierService extends BaseService
        $rapporteurs =  array_filter($acteurs, function($a) {return TheseController::estRapporteur($a); });
        $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";
//        /** @var Etablissement $etabCotut */
//        $etabCotut = $this->getEtablissementService()->getRepository()->findOneByLibelle($informations["cotut-libelle"]);
//        if ($etabCotut) {
//            $logo = $etabCotut->getCheminLogo();
//            if ($logo) $informations["logo-cotutelle"] = $logo;
//        }

        $informations["logo-associe"] = "non";
        if (TheseController::estENSI($directeurs))      $informations["logo-associe"] = "public/logo_ensi.jpg";
        if (TheseController::estESITC ($directeurs))    $informations["logo-associe"] = "public/logo_esitc.jpg";

        $informations["nombre de membres"] = count($membres)?count($membres):"";
        $informations["nombre de rapporteurs"] = count($rapporteurs)?count($rapporteurs):"";
+27 −12
Changes for module/Application/src/Application/Service/These/PageDeGarde/pagedecouverture.phtml: 27 added lines, 12 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>


@@ -146,13 +149,25 @@ $PATH = Structure::PATH;
                <span style='background-color:red;'> Établissement d'inscription ou logo d'établissement non renseigné. </span>
            <?php endif; ?>
        </td>
        <!-- TODO ENSI -->
        <?php if ($informations["ENSI"] == "oui"): ?>
        <!-- TODO ASSOCIE -->
        <?php if ($informations["logo-associe"] == "oui"): ?>
            <td>
            <img class="logo_small" src="public/logo_ensi.jpg"/>
                <?php if ($informations["logo-cotutelle"]): ?>
                    <img class="logo_small" src="<?php echo $PATH . $informations["logo-associe"]; ?>"/>
                <?php else: ?>
                    <span style='background-color:red;'> Établissement associé ou logo d'établissement non renseigné. </span>
                <?php endif; ?>
            </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"]); ?>"/>
+7.18 KiB
Loading image diff...