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

Possibilité d'ajouter les formulaires nécessaires pour la soutenance HDR...

Possibilité d'ajouter les formulaires nécessaires pour la soutenance HDR depuis la fiche d'un établissement
parent 554f1bb8
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
INSERT INTO NATURE_FICHIER (ID, CODE, LIBELLE) VALUES (nextval('nature_fichier_id_seq'), 'DELOCALISATION_SOUTENANCE_HDR', 'Formulaire de délocalisation de soutenance HDR');
INSERT INTO NATURE_FICHIER (ID, CODE, LIBELLE) VALUES (nextval('nature_fichier_id_seq'),'DELEGATION_SIGNATURE_HDR', 'Formulaire de délégation de signature du rapport de soutenance (visioconférence) pour une HDR');
INSERT INTO NATURE_FICHIER (ID, code, libelle) VALUES (nextval('nature_fichier_id_seq'),'DEMANDE_CONFIDENT_HDR', 'Formulaire de demande de confidentialité pour une HDR');
INSERT INTO NATURE_FICHIER (ID, code, libelle) VALUES (nextval('nature_fichier_id_seq'),'DEMANDE_LANGUE_ANGLAISE_HDR', 'Formulaire d''utilisation de la langue anglaise pour une HDR');
+11 −0
Original line number Diff line number Diff line
@@ -83,6 +83,17 @@ class NatureFichier

    const CODE_ADMISSION_ATTESTATION_RESPONSABILITE_CIVILE = "ADMISSION_ATTESTATION_RESPONSABILITE_CIVILE";

    //HDR
    const CODE_DELOCALISATION_SOUTENANCE_HDR = 'DELOCALISATION_SOUTENANCE_HDR';
    const CODE_DELEGATION_SIGNATURE_HDR = 'DELEGATION_SIGNATURE_HDR';
    const CODE_DEMANDE_CONFIDENT_HDR = 'DEMANDE_CONFIDENT_HDR';
    const CODE_LANGUE_ANGLAISE_HDR = 'DEMANDE_LANGUE_ANGLAISE_HDR';
    const LABEL_DEMANDE_CONFIDENT_HDR = "Formulaire de demande de confidentialité pour une HDR";
    const LABEL_DELOCALISATION_SOUTENANCE_HDR = "Formulaire de délocalisation de soutenance HDR";
    const LABEL_DELEGUATION_SIGNATURE_HDR = "Formulaire de délégation de signature du rapport de soutenance (visioconférence) pour une HDR";
    const LABEL_LANGUE_ANGLAISE_HDR = "Formulaire d'utilisation de la langue anglaise pour une HDR";


    /**
     * @var string
     */
+8 −12
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ use Application\Entity\Db\Utilisateur;
use Application\Service\Role\ApplicationRoleServiceAwareTrait;
use Application\Service\UserContextServiceAwareTrait;
use Exception;
use Fichier\Entity\Db\NatureFichier;
use HDR\Entity\Db\HDR;
use HDR\Service\HDRService;
use Individu\Entity\Db\Individu;
@@ -29,6 +30,7 @@ use Soutenance\Service\Justificatif\JustificatifServiceAwareTrait;
use Soutenance\Service\Proposition\PropositionHDR\PropositionHDRService;
use Soutenance\Service\SignaturePresident\SignaturePresidentPdfExporter;
use Soutenance\Service\Validation\ValidationHDR\ValidationHDRServiceAwareTrait;
use Structure\Service\StructureDocument\StructureDocumentServiceAwareTrait;
use Throwable;
use UnicaenApp\Exception\RuntimeException;
use Validation\Entity\Db\ValidationHDR;
@@ -143,16 +145,11 @@ class PropositionHDRController extends PropositionController
//        }
        if (empty($emailsAspectDoctorats)) $informationsOk = false;

        /** Paramètres ---------------------------------------------------------------------------------------------- */

        try {
            $FORMULAIRE_DELOCALISATION = $this->getParametreService()->getValeurForParametre(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DOC_DELOCALISATION);
            $FORMULAIRE_DELEGUATION = $this->getParametreService()->getValeurForParametre(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DOC_DELEGATION_SIGNATURE);
            $FORMULAIRE_DEMANDE_ANGLAIS = $this->getParametreService()->getValeurForParametre(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DOC_REDACTION_ANGLAIS);
            $FORMULAIRE_DEMANDE_CONFIDENTIALITE = $this->getParametreService()->getValeurForParametre(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DOC_CONFIDENTIALITE);
        } catch (Exception $e) {
            throw new RuntimeException("Une erreur est survenue lors de la récupération de paramètre.",0,$e);
        }
        /** Formulaires associés à la proposition ---------------------------------------------------------------------------------------------- */
        $FORMULAIRE_DELOCALISATION = $this->propositionService->findUrlFormulaireFichierByEtabAndNatureFichierCode($this->entity, NatureFichier::CODE_DELOCALISATION_SOUTENANCE_HDR, $this->urlFichierHDR());
        $FORMULAIRE_DELEGATION = $this->propositionService->findUrlFormulaireFichierByEtabAndNatureFichierCode($this->entity, NatureFichier::CODE_DELEGATION_SIGNATURE_HDR, $this->urlFichierHDR());
        $FORMULAIRE_DEMANDE_CONFIDENTIALITE = $this->propositionService->findUrlFormulaireFichierByEtabAndNatureFichierCode($this->entity, NatureFichier::CODE_DEMANDE_CONFIDENT_HDR, $this->urlFichierHDR());
        $FORMULAIRE_DEMANDE_ANGLAIS = $this->propositionService->findUrlFormulaireFichierByEtabAndNatureFichierCode($this->entity, NatureFichier::CODE_LANGUE_ANGLAISE_HDR, $this->urlFichierHDR());

        $vm = new ViewModel();
        $vm->setTemplate('soutenance/proposition-hdr/proposition');
@@ -178,10 +175,9 @@ class PropositionHDRController extends PropositionController
            'informationsOk' => $informationsOk,
            'avis' => $this->getAvisService()->getAvisByProposition($this->proposition),
            'FORMULAIRE_DELOCALISATION' => $FORMULAIRE_DELOCALISATION,
            'FORMULAIRE_DELEGUATION' => $FORMULAIRE_DELEGUATION,
            'FORMULAIRE_DELEGATION' => $FORMULAIRE_DELEGATION,
            'FORMULAIRE_DEMANDE_ANGLAIS' => $FORMULAIRE_DEMANDE_ANGLAIS,
            'FORMULAIRE_DEMANDE_CONFIDENTIALITE' => $FORMULAIRE_DEMANDE_CONFIDENTIALITE,

        ]);
        return $vm;
    }
+5 −2
Original line number Diff line number Diff line
@@ -56,7 +56,10 @@ class InterventionController extends AbstractSoutenanceController
            $membres[$membre->getId()] = $membre;
        }

        $categorieCode = ($this->proposition instanceof PropositionThese) ? SoutenanceParametres::CATEGORIE : \Soutenance\Provider\Parametre\HDR\SoutenanceParametres::CATEGORIE;
        $FORMULAIRE_DELEGATION = $this->proposition instanceof PropositionThese ?
            $this->getParametreService()->getValeurForParametre(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DOC_DELEGATION_SIGNATURE) :
            $this->propositionService->findUrlFormulaireFichierByEtabAndNatureFichierCode($this->entity, NatureFichier::CODE_DELEGATION_SIGNATURE_HDR, $this->urlFichierHDR());

        return new ViewModel([
            'object' => $this->entity,
            'distanciel' => (!empty($distanciels)) ? current($distanciels) : null,
@@ -65,7 +68,7 @@ class InterventionController extends AbstractSoutenanceController
            'membres' => $membres,
            'justificatifs' => $justificatifs,
            'urlFichier' => $this->type === Proposition::ROUTE_PARAM_PROPOSITION_THESE ? $this->urlFichierThese(): $this->urlFichierHDR(),
            'FORMULAIRE_DELEGUATION' => $this->getParametreService()->getValeurForParametre($categorieCode, SoutenanceParametres::DOC_DELEGATION_SIGNATURE),
            'FORMULAIRE_DELEGATION' => $FORMULAIRE_DELEGATION,
            'typeProposition' => $this->type,
        ]);
    }
+24 −6
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ namespace Soutenance\Controller;

use Depot\Service\FichierHDR\FichierHDRServiceAwareTrait;
use Depot\Service\FichierThese\FichierTheseServiceAwareTrait;
use Exception;
use Fichier\Entity\Db\Fichier;
use Fichier\Entity\Db\NatureFichier;
use Fichier\Entity\Db\VersionFichier;
@@ -15,6 +16,8 @@ use Soutenance\Form\Justificatif\JustificatifFormAwareTrait;
use Soutenance\Provider\Parametre\These\SoutenanceParametres;
use Soutenance\Service\Justificatif\JustificatifServiceAwareTrait;
use Soutenance\Service\Membre\MembreServiceAwareTrait;
use Structure\Service\StructureDocument\StructureDocumentServiceAwareTrait;
use UnicaenApp\Exception\RuntimeException;
use UnicaenParametre\Service\Parametre\ParametreServiceAwareTrait;

class JustificatifController extends AbstractSoutenanceController
@@ -122,19 +125,34 @@ class JustificatifController extends AbstractSoutenanceController
        }

        $justificatifs = $this->getJustificatifService()->generateListeJustificatif($this->proposition);
        $categorieCode = ($this->proposition instanceof PropositionThese) ? SoutenanceParametres::CATEGORIE : \Soutenance\Provider\Parametre\HDR\SoutenanceParametres::CATEGORIE;

        if($this->proposition instanceof PropositionThese){
            try {
                $FORMULAIRE_DELOCALISATION = $this->getParametreService()->getValeurForParametre(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DOC_DELOCALISATION);
                $FORMULAIRE_DELEGATION = $this->getParametreService()->getValeurForParametre(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DOC_DELEGATION_SIGNATURE);
                $FORMULAIRE_DEMANDE_LABEL = $this->getParametreService()->getValeurForParametre(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DOC_LABEL_EUROPEEN);
                $FORMULAIRE_DEMANDE_ANGLAIS = $this->getParametreService()->getValeurForParametre(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DOC_REDACTION_ANGLAIS);
                $FORMULAIRE_DEMANDE_CONFIDENTIALITE = $this->getParametreService()->getValeurForParametre(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DOC_CONFIDENTIALITE);
            } catch (Exception $e) {
                throw new RuntimeException("Une erreur est survenue lors de la récupération de paramètre.",0,$e);
            }
        }else{
            $FORMULAIRE_DELOCALISATION = $this->propositionService->findUrlFormulaireFichierByEtabAndNatureFichierCode($this->entity, NatureFichier::CODE_DELOCALISATION_SOUTENANCE_HDR, $this->urlFichierHDR());
            $FORMULAIRE_DELEGATION = $this->propositionService->findUrlFormulaireFichierByEtabAndNatureFichierCode($this->entity, NatureFichier::CODE_DELEGATION_SIGNATURE_HDR, $this->urlFichierHDR());
            $FORMULAIRE_DEMANDE_CONFIDENTIALITE = $this->propositionService->findUrlFormulaireFichierByEtabAndNatureFichierCode($this->entity, NatureFichier::CODE_DEMANDE_CONFIDENT_HDR, $this->urlFichierHDR());
            $FORMULAIRE_DEMANDE_ANGLAIS = $this->propositionService->findUrlFormulaireFichierByEtabAndNatureFichierCode($this->entity, NatureFichier::CODE_LANGUE_ANGLAISE_HDR, $this->urlFichierHDR());
        }
        $vm =  new ViewModel([
            'title' => "Téléversement d'un justificatif",
            'object' => $this->entity,
            'form' => $form,
            'justificatifs' => $justificatifs,

            'FORMULAIRE_DELOCALISATION' => $this->getParametreService()->getValeurForParametre($categorieCode, SoutenanceParametres::DOC_DELOCALISATION),
            'FORMULAIRE_DELEGUATION' => $this->getParametreService()->getValeurForParametre($categorieCode, SoutenanceParametres::DOC_DELEGATION_SIGNATURE),
            'FORMULAIRE_DEMANDE_LABEL' => $this->proposition instanceof PropositionThese ? $this->getParametreService()->getValeurForParametre($categorieCode, SoutenanceParametres::DOC_LABEL_EUROPEEN) : null,
            'FORMULAIRE_DEMANDE_ANGLAIS' => $this->getParametreService()->getValeurForParametre($categorieCode, SoutenanceParametres::DOC_REDACTION_ANGLAIS),
            'FORMULAIRE_DEMANDE_CONFIDENTIALITE' => $this->getParametreService()->getValeurForParametre($categorieCode, SoutenanceParametres::DOC_CONFIDENTIALITE),
            'FORMULAIRE_DELOCALISATION' => $FORMULAIRE_DELOCALISATION,
            'FORMULAIRE_DELEGATION' => $FORMULAIRE_DELEGATION,
            'FORMULAIRE_DEMANDE_LABEL' => isset($FORMULAIRE_DEMANDE_LABEL) ?: null,
            'FORMULAIRE_DEMANDE_ANGLAIS' => $FORMULAIRE_DEMANDE_ANGLAIS,
            'FORMULAIRE_DEMANDE_CONFIDENTIALITE' => $FORMULAIRE_DEMANDE_CONFIDENTIALITE,
        ]);
        if ($nature !== null) $vm->setTemplate('soutenance/justificatif/ajouter');
        return $vm;
Loading