Commit 467a864d authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Amélioration de la page de couverture

parent 28838924
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -7,6 +7,8 @@ Journal des modifications
- Le manque de justificatifs de soutenances n'est plus bloquant il s'agit plus que d'un warning 
- [FIX] Retrait de l'appel à un css inexistant
- Filtrage des soutenances sans date dans la vue des soutenances pour les structures.
- Ajout des mentions Co-encadrant/Co-encadrante sur la page de couverture
- Complétion des données pour la page de couverture depuis le dossier de soutenance en cas de manque

3.0.7
----- 
+7 −7
Original line number Diff line number Diff line
@@ -92,21 +92,21 @@ class Acteur implements HistoriqueAwareInterface, ResourceInterface, IndividuAwa
     *
     * @return bool
     */
    public function estDirecteur()
    public function estDirecteur() : bool
    {
        return in_array($this->getRole()->getCode(), [
                Role::CODE_DIRECTEUR_THESE,
            ]
        );
    }
    public function estCodirecteur()
    public function estCodirecteur() : bool
    {
        return in_array($this->getRole()->getCode(), [
                Role::CODE_CODIRECTEUR_THESE,
            ]
        );
    }
    public function estCoEncadrant()
    public function estCoEncadrant() : bool
    {
        return in_array($this->getRole()->getCode(), [
                Role::CODE_CO_ENCADRANT,
@@ -119,7 +119,7 @@ class Acteur implements HistoriqueAwareInterface, ResourceInterface, IndividuAwa
     *
     * @return bool
     */
    public function estRapporteur()
    public function estRapporteur() : bool
    {
        return $this->getRole()->getCode() === Role::CODE_RAPPORTEUR_JURY;
    }
@@ -129,7 +129,7 @@ class Acteur implements HistoriqueAwareInterface, ResourceInterface, IndividuAwa
     *
     * @return bool
     */
    public function estRapporteurAbsent()
    public function estRapporteurAbsent() : bool
    {
        return $this->getRole()->getCode() === Role::CODE_RAPPORTEUR_ABSENT;
    }
@@ -139,7 +139,7 @@ class Acteur implements HistoriqueAwareInterface, ResourceInterface, IndividuAwa
     *
     * @return bool
     */
    public function estPresidentJury()
    public function estPresidentJury() : bool
    {
        return ($this->getRole()->getCode() === Role::CODE_PRESIDENT_JURY);
    }
@@ -149,7 +149,7 @@ class Acteur implements HistoriqueAwareInterface, ResourceInterface, IndividuAwa
     *
     * @return bool
     */
    public function estMembreDuJury()
    public function estMembreDuJury() : bool
    {
        return $this->getRole()->getCode() === Role::CODE_MEMBRE_JURY;
    }
+4 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ use Application\Service\Utilisateur\UtilisateurService;
use Application\Service\Validation\ValidationService;
use Application\Service\Variable\VariableService;
use Interop\Container\ContainerInterface;
use Soutenance\Service\Membre\MembreService;
use UnicaenAuth\Service\AuthorizeService;
use UnicaenAuth\Service\User as UserService;
use Webmozart\Assert\Assert;
@@ -30,6 +31,7 @@ class TheseServiceFactory
        /**
         * @var ActeurService       $acteurService
         * @var ValidationService   $validationService
         * @var MembreService       $membreService
         * @var NotifierService     $notifierService
         * @var FichierTheseService $fichierTheseService
         * @var VariableService     $variableService
@@ -40,6 +42,7 @@ class TheseServiceFactory
         */
        $acteurService = $container->get(ActeurService::class);
        $validationService = $container->get('ValidationService');
        $membreService = $container->get(MembreService::class);
        $notifierService = $container->get(NotifierService::class);
        $fichierTheseService = $container->get('FichierTheseService');
        $variableService = $container->get('VariableService');
@@ -57,6 +60,7 @@ class TheseServiceFactory
        $service = new TheseService();
        $service->setActeurService($acteurService);
        $service->setValidationService($validationService);
        $service->setMembreService($membreService);
        $service->setNotifierService($notifierService);
        $service->setFichierTheseService($fichierTheseService);
        $service->setVariableService($variableService);
+30 −9
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ use Doctrine\DBAL\DBALException;
use Doctrine\ORM\OptimisticLockException;
use Doctrine\ORM\ORMException;
use Soutenance\Entity\Proposition;
use Soutenance\Service\Proposition\PropositionServiceAwareTrait;
use Soutenance\Service\Membre\MembreServiceAwareTrait;
use UnicaenApp\Exception\LogicException;
use UnicaenApp\Exception\RuntimeException;
use UnicaenApp\Traits\MessageAwareInterface;
@@ -61,7 +61,7 @@ class TheseService extends BaseService implements ListenerAggregateInterface
    use FileServiceAwareTrait;
    use AuthorizeServiceAwareTrait;
    use ActeurServiceAwareTrait;
    use PropositionServiceAwareTrait;
    use MembreServiceAwareTrait;

    /**
     * Resaisir l'autorisation de diffusion ? Sinon celle saisie au 1er dépôt est reprise/dupliquée.
@@ -123,7 +123,7 @@ class TheseService extends BaseService implements ListenerAggregateInterface
    /**
     * @return TheseRepository
     */
    public function getRepository()
    public function getRepository() : TheseRepository
    {
        /** @var TheseRepository $repo */
        $repo = $this->entityManager->getRepository(These::class);
@@ -461,7 +461,7 @@ class TheseService extends BaseService implements ListenerAggregateInterface
     * @param These $these
     * @return PdcData
     */
    public function fetchInformationsPageDeCouverture(These $these)
    public function fetchInformationsPageDeCouverture(These $these) : PdcData
    {
        $pdcData = new PdcData();
        $propositions = $these->getPropositions()->toArray();
@@ -472,7 +472,6 @@ class TheseService extends BaseService implements ListenerAggregateInterface
            $mois = (int) $these->getDateSoutenance()->format('m');
            $annee = (int) $these->getDateSoutenance()->format('Y');

            $anneeUniversitaire = null;
            if ($mois > 9)  $anneeUniversitaire = $annee . "/" . ($annee + 1);
            else            $anneeUniversitaire = ($annee - 1) . "/" . $annee;
            $pdcData->setAnneeUniversitaire($anneeUniversitaire);
@@ -545,9 +544,6 @@ class TheseService extends BaseService implements ListenerAggregateInterface
        /** @var Acteur $directeur */
        foreach (array_merge($directeurs, $codirecteurs) as $directeur) {
            if ($directeur->getEtablissement()) {
//                if (!$directeur->getEtablissement()) {
//                    throw new RuntimeException("Anomalie: le directeur de thèse '{$directeur}' n'a pas d'établissement.");
//                }
                if ($directeur->getEtablissement()->estAssocie()) {
                    $pdcData->setAssocie(true);
                    $pdcData->setLogoAssocie($this->fileService->computeLogoFilePathForStructure($directeur->getEtablissement()));
@@ -562,12 +558,17 @@ class TheseService extends BaseService implements ListenerAggregateInterface

        /** @var Acteur $acteur */
        foreach ($acteursEnCouverture as $acteur) {
            $individu = $acteur->getIndividu();

            $acteursLies = array_filter($these->getActeurs()->toArray(), function (Acteur $a) use ($individu) { return $a->getIndividu() === $individu;});

            $acteurData = new MembreData();
            $acteurData->setDenomination(strtoupper($acteur->getIndividu()->getNomComplet(true, false, false, true, true)));
            $acteurData->setQualite($acteur->getQualite());

            $estMembre = !empty(array_filter($jury, function (Acteur $a) use ($acteur) {return $a->getIndividu() === $acteur->getIndividu();}));

            /** GESTION DES RÔLES SPÉCIAUX ****************************************************************************/
            if (!$acteur->estPresidentJury()) {
                $acteurData->setRole($acteur->getRole()->getLibelle());

@@ -578,7 +579,27 @@ class TheseService extends BaseService implements ListenerAggregateInterface
            } else {
                $acteurData->setRole(Role::LIBELLE_PRESIDENT);
            }
            if ($acteur->getEtablissement()) $acteurData->setEtablissement($acteur->getEtablissement()->getStructure()->getLibelle());

            foreach ($acteursLies as $acteurLie) {
                if ($acteurLie->estCoEncadrant()) {
                    if ($acteur->getIndividu()->estUneFemme()) $acteurData->setRole($acteurData->getRole() . "<br/> Co-encadrante");
                    else $acteurData->setRole($acteurData->getRole() . "<br/> Co-encadrant");
                    break;
                }
            }

            /** GESTION DES ETABLISSEMENTS ****************************************************************************/
            if ($acteur->getEtablissement()) {
                $acteurData->setEtablissement($acteur->getEtablissement()->getStructure()->getLibelle());
            } else {
                foreach ($acteursLies as $acteurLie) {
                    $membre = $this->getMembreService()->getMembreByActeur($acteurLie);
                    if ($membre) {
                        $acteurData->setEtablissement($membre->getEtablissement());
                        break;
                    }
                }
            }

            if ($estMembre) $pdcData->addActeurEnCouverture($acteurData);
        }
+4 −0
Original line number Diff line number Diff line
@@ -177,6 +177,7 @@ class PresoutenanceController extends AbstractController
         *  - qu'un Membre du jury     est Membre du jury.
         */
        $acteurs = $this->getActeurService()->getRepository()->findActeurByThese($these);
        $acteurs = array_filter($acteurs, function (Acteur $a) { return $a->estNonHistorise();});
        switch ($membre->getRole()) {
            case Membre::RAPPORTEUR_JURY :
            case Membre::RAPPORTEUR_VISIO :
@@ -228,6 +229,8 @@ class PresoutenanceController extends AbstractController
            $membre->setActeur($acteur);
            $this->getMembreService()->update($membre);
            //creation de l'utilisateur

            if ($membre->estRapporteur()) {
                $utilisateurs = $this->utilisateurService->getRepository()->findByIndividu($individu);
                $user = null;
                if (empty($utilisateurs)) {
@@ -251,6 +254,7 @@ class PresoutenanceController extends AbstractController
                $url = $this->url()->fromRoute('zfcuser/login', ['type' => 'token'], ['query' => ['token' => $token->getToken(), 'redirect' => $url_rapporteur, 'role' => $acteur->getRole()->getRoleId()], 'force_canonical' => true], true);
                $this->getNotifierSoutenanceService()->triggerConnexionRapporteur($proposition, $user, $url);
            }
        }

        return new ViewModel([
            'title' => "Association de " . $membre->getDenomination() . " à un acteur " . $this->appInfos()->getNom(),
Loading