Commit 0695c306 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Rapporteur non membre

parent 79b22388
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -121,6 +121,16 @@ class Acteur implements HistoriqueAwareInterface, ResourceInterface
        return ($this->getRole()->getCode() === Role::CODE_PRESIDENT_JURY || $this->getLibelleRoleComplement() === Role::LIBELLE_PRESIDENT);
    }

    /**
     * Prédicat testant cet un acteur est un membre du jury de thèse.
     *
     * @return bool
     */
    public function estMembreDuJury()
    {
        return $this->getRole()->getCode() === Role::CODE_MEMBRE_JURY;
    }

    /**
     * @return string
     */
@@ -295,4 +305,6 @@ class Acteur implements HistoriqueAwareInterface, ResourceInterface
    {
        return 'Acteur';
    }


}
+13 −0
Original line number Diff line number Diff line
@@ -290,8 +290,15 @@ class TheseService extends BaseService
            if ($these->getLibellePaysCotutelle()) $pdcData->setCotutuellePays($these->getLibellePaysCotutelle());
        }



        /** Jury de thèses */
        $acteurs = $these->getActeurs()->toArray();

        $jury = array_filter($acteurs, function (Acteur $a) {
           return $a->estMembreDuJury();
        });

        $rapporteurs = array_filter($acteurs, function (Acteur $a) {
            return $a->estRapporteur();
        });
@@ -337,6 +344,12 @@ class TheseService extends BaseService

            if (!$acteur->estPresidentJury()) {
                $acteurData->setRole($acteur->getRole()->getLibelle());

                //patch rapporteur non membre ...
                $estMembre = !empty(array_filter($jury, function (Acteur $a) use ($acteur) {return $a->getIndividu() === $acteur->getIndividu();}));
                if ($acteur->getRole()->getCode() === Role::CODE_RAPPORTEUR_JURY && !$estMembre) {
                    $acteurData->setRole("Rapporteur non membre du jury");
                }
            } else {
                $acteurData->setRole(Role::LIBELLE_PRESIDENT);
            }