Commit 75a2b169 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Utilisation du pool de logo plutot qu'un chemin en dur

parent 8841d2ba
Loading
Loading
Loading
Loading
−1
Changes for module/Application/src/Application/Service/These/PageDeGarde/PageDeGardePdfExporter.php: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ class PageDeGardePdfExporter extends PdfExporter

    public function export($filename = null, $destination = self::DESTINATION_BROWSER, $memoryLimit = null)
    {

        $this->addBodyHtml('<style>' . file_get_contents(APPLICATION_DIR . '/public/css/page-unicaen.css') . '</style>');
        $this->setHeaderScript('empty.phtml');
        $this->setFooterScript('empty.phtml');
+5 −88
Changes for module/Application/src/Application/Service/These/PageDeGarde/pagedegarde.phtml: 5 added lines, 88 removed lines.
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ function getActeurRole(Acteur $acteur, $inclusive) {
 * @return string
 */
function generateLogoComue() {
    $img_src = APPLICATION_DIR . "/public/ressources/normandie-universite.png";
    $img_src = APPLICATION_DIR . "/ressources/Logos/Etab/COMUE.png";
    $texte  = "<div class='logo-comue'>";
    $texte .= "<img src='".$img_src."'/>";
    $texte .= "</div>";
@@ -227,99 +227,15 @@ function generateEncadrementInfos(These $these) {
    return $texte;
}


/** Fonction retournant l'URL du logo de l'école doctorale d'une thèse donnée
 * TODO prevoir un logo pour ED non trouvée
 */
function getLogoEcoleDoctoral(These $these) {
    $code_2_file = [
            "98"            => "DN ED98.png",
            "508"           => "EDNC ED508.png",
            "242"           => "EGN ED242.jpg",
            "558"           => "HMPL ED558.jpg",
            "556"           => "HSRT ED 556 hsrt.jpg",
            "590"           => "MIIS ED591.png",
            "497"           => "NBISE_ed497.png",
            "591"           => "psime_ED591.png",
    ];
    $url = APPLICATION_DIR. "/public/Logos/ED/" .$code_2_file[$these->getEcoleDoctorale()->getSourceCode()];
    return $url;
}

/** Fonction retournant l'URL du logo de l'école doctorale d'une thèse donnée
 * TODO prevoir un logo pour UR non trouvée
 */
function getLogoUniteRecherche(These $these) {
    $code_2_file = [
        "EA4651"            => "ABTE-ea4651-768x481.png",
        "UMRS1086"          => "ANTICIPE-umr-s1086.jpg",
        "EA7451"            => "bioconnect ea7451.tif",
        "EA7450"            => "BIOTARGEN ea 7450.png",
        "UMR7208"           => "BOREA Umr7208.png",
        "UMR6266"           => "Capture d’écran 2017-11-23 à 14.37.25.png",
        "EA4258"            => "cermin ea4258.png",
        "EA3918"            => "cerrev ea3918.jpg",
        "EA4260"            => "CesamS-ea4260.png",
        "UMR6252"           => "cimap umr6252.jpg",
        "EA7454"            => "CIRNEF ea7454.png",
        "UMS3318"           => "CNRT Materiaux _ UMS3318.png",
        "UMRS1075"          => "comete umr-s 1075.JPG",
        "UMR6273"           => "CRAHAM umr 6273.png",
        "EA2132"            => "CRDFED ea2132.png",
        "EA6211"            => "CREM-ea6211_preview.png",
        "EA7455"            => "CRHQ ea7455.jpg",
        "EA4255"            => "CRISCO ea4255.png",
        "UMR6508"           => "CRISMAT umr6508.jpg",
        "UMS3408"           => "Cyceron-UMS3408.png",
        "EA2610"            => "eribia_ea2610.gif",
        "UMR6590"           => "ESO  umr 6590.png",
        "UMR6552"           => "ETHOS umr6552 cnrs.jpeg",
        "UMRA950"           => "EVA umr A950.jpg",
        "FR3335"            => "FNM-FR3335.png",
        "EA2656"            => "GRAM  ea2656 .jpg",
        "UMR6072"           => "GREYC umr6072.png",
        "EA4206"            => "ICORE_ea4206.jpg",
        "EA2129"            => "IDEM ea2129.png",
        "EA967"             => "institut demolombe ea967.png",
        "FRE2001"           => "ISTCT FRE2001.tif",
        "EA7466"            => "ISTS_Ea 7466s.tiff",
        "EA7478"            => "LAC ea7478.png",
        "UMR8240"           => "LaPsyDE_umr8240.pdf",
        "EA4256"            => "LASLAR  ea4256.jpg",
        "UMR6507"           => "LCMT umr6507.png",
        "UMR6506"           => "LCS umr6506.png",
        "UMR6554"           => "LETG  umr6554.png",
        "UMR6139"           => "LMNO umr 6139.png",
        "UMR6434"           => "LPC_ umr6534.jpg",
        "EA7452"            => "LPCN ea7452.png",
        "EA4253"            => "LUSAC ea4253",
        "UMR6143"           => "M2C umr6143.jpg",
        "EA696"             => "NIMEC ea969.pdf",
        "UMR1077"           => "NIMH_umr1077_titre.png",
        "FR3638"            => "NORMASTIC fr3638.png",
        "EA2608"            => "OeReCa ea2608.png",
        "UMRS1237"          => "PhIND Umr S1237-  INSERM 2018.png"
    ];
    $img = $code_2_file[$these->getUniteRecherche()->getSourceCode()];
    if ($img === null) {
        $url = null;
    } else {
        $url = APPLICATION_DIR . "/public/Logos/UR/" . $img;
    }
    return $url;
}

/** Fonction générant le code HTML lié au encradrant
 * @param These         $these
 * @return string
 *
 * TODO utiliser le vrai pool de logos ...
 */
function generateLogos(These $these) {

    $logouni = APPLICATION_DIR. "/public/ressources/unicaen.png";
    $logoed = getLogoEcoleDoctoral($these);
    $logour = getLogoUniteRecherche($these);
    $logouni = APPLICATION_DIR. $these->getEtablissement()->getCheminLogo();
    $logoed  = APPLICATION_DIR. $these->getEcoleDoctorale()->getCheminLogo();
    $logour  = APPLICATION_DIR. $these->getUniteRecherche()->getCheminLogo();

    $texte = "";
    $texte  .= "<div class='logos'>";
@@ -332,6 +248,7 @@ function generateLogos(These $these) {
    $texte .= "<img class='logo_small' src='".$logour."'/>";
    $texte .= "</td></tr></table>";
    $texte .= "</div>";

    return $texte;
}