Commit 7c009c9d authored by Thomas Hamel's avatar Thomas Hamel
Browse files

affichage du nom patronymique sur attestation/émargement d'une formation (chgt...

affichage du nom patronymique sur attestation/émargement d'une formation (chgt dans NomCompletFormatter), update template attestation
parent e7f749e6
Loading
Loading
Loading
Loading
+14 −3
Changes for doc/release-notes/8.2.0/01_formation.sql: 14 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -63,12 +63,23 @@ from PROFIL_TO_ROLE p2r
where not exists (select * from role_privilege where role_id = p2r.role_id and privilege_id = pp.privilege_id)
;

--Ajout d'une macro pour afficher la dénomination du doctorant (civilité+nom Patronymique+prénom)
INSERT INTO unicaen_renderer_macro (code, description, variable_name, methode_name)
VALUES ('Doctorant#DenominationPatronymique',
        '<p>Retourne la dénomination du doctorant (civilité+nom Patronymique+prénom)</p>',
        'doctorant', 'getDenominationPatronymique')
    ON CONFLICT DO NOTHING;

--Changement en conséquence du template
UPDATE public.unicaen_renderer_template SET document_corps = '<h1 style="text-align: center;">Attestation de suivi de formation</h1><p></p><p>Bonjour ,</p><p>Je, sousigné·e, certifie que <strong>VAR[Doctorant#DenominationPatronymique]</strong> a participé à la formation <strong>VAR[Formation#Libelle]</strong> qui s''est déroulée sur la période du VAR[Session#Periode] (Durée : VAR[Session#Duree] heures).</p><p>VAR[Doctorant#DenominationPatronymique] a suivi VAR[Inscription#DureeSuivie] heure·s de formation.</p><p style="text-align: right;">Le·la responsable du module<br />VAR[Session#Responsable]<br /><br /></p><p style="text-align: right;">VAR[Signature#EtablissementFormation]</p>'
where code = 'FORMATION_ATTESTATION';

-- Template mail lors de la création d'une formation spécifique à destination des doctorants de l'ED
INSERT INTO public.unicaen_renderer_template (code, description, document_type, document_sujet, document_corps,
                                              document_css, namespace)
VALUES ('FORMATION_FORMATION_SPECIFIQUE_OUVERTE',
        '<p>Mail envoyé au doctorant·e lorsqu''une formation spécifique est ouverte au sein de leur ED</p>', 'mail',
        '<p>Mail envoyé au doctorant·e appartenant aux structures valides déclarées lorsqu''une formation spécifique passe à l''état Inscription ouverte</p>', 'mail',
        'Nouvelle formation spécifique ouverte dans votre ED', e'<p>Bonjour,</p>
<p>La formation spécifique <strong>VAR[Formation#Libelle]</strong> vient d\'ouvrir. Si vous voulez plus d\'informations, rendez-vous dans l\'application ESUP-SyGAL, onglet <em>\'mes formations\'.</em></p>
<p>La formation spécifique <strong>VAR[Formation#Libelle]</strong> vient d''ouvrir. Si vous voulez plus d''informations, rendez-vous dans l''application ESUP-SyGAL, onglet <em>''mes formations''.</em></p>
<p>En vous souhaitant une bonne journée,<br/>VAR[Formation#Responsable]</p>',
        null, 'Formation\Provider\Template');
 No newline at end of file
        null, 'Formation\Provider\Template') ON CONFLICT DO NOTHING;
 No newline at end of file
+17 −7
Changes for module/Application/src/Application/Filter/NomCompletFormatter.php: 17 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -17,31 +17,35 @@ class NomCompletFormatter extends AbstractFilter
{
    protected bool $nomEnMajuscule = true;
    protected bool $avecCivilite   = false;
    protected bool $avecNomPatro   = false;
    protected bool $avecNomUsuelEtPatro   = false;
    protected bool $prenomDabord   = false;
    protected bool $tousLesPrenoms = false;
    protected bool $avecNomPatroSeul = false;

    /**
     * Constructeur.
     *
     * @param bool $nomEnMajuscule
     * @param bool $avecCivilite
     * @param bool $avecNomPatro
     * @param bool $avecNomUsuelEtPatro
     * @param bool $prenomDabord
     * @param bool $tousLesPrenoms
     * @param bool $avecNomPatroSeul
     */
    public function __construct(
        bool $nomEnMajuscule = true,
        bool $avecCivilite = false,
        bool $avecNomPatro = false,
        bool $avecNomUsuelEtPatro = false,
        bool $prenomDabord = false,
        bool $tousLesPrenoms = false)
        bool $tousLesPrenoms = false,
        bool $avecNomPatroSeul = false)
    {
        $this->nomEnMajuscule       = $nomEnMajuscule;
        $this->avecCivilite         = $avecCivilite;
        $this->avecNomPatro         = $avecNomPatro;
        $this->avecNomUsuelEtPatro         = $avecNomUsuelEtPatro;
        $this->prenomDabord = $prenomDabord;
        $this->tousLesPrenoms = $tousLesPrenoms;
        $this->avecNomPatroSeul = $avecNomPatroSeul;
    }

    /**
@@ -113,14 +117,20 @@ class NomCompletFormatter extends AbstractFilter
        $nomPatro = ucfirst($this->nomEnMajuscule ? mb_strtoupper($nomPatro) : $nomPatro);
        $civilite = $this->avecCivilite ? $civilite : null;

        if ($this->avecNomPatroSeul) {
            $nomComplet = $this->prenomDabord ? "$prenom $nomPatro" : "$nomPatro $prenom";
        }else{
            $nomComplet = $this->prenomDabord ? "$prenom $nomUsuel" : "$nomUsuel $prenom";
        }

        $parts = [
            $civilite,
            $this->prenomDabord ? "$prenom $nomUsuel" : "$nomUsuel $prenom",
            $nomComplet
        ];

        $result = implode(' ', array_filter($parts));

        if ($this->avecNomPatro && $nomPatro !== $nomUsuel) {
        if ($this->avecNomUsuelEtPatro && !$this->avecNomPatroSeul &&$nomPatro !== $nomUsuel) {
            $result .= ", né·e $nomPatro";
        }

+11 −0
Changes for module/Doctorant/src/Doctorant/Entity/Db/Doctorant.php: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -419,4 +419,15 @@ class Doctorant implements
        return false;
    }

    /**
     * Retourne la dénomination du doctorant (civilité+nom Patronymique+prénom)
     *
     * @return string
     * @noinspection PhpUnusedMethod (il s'agit d'une méthode utilisée par les macros)
     */
    public function getDenominationPatronymique()
    {
        return $this->getIndividu()->getNomComplet(true, false, false, false, true);
    }

}
+3 −3
Changes for module/Formation/src/Formation/Service/Exporter/Emargement/emargement.phtml: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ use Formation\Entity\Db\Seance;
$session = $seance->getSession();
$annee = $session->getAnneeScolaire();
$inscriptions = $session->getListePrincipale();
usort($inscriptions, function(Inscription $a, Inscription $b) { return $a->getDoctorant()->getIndividu()->getNomComplet() > $b->getDoctorant()->getIndividu()->getNomComplet();});
usort($inscriptions, function(Inscription $a, Inscription $b) { return $a->getDoctorant()->getIndividu()->getNomComplet(false, false, false, false, true) > $b->getDoctorant()->getIndividu()->getNomComplet(false, false, false, false, true);});

$libelle = $session->getFormation()->getLibelle();
/** @var Formateur[] $formateurs */
@@ -42,7 +42,7 @@ $formateurs = $session->getFormateurs();
            <ul>
                <?php foreach ($formateurs as $formateur) : ?>
                    <li>
                        <?php echo $formateur->getIndividu()->getNomComplet(); ?>
                        <?php echo $formateur->getIndividu()->getNomComplet(false, false, false, false, true); ?>
                    </li>
                <?php endforeach; ?>
            </ul>
@@ -76,7 +76,7 @@ $formateurs = $session->getFormateurs();
        ?>
        <tr>
            <td>
                <strong> <?php echo $inscription->getDoctorant()->getIndividu()->getNomComplet(); ?> </strong>
                <strong> <?php echo $inscription->getDoctorant()->getIndividu()->getNomComplet(false, false, false, false, true); ?> </strong>
                <br/>
                D<?php echo implode(", ",$anneets); ?>
                -
+6 −4
Changes for module/Individu/src/Individu/Entity/Db/Individu.php: 6 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -555,18 +555,20 @@ class Individu implements
     * Get nomUsuel
     *
     * @param bool $avecCivilite
     * @param bool $avecNomPatro
     * @param bool $avecNomUsuelEtPatro
     * @param bool $prenoms
     * @param bool $prenomfirst
     * @param bool $avecNomPatroSeul
     * @return string
     */
    public function getNomComplet(
        bool $avecCivilite = false,
        bool $avecNomPatro = false,
        bool $avecNomUsuelEtPatro = false,
        bool $prenoms = false,
        bool $prenomfirst = false): string
        bool $prenomfirst = false,
        bool $avecNomPatroSeul = false): string
    {
        $f = new NomCompletFormatter(true, $avecCivilite, $avecNomPatro, $prenomfirst, $prenoms);
        $f = new NomCompletFormatter(true, $avecCivilite, $avecNomUsuelEtPatro, $prenomfirst, $prenoms, $avecNomPatroSeul);

        return $f->filter($this);
    }