Commit 5c16da55 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Génération de la page de couverture de la thèse : refonte graphique dans le sens de la sobriété.

parent 8f4ed041
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ Journal des modifications

6.0.10
------
- Génération de la page de couverture de la thèse : refonte graphique dans le sens de la sobriété.
- Nouvelle entrée 'Rapports CSI' dans le menu 'Nos thèses' des gestionnaires/responsables d'ED/UR.
- Petites améliorations autour des notifs concernant les changements détectés lors de l'import (admission, corrections attendues).
- Financements sur la fiche Thèse : afficher la nature devant chaque info (type, origine, quotité).
+99 −92
Original line number Diff line number Diff line
body { background-color: white; }

div.logo-comue {
    width:5cm;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
html {
    font-family: Arial, Helvetica, sans-serifl, serif;
}

.bandeau-these {
    width:18cm;
    display: block;
    margin-left: auto;
    margin-right: auto;
    background-color: #5B2268;
body {
    background-color: white;
}

    font-family: Arial, Helvetica, sans-serifl;
p {
    margin-top: 0;
    margin-bottom: 0.2cm;
}

.gras {
    font-weight: bold;
    font-size:16pt;
    color:white;
    text-align: center;
}
.infos-diplome {
    width:18cm;
    display: block;
    margin-left: auto;
    margin-right: auto;

.bandeau-these {
    width: 18.5cm;
    margin: 0.75cm auto 0.5cm auto;
    border: 3px solid black;
}

    font-family: Arial, Helvetica, sans-serifl;
.bandeau-these h1 {
    font-weight: bold;
    font-size:12pt;
    font-size: 18pt;
    text-align: center;
    line-height: 2em;
    margin-top: 1ex;
    margin-bottom: 1ex;
    letter-spacing: 3px;
    margin: 0.2cm 0;
}
.larger-infos {
    font-size:14pt;

.infos-diplome {
    width: 18.5cm;
    font-family: Arial, Helvetica, sans-serifl, serif;
    font-size: 12pt;
    text-align: center;
    margin: 0.25cm auto;
}

.bandeau-titre {
    width:18cm;
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 16cm;
    background-color: #e8e8e8;
    border: 1px solid black;
    padding: 0.25cm;
    margin: 2ex auto 1ex;
}

    background-color: #BFBFBF;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
    font-size:15pt;
    padding: 0.1cm;
    color:black;
    line-height: 1.3;
.bandeau-titre p {
    font-size: 14pt;
    text-align: center;
    margin-top: 2ex;
    margin-bottom: 1ex;
    margin-bottom: 0;
}

.infos-doctorant {
    width:18cm;
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 18.5cm;
    font-size: 16pt;
    text-align: center;
    margin: 1ex auto;
}

    font-family: Arial, Helvetica, sans-serifl;
    font-weight: bold;
    font-size:14pt;
.infos-soutenance {
    width: 18.5cm;
    font-size: 13pt;
    text-align: center;
    margin-top: 1ex;
    margin-bottom: 1ex;
    margin: 1ex auto 0;
}

table.jury {
    border-collapse: collapse;
    width: 18.5cm;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

table.jury th {
    background-color: #F5A756;
    width: 18cm;
    font-family: Arial, Helvetica, sans-serifl;
    font-weight: bold;
    width: 18.5cm;
    font-family: Arial, Helvetica, sans-serifl, serif;
    font-weight: normal;
    font-size: 12pt;
    text-align: center;

    border-width: 0.3mm;
    border-color: #F5A756;
    border: solid;
    border: 1px solid black;
    border-collapse: collapse;
}

table.jury td {
    font-size: 10pt;
    min-width: 4cm;

    font-family: Arial, Helvetica, sans-serifl;

    border-width: 0.3mm;
    border-color: #F5A756;
    border: solid;
    font-family: Arial, Helvetica, sans-serifl, serif;
    border: 1px solid black;
    border-collapse: collapse;
    padding: 1mm;
}

table.jury td.individu {
    width: 5cm;
}
table.jury td.qualite {

}
table.jury td.role {

}

.infos-encadrement {
    width:18cm;
    display: block;
    margin-left: auto;
    width: 18.5cm;
    padding-left: 2mm;
    margin-left: 0.25cm;
    margin-top: 0.25cm;
    margin-right: auto;

    font-family: Arial, Helvetica, sans-serifl;
    font-weight: bold;
    font-size: 12pt;
    text-align: left;

    border-left: solid;
    border-width: 1.5mm;
    padding-left: 2mm;
    border-color: #F5A756;
    border-width: 2px;
    border-color: black;
}

div.logos {
    position: absolute;
    top: 25cm;
    left:1.5cm;
}
table.logos {
    width:18cm;
    width: 18.5cm;
    margin-left: auto;
    margin-right: auto;
}

table.logos td {
    /*border: solid;*/
    /*border-color: black;*/
    width:6cm;
    height:4.5cm;
    text-align: center;
}
img.logo_small {
    max-width:4cm;

table.logos.header td {
    width: 10cm;
    vertical-align: top;
}

table.logos.footer td {
    height: 3cm;
    width: 6cm;
    vertical-align: bottom;
}

img.logo {
    max-height: 4cm;
    text-align: center;
    max-width: 4cm;
}

img.logo_small {
    max-width: 3cm;
    max-height: 3cm;
}

div.footer {
    position: absolute;
    top: 25.5cm;
}
 No newline at end of file
+155 −166
Original line number Diff line number Diff line
<?php

use These\Entity\Db\These;
use Application\View\Renderer\PhpRenderer;
use Structure\Entity\Db\Etablissement;
use These\Service\FichierThese\PdcData;
use These\Service\These\TheseService;
use Application\View\Renderer\PhpRenderer;

/**
 * @var PhpRenderer $this
 * @var These                   $these
 * @var array(string=>string)   $logos
 * @var array(string=>string)   $infos
 * @var array(string=>string)   $encadrements
 * @var array(array)            $jury
 * @var PdcData $informations
 *
 * @see TheseService::fetchInformationsPageDeCouverture() pour la génération de $informations
 */
?>

<!-- HEADER NORMAND --------------------------------------------------------------------------------------------------->
<!--
    A GAUCHE  >>> LE LOGO DE LA COMUE
    A DROITE  >>> LE LOGO DE L'ETABLISSEMENT D'INSCRIPTION
-->

<style>
    .logo-header {
        border: 2px hotpink solid;
        max-height: 5cm;
        max-width: 5cm;
    }
</style>
<html lang="fr">

<?php if ($informations->getLogoCOMUE() !== null): ?>
    <table style="border:none;" class="logos">
    <table class="logos header">
        <tr>
            <?php if ($informations->getLogoCOMUE() !== null): ?>
            <td>
                <?php if ($informations->getLogoCOMUE() !== null): ?>
                    <img src="<?php echo $informations->getLogoCOMUE() ?>" alt="Logo de la COMUE" class="logo-header"/>
                    <img src="<?php echo $informations->getLogoCOMUE() ?>" alt="Logo de la COMUE" class="logo"/>
                <?php else: ?>
                    <span style='background-color:red;'> Logo de la COMUE. </span>
                <?php endif; ?>
            </td>
            <?php endif; ?>
            <td>
                <?php if ($informations->getLogoEtablissement() !== null): ?>
                    <img src="<?php echo $informations->getLogoEtablissement() ?>" alt="Logo de l'établissement d'inscription" class="logo-header"/>
                    <img src="<?php echo $informations->getLogoEtablissement() ?>" alt="Logo de l'établissement d'inscription" class="logo"/>
                <?php else: ?>
                    <span style='background-color:red;'> Logo de l'établissement non renseigné. </span>
                <?php endif; ?>
            </td>
        </tr>
    </table>
<?php else : ?>
    <div class='logo-comue'>
        <?php if ($informations->getLogoEtablissement() !== null): ?>
            <img src="<?php echo $informations->getLogoEtablissement() ?>" alt="Logo de l'établissement d'inscription"/>
        <?php else: ?>
            <span style='background-color:red;'> Logo de l'établissement non renseigné. </span>
        <?php endif; ?>
    </div>
<?php endif; ?>


<!-- ENTETE DE LA PAGE DE COUVERTURE ---------------------------------------------------------------------------------->
    <div class='bandeau-these'>
        <h1>
            THÈSE
        </h1>
    </div>

    <div class='infos-diplome'>
    <span class='larger-infos'>Pour obtenir le diplôme de doctorat </span>
    <br/>

        <p>
            <span class="gras">Pour obtenir le diplôme de doctorat</span>
        </p>
        <p>
            Spécialité
            <span class="gras">
                <?php if ($informations->getSpecialite() !== null): ?>
                    <?php echo $informations->getSpecialite(); ?>
                <?php else: ?>
                    <span style='background-color:red;'> non renseignée </span>
                <?php endif; ?>
    <br/>

            </span>
        </p>
        <p>
            Préparée au sein de
    <?php if ($informations->getEtablissement() !== null): ?>
        l'<?php echo $informations->getEtablissement(); ?>
            <?php if ($etab = $informations->getEtablissement()): ?>
                <?php echo computeArticleDefiniForEtablissement($etab) ?><span class="gras"><?php echo $etab ?></span>
            <?php else: ?>
                <span style='background-color:red;'> non renseigné </span>
            <?php endif; ?>
<!--    --><?php //if ($informations->isAssocie()): ?>
<!--     et de l'--><?php //echo $informations->getLibelleAssocie(); ?>
<!--    --><?php //endif; ?>
    <br/>

        </p>
        <?php if ($informations->isCotutuelle()): ?>
            <p>
                En cotutelle
                <?php if ($informations->getCotutuellePays() !== null): ?>
                    internationale
                <?php endif; ?>
                avec
        <?php echo $informations->getCotutuelleLibelle(); ?>
        <?php if ($informations->getCotutuellePays() !== null): ?>
            , <?php echo ($informations->getCotutuellePays()); ?>
        <?php endif; ?>
                <?php echo computeArticleDefiniForEtablissement($etab) ?><span class="gras"><?php echo $informations->getCotutuelleLibelle() ?><?php if ($informations->getCotutuellePays() !== null): ?>, <?php echo ($informations->getCotutuellePays()); ?><?php endif; ?></span>
            </p>
            <?php endif; ?>
    </div>


    <div class='bandeau-titre'>
        <p class="gras">
            <?php if ($informations->getTitre() !== null): ?>
                <?php echo $informations->getTitre(); ?>
            <?php else: ?>
                <span style='background-color:red;'> Aucun titre </span>
            <?php endif; ?>
    <br/>
        </p>
    </div>

    <div class='infos-doctorant' style=''>
    Présentée et soutenue par <br/>
        <p>
            Présentée et soutenue par<br>
            <span class="gras">
                <?php if ($informations->getDoctorant() !== null): ?>
                    <?php echo $informations->getDoctorant(); ?>
                <?php else: ?>
                    <span style='background-color:red;'> Aucun doctorant </span>
                <?php endif; ?>
            </span>
        </p>
    </div>

<!-- SECTION JURY ----------------------------------------------------------------------------------------------------->

<table class='jury'>
    <tr>
        <th colspan='3'>
    <div class="infos-soutenance">
        <p>
            <span class="gras">
                Thèse
                <?php if ($informations->getDateFinConfidentialite()) : ?>
                à caractère confidentiel
                    <em>à caractère confidentiel</em>
                <?php endif; ?>
                soutenue le
                <?php if ($informations->getDate() !== null): ?>
@@ -137,45 +113,39 @@ use Application\View\Renderer\PhpRenderer;
                <?php else: ?>
                    <span style='background-color:red;'> Aucune date </span>
                <?php endif; ?>
            <br/>
            devant le jury composé de
        </th>
    </tr>
            </span> <br>
            devant le jury composé de :
        </p>
    </div>

    <table class="jury">
        <?php foreach ($informations->getActeursEnCouverture() as $acteur) : ?>
            <tr>
            <td> <?php echo $acteur->getDenomination(); ?> </td>
            <td> <?php echo trim($acteur->getQualite()); ?>,  <?php echo $acteur->getEtablissement(); ?></td>
            <td> <?php echo $acteur->getRole(); ?> </td>
                <td class="individu"> <?php echo $acteur->getDenomination(); ?> </td>
                <td class="qualite"> <?php echo trim($acteur->getQualite()); ?> - <?php echo $acteur->getEtablissement(); ?></td>
                <td class="role"> <?php echo $acteur->getRole(); ?> </td>
            </tr>
        <?php endforeach; ?>

    </table>


<!-- SECTION ENCADREMENT ---------------------------------------------------------------------------------------------->
<div class='infos-encadrement'>
    <p class='infos-encadrement'>
        Thèse dirigée par
    <?php if ($informations->getListing()): ?>
        <?php echo $informations->getListing() ?>
        <?php if ($listing = $informations->getDirection()): ?>
            <?php $acteurFormatter = fn($row) => '<span class="gras">' . $row['individu'] . '</span>' .
                (($str = ($row['structure'] ?? null)) ? " ($str)" : null); ?>
            <?php echo implode(' et ', array_map($acteurFormatter, $listing)); ?>
        <?php else : ?>
            <span style='background-color:red;'> non renseigné </span>
        <?php endif; ?>
<!--    --><?php //if ($informations->getUniteRecherche()): ?>
<!--        --><?php //echo $informations->getUniteRecherche() ?>
<!--    --><?php //else : ?>
<!--        <span style='background-color:red;'> non renseigné </span>-->
<!--    --><?php //endif; ?>
</div>
    </p>

<!-- SECTION DES LOGOS EN BAS DE PAGE --------------------------------------------------------------------------------->
<div class="logos">
<table style="border:none;" class="logos">
    <div class="footer">
        <table class="logos footer">
            <tr>
                <?php if ($informations->isAssocie()): ?>
                    <td>
                        <?php if ($informations->getLogoAssocie()): ?>
                    <img class="logo_small" src="<?php echo $informations->getLogoAssocie() ?>"/>
                            <img class="logo_small" src="<?php echo $informations->getLogoAssocie() ?>" alt="Logo établissement associé"/>
                        <?php else: ?>
                            <span style='background-color:red;'> Établissement associé ou logo d'établissement non renseigné. </span>
                        <?php endif; ?>
@@ -183,14 +153,14 @@ use Application\View\Renderer\PhpRenderer;
                <?php endif; ?>
                <td>
                    <?php if ($informations->getLogoEcoleDoctorale()): ?>
                <img class="logo_small" src="<?php echo $informations->getLogoEcoleDoctorale() ?>"/>
                        <img class="logo_small" src="<?php echo $informations->getLogoEcoleDoctorale() ?>" alt="Logo école doctorale"/>
                    <?php else: ?>
                        <span style='background-color:red;'> École doctorale ou logo d'école doctorale non renseigné </span>
                    <?php endif; ?>
                </td>
                <td>
                    <?php if ($informations->getLogoUniteRecherche()): ?>
                <img class="logo_small" src="<?php echo $informations->getLogoUniteRecherche() ?>"/>
                        <img class="logo_small" src="<?php echo $informations->getLogoUniteRecherche() ?>" alt="Logo unité de recherche"/>
                    <?php else: ?>
                        <span style='background-color:red;'> Unité de recherche ou logo d'unité de recherche non renseigné </span>
                    <?php endif; ?>
@@ -198,3 +168,22 @@ use Application\View\Renderer\PhpRenderer;
            </tr>
        </table>
    </div>

</html>


<?php
/**
 * Détermine l'article défini adapté au libellé d'un établissement.
 *
 * @param string|\Structure\Entity\Db\Etablissement $etablissement
 * @return string Ex : "l'"pour l'établissement "Université de Tataouine".
 */
function computeArticleDefiniForEtablissement(string|Etablissement $etablissement): string
{
    $etabToString = (string) $etablissement;
    $articlesForLetters = ['a' => "l'", 'e' => "l'", 'i' => "l'", 'o' => "l'", 'u' => "l'", 'y' => "l'"];

    return $articlesForLetters[mb_strtolower($etabToString[0])] ?? '';
}
?>
 No newline at end of file
+5 −12
Original line number Diff line number Diff line
@@ -63,8 +63,7 @@ class PdcData
    /** @var string */
    private $logoUniteRecherche;

    /** @var string */
    private $listing;
    private array $listingDirection = [];
    /** @var string */
    private $uniteRecherche;
    /** @var string */
@@ -511,20 +510,14 @@ class PdcData
        return $this;
    }

    /**
     * @return string
     */
    public function getListing()
    public function getDirection(): array
    {
        return $this->listing;
        return $this->listingDirection;
    }

    /**
     * @param string $listing
     */
    public function setListing($listing)
    public function setListingDirection(array $listing): void
    {
        $this->listing = $listing;
        $this->listingDirection = $listing;
    }

    public function getWarnings() {
+8 −8
Original line number Diff line number Diff line
@@ -83,8 +83,8 @@ class TheseService extends BaseService //implements ListenerAggregateInterface
        }

        /** informations générales */
        $titre = $these->getTitre();
        $titre = str_replace("\n","<br/>", $titre);
        $titre = trim($these->getTitre());
        $titre = str_replace("\n",' ', $titre);
        $pdcData->setTitre($titre);
        $pdcData->setSpecialite($these->getLibelleDiscipline());
        if ($these->getEtablissement()) {
@@ -234,20 +234,20 @@ class TheseService extends BaseService //implements ListenerAggregateInterface
        }

        /** Directeurs de thèses */
        $nomination = [];
        $listing = [];
        foreach ($directeurs as $directeur) {
            $current = mb_strtoupper($directeur->getIndividu()->getNomComplet(false, false, false, true));
            $structure = ($these->getUniteRecherche())?:$directeur->getIndividu()->getUniteRecherche()?:$directeur->getIndividu()->getEtablissement();
            if ($structure !== null) $current .= " (". $structure->getStructure()->getLibelle() .")";
            $nomination[] = $current;
            if ($structure !== null) $structure = $structure->getStructure()->getLibelle();
            $listing[] = ['individu' => $current, 'structure' => $structure];
        }
        foreach ($codirecteurs as $directeur) {
            $current = mb_strtoupper($directeur->getIndividu()->getNomComplet(false, false, false, true));
            $structure = ($directeur->getIndividu()->getUniteRecherche())?:$directeur->getIndividu()->getEtablissement();
            if ($structure !== null) $current .= " (". $structure->getStructure()->getLibelle() .")";
            $nomination[] = $current;
            if ($structure !== null) $structure = $structure->getStructure()->getLibelle();
            $listing[] = ['individu' => $current, 'structure' => $structure];
        }
        $pdcData->setListing(implode(" et ", $nomination));
        $pdcData->setListingDirection($listing);
        if ($these->getUniteRecherche()) $pdcData->setUniteRecherche($these->getUniteRecherche()->getStructure()->getLibelle());
        if ($these->getEcoleDoctorale()) $pdcData->setEcoleDoctorale($these->getEcoleDoctorale()->getStructure()->getLibelle());