Commit ef5647ac authored by Thomas Hamel's avatar Thomas Hamel
Browse files

première version export portfolio

parent 7e78187d
Loading
Loading
Loading
Loading
+213 −3
Original line number Diff line number Diff line
@@ -301,12 +301,222 @@ SELECT nextval('categorie_privilege_id_seq'),

INSERT INTO public.unicaen_privilege_privilege (categorie_id, code, libelle, ordre)
VALUES ((SELECT id FROM unicaen_privilege_categorie WHERE code = 'portfolio'), 'afficher', 'Afficher le portfolio', 1);
INSERT INTO public.unicaen_privilege_privilege (categorie_id, code, libelle, ordre)
VALUES ((SELECT id FROM unicaen_privilege_categorie WHERE code = 'portfolio'), 'exporter', 'Exporter le portfolio au format PDF', 2);

select privilege__grant_privileges_to_profiles('portfolio',
                                               ARRAY['afficher'],
                                               ARRAY['afficher', 'exporter'],
                                               ARRAY['ADMIN_TECH', 'DOCTORANT']
);


-- Ajout de l'id HAL pour un doctorant
alter table individu add id_hal varchar(200);

INSERT INTO unicaen_renderer_template (code, description, document_type, document_sujet, document_corps, document_css, namespace, engine)
VALUES (
           'PORTFOLIO_EXPORT',
           'Export PDF du portfolio',
           'pdf',
           'Portfolio',
           '<div style="text-align: center; margin-bottom: 30px;">
    <h1>Portfolio <br>{{ these.doctorant.individu.nomPatronymique|upper }} {{ these.doctorant.individu.prenom }}</h1>

    {% if comue %}
        <img src="{{ UrlFichier.getLogoEtablissementComue }}" height="3cm" max-width="5cm" alt="Logo de Normandie Université"/>
    {% endif %}
    <img src="{{ UrlFichier.getLogoEtablissementInscr }}" height="3cm" max-width="5cm" alt="Logo de l''établissement d''inscription"/>
</div>

<div class="informations_these">
    <h1>Thèse</h1>
<strong>Titre :</strong> {{these.titre}} <br>
<strong> Discipline :</strong>  {{these.getLibelleDiscipline}} <br>
<strong> Établissement d''inscription :</strong> {{these.etablissement.libelle}} <br>
<strong> Unité de recherche :</strong> {{these.uniteRecherche.libelle}} <br>
<strong> École doctorale :</strong> {{these.ecoleDoctorale.libelle}} <br>
<strong> Direction de thèse :</strong> {{these.toStringEncadrement}} <br>
</div>

<div class="informations_doctorant">
 <h1>Doctorant</h1>
<strong>Nom prénom :</strong> {{ these.doctorant.getDenominationPatronymique }} <br>
<strong>Nationalité :</strong> {{ these.doctorant.getNationalite?: "<i>(Aucun nationalité)</i>" }} <br>
<strong>Numéro étudiant :</strong> {{ these.doctorant.getSupannId ?: "<i>(Aucun Numéro étudiant)</i>" }} <br>
<strong>ORCID :</strong> {{ these.doctorant.getORCID ?: "<i>(Aucun ORCID)</i>" }} <br>
<strong>IdHAL :</strong> {{ these.doctorant.getIdHal ?: "<i>(Aucun IdHAL)</i>" }} <br>
<strong>Adresse électronique institutionnelle :</strong> {{ these.doctorant.individu.getEmailPro ?: "<i>(Aucun adresse électronique renseignée)</i>" }} <br>
</div>

<div style="page-break-before: always;"></div>

<div class="informations_formations">
 <h1>Formations</h1>
 <h2>Formations suivies dans ESUP-SyGAL</h2>
<table class="table table-sm inscriptions-terminees mt-2">
    <thead>
    <tr>
        <th>Formation</th>
        <th>Date de début</th>
        <th>Date de fin</th>
        <th>Durée</th>
        <th>Type</th>
        <th>Compétences RNCP</th>
    </tr>
    </thead>

    <tbody>
    {% set inscriptionsTerminees = doctorant.getInscriptionsTerminees %}
    {% for inscriptionTer in inscriptionsTerminees %}
    {% set inscriptionTerminee = inscriptionTer.inscription %}
    {% set session = inscriptionTerminee.session %}
    {% set formation = session.formation %}

    <tr>
        <td>{{ formation.libelle }}</td>

        <td>
            {{ session.getDateDebut ? session.getDateDebut|date(''d/m/Y'') : '''' }}
        </td>

        <td>
            {{ session.getDateFin ? session.getDateFin|date(''d/m/Y'') : '''' }}
        </td>

        <td>{{ session.getDuree }} h</td>

        <td>
{% if session.type == constant(''Formation\\Entity\\Db\\Interfaces\\HasTypeInterface::TYPE_TRANSVERSALE'') %}
        Transversale
    {% elseif session.type == constant(''Formation\\Entity\\Db\\Interfaces\\HasTypeInterface::TYPE_SPECIFIQUE'') %}
        Spécifique
    {% else %}
        {{ session.type }}
    {% endif %}
</td>

        <td>
            {% if inscriptionTer.sousCompetences is defined and inscriptionTer.sousCompetences %}
            <ul class="mb-0">
                {% for scAvecBloc in inscriptionTer.sousCompetences %}
                <li>
                    <strong>
                        {{ scAvecBloc.blocCompetence.code }} — {{ scAvecBloc.blocCompetence.intitule }}
                    </strong>

                    {% if scAvecBloc.sousCompetences %}
                    <ul>
                        {% for sc in scAvecBloc.sousCompetences %}
                        <li>{{ sc.code }} — {{ sc.intitule }}</li>
                        {% endfor %}
                    </ul>
                    {% endif %}
                </li>
                {% endfor %}
            </ul>
            {% else %}
            <em>Aucune sous-compétence</em>
            {% endif %}
        </td>
    </tr>
    {% else %}
    <tr>
        <td colspan="7" class="text-muted text-center">
            Aucune formation trouvée
        </td>
    </tr>
    {% endfor %}
    </tbody>
</table>

<div style="page-break-before: always;"></div>

 <h2>Formations suivies à l''extérieur</h2>
<table class="table table-sm formations-externes mt-2">
    <thead>
        <tr>
            <th>Formation</th>
            <th>Date de début</th>
            <th>Date de fin</th>
            <th>Durée</th>
            <th>Type</th>
            <th>Compétences RNCP</th>
        </tr>
    </thead>

    <tbody>
{% set formationsExternes = doctorant.getFormationsExternes %}
        {% for formationEx in formationsExternes %}
            {% set formationExterne = formationEx.formationExterne %}

            <tr>
                <td>{{ formationExterne.libelle }}</td>

                <td>
                    {{ formationExterne.debut ? formationExterne.debut|date(''d/m/Y'') : '''' }}
                </td>

                <td>
                    {{ formationExterne.fin ? formationExterne.fin|date(''d/m/Y'') : '''' }}
                </td>

                <td>{{ formationExterne.duree }} h</td>

                <td>
{% if formationExterne.type == constant(''Formation\\Entity\\Db\\Interfaces\\HasTypeInterface::TYPE_TRANSVERSALE'') %}
        Transversale
    {% elseif formationExterne.type == constant(''Formation\\Entity\\Db\\Interfaces\\HasTypeInterface::TYPE_SPECIFIQUE'') %}
        Spécifique
    {% else %}
        {{ formationExterne.type }}
    {% endif %}
</td>

                <td>
            {% if formationEx.sousCompetences is defined and formationEx.sousCompetences %}
            <ul class="mb-0">
                {% for scAvecBloc in formationEx.sousCompetences %}
                <li>
                    <strong>
                        {{ scAvecBloc.blocCompetence.code }} — {{ scAvecBloc.blocCompetence.intitule }}
                    </strong>

                    {% if scAvecBloc.sousCompetences %}
                    <ul>
                        {% for sc in scAvecBloc.sousCompetences %}
                        <li>{{ sc.code }} — {{ sc.intitule }}</li>
                        {% endfor %}
                    </ul>
</br>
                    {% endif %}
                </li>
                {% endfor %}
            </ul>
            {% else %}
            <em>Aucune sous-compétence</em>
            {% endif %}
        </td>
            </tr>
        {% else %}
            <tr>
                <td colspan="7" class="text-muted text-center">
                    Aucune formation externe
                </td>
            </tr>
        {% endfor %}
    </tbody>
</table>
</div>',
           '.formations-externes, .inscriptions-terminees {
 border-collapse: collapse;  width: 100%; 
 }

.formations-externes th,
.formations-externes td,
.inscriptions-terminees th,
.inscriptions-terminees td {
  border: 1px solid #000;
  padding: 8px;
}',
           'Portfolio\Provider\Template',
        'twig'
       );
 No newline at end of file
+0 −1
Original line number Diff line number Diff line
@@ -15,5 +15,4 @@ trait RecapitulatifExporterAwareTrait {
    {
        $this->recapitulatifExporter = $recapitulatifExporter;
    }

}
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ class TableauDeBordDoctorantFacade
            if (
                $inscription->estNonHistorise() &&
                $session &&
                !in_array($session->getEtat()->getCode(), [Etat::CODE_CLOTURER, Etat::CODE_ANNULEE], true)
                !in_array($session->getEtat()->getCode(), [Etat::CODE_CLOTUREE, Etat::CODE_ANNULEE], true)
            ) {
                $seances = array_filter($session->getSeances()->toArray(), fn($s) => $s->estNonHistorise());
                if (count($seances) > 0) {
+65 −1
Original line number Diff line number Diff line
@@ -14,11 +14,27 @@ use Individu\Renderer\IndividuTemplateVariable;
 */
class DoctorantTemplateVariable extends AbstractTemplateVariable
{
    private array $formationsExternes = [];
    private array $inscriptionsTerminees = [];

    public function setDoctorant(Doctorant $doctorant): void
    {
        $this->setTarget($doctorant);
    }

    public function setFormationsExternes(array $formationsExternes): void
    {
        $this->formationsExternes = $formationsExternes;
    }

    /**
     * @param array $inscriptionsTerminees
     */
    public function setInscriptionsTerminees(array $inscriptionsTerminees): void
    {
        $this->inscriptionsTerminees = $inscriptionsTerminees;
    }

    /**
     * Pas vraiment utile de recréer la méthode __toString() ici puisqu'elle existe et a sa raison d'être
     * dans la classe d'entité, mais c'est pour l'exemple !
@@ -57,11 +73,43 @@ class DoctorantTemplateVariable extends AbstractTemplateVariable
    /**
     * @noinspection
     */
    public function getCivilite(): string
    public function getCivilite(): ?string
    {
        return $this->target->getIndividu()->getCivilite();
    }

    /**
     * @noinspection
     */
    public function getNationalite(): ?string
    {
        return $this->target->getIndividu()->getPaysNationalite()->getLibelleNationalite();
    }

    /**
     * @noinspection
     */
    public function getNumeroEtudiant(): string
    {
        return $this->target->getIndividu()->getSupannId();
    }

    /**
     * @noinspection
     */
    public function getORCID(): ?string
    {
        return $this->target->getIndividu()->getOrcid();
    }

    /**
     * @noinspection
     */
    public function getIdHal(): ?string
    {
        return $this->target->getIndividu()->getIdHal();
    }

    /**
     * Retourne la dénomination du doctorant (civilité+nom Patronymique+prénom)
     *
@@ -80,4 +128,20 @@ class DoctorantTemplateVariable extends AbstractTemplateVariable

        return $templateVariable;
    }

    /**
     * @noinspection PhpUnused (il s'agit d'une méthode utilisée par les macros)
     */
    public function getFormationsExternes(): array
    {
        return $this->formationsExternes;
    }

    /**
     * @noinspection PhpUnused (il s'agit d'une méthode utilisée par les macros)
     */
    public function getInscriptionsTerminees(): array
    {
        return $this->inscriptionsTerminees;
    }
}
+12 −1
Original line number Diff line number Diff line
@@ -170,3 +170,14 @@ $modifierGeneralitesEvent = 'event-modifier-generalites';
        <?php endif; ?>
    </li>
</ul>

<script>
    $(function () {
        var body = $("body");

        body.on("modification-doctorant", function (event) {
            event.div.modal('hide');
            window.location.reload();
        });
    });
</script>
Loading