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

Quelques changements de fonctionnements ...

parent ad68f884
Loading
Loading
Loading
Loading
+4 −1
Changes for module/Application/src/Application/Service/Notification/NotifierService.php: 4 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ use Application\Service\Variable\VariableServiceAwareTrait;
use Notification\Notification;
use Soutenance\Entity\Membre;
use Soutenance\Entity\Proposition;
use UnicaenAuth\Entity\Db\RoleInterface;
use Zend\Mvc\Controller\Plugin\FlashMessenger;
use Zend\View\Helper\Url as UrlHelper;

@@ -656,9 +657,10 @@ class NotifierService extends \Notification\Service\NotifierService
    /**
     * @param These $these
     * @param Individu $currentUser
     * @param RoleInterface $currentRole
     * @param string $motif
     */
    public function triggerRefusPropositionSoutenance($these, $currentUser, $motif)
    public function triggerRefusPropositionSoutenance($these, $currentUser, $currentRole, $motif)
    {
        $emails   = $these->getDirecteursTheseEmails();
        $emails[] = $these->getDoctorant()->getIndividu()->getEmail();
@@ -670,6 +672,7 @@ class NotifierService extends \Notification\Service\NotifierService
            ->setTemplatePath('soutenance/notification/refus')
            ->setTemplateVariables([
                'acteur' => $currentUser,
                'role' => $currentRole,
                'motif' => $motif,
                'these' => $these,
            ]);
+10 −5
Changes for module/Application/view/soutenance/notification/refus.phtml: 10 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -5,11 +5,14 @@ use Application\Entity\Db\Role;
use Application\Entity\Db\These;
use Application\Entity\Db\Validation;
use Application\View\Renderer\PhpRenderer;
use UnicaenAuth\Entity\Db\RoleInterface;

/**
 * @var PhpRenderer $this
 * @var These $these
 * @var Individu $acteur
 * @var RoleInterface $crole
 * @var Role $role
 * @var string $motif
 */
?>
@@ -18,15 +21,17 @@ use Application\View\Renderer\PhpRenderer;
    Bonjour,
</p>
<p>
    <?php echo $acteur->getNomComplet(false, false, false, true); ?> a refus votre proposition de soutenance.
    <?php echo $acteur->getNomComplet(false, false, false, true); ?>
    (<?php echo $role->getLibelle(); ?> <i><?php echo $role->getStructure()->getLibelle(); ?></i>)
    a refus votre proposition de soutenance.
    Le motif du refus est le suivant :
</p>

<p>
"
<table style="border:gray solid 2px; width:50em; background-color: whitesmoke;">
<tr><td>
<?php echo $motif; ?>
"
</p>
</td></tr>
</table>

<p>
    Suite à ce refus toutes les validations associées à cette proposition ont été annulées.
+9 −6
Changes for module/Soutenance/src/Soutenance/Controller/SoutenanceController.php: 9 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -60,15 +60,16 @@ class SoutenanceController extends AbstractActionController {
            $these = $this->getTheseService()->getRepository()->find($theseId);
            $proposition = $this->getPropositionService()->findByThese($these);

            /** @var Individu[] $directeurs */
            $directeurs = $these->getEncadrements(true);
            /** @var Acteur[] $directeurs */
            $directeurs = $these->getEncadrements(false);

            if ($proposition) $rapporteurs = $proposition->getRapporteurs();

            /** TODO récupérer les validations via le service */
            $validations = [];
            $validations[$these->getDoctorant()->getIndividu()->getId()] = $this->getValidationService()->findValidationPropositionSoutenanceByTheseAndIndividu($these, $these->getDoctorant()->getIndividu());
            foreach ($directeurs as $directeur) {
                $validations[$directeur->getId()] = $this->getValidationService()->findValidationPropositionSoutenanceByTheseAndIndividu($these, $directeur);
                $validations[$directeur->getIndividu()->getId()] = $this->getValidationService()->findValidationPropositionSoutenanceByTheseAndIndividu($these, $directeur);
            }

            $validationUR = $this->getValidationService()->getRepository()->findValidationByCodeAndThese(TypeValidation::CODE_VALIDATION_PROPOSITION_UR, $these);
@@ -103,7 +104,7 @@ class SoutenanceController extends AbstractActionController {
        }

        if ($theses === []) {
            $theses[] = $this->getTheseService()->getRepository()->find(28057);
            $theses[] = $this->getTheseService()->getRepository()->find(41321);
        }

        return new ViewModel([
@@ -163,7 +164,7 @@ class SoutenanceController extends AbstractActionController {
                'these' => $these,
                'proposition' => $proposition,
                'doctorant' => $doctorant,
                'directeurs' => $directeurs,
                'directeurs' => $directeurs = $these->getEncadrements(false),
                'validations' => $validations,
                'currentIndividu' => $currentIndividu,
                'roleCode' => $this->userContextService->getSelectedIdentityRole()->getCode(),
@@ -436,11 +437,13 @@ class SoutenanceController extends AbstractActionController {
            if ($data['motif'] !== null) {
                $this->getPropositionService()->annulerValidations($proposition);
                $currentUser = $this->userContextService->getIdentityIndividu();
                $this->getNotifierService()->triggerRefusPropositionSoutenance($these, $currentUser, $data['motif']);
                $currentRole = $this->userContextService->getSelectedIdentityRole();
                $this->getNotifierService()->triggerRefusPropositionSoutenance($these, $currentUser, $currentRole, $data['motif']);
            }
        }

        return new ViewModel([
                'title' => "Motivation du refus de la proposition de soutenance",
                'form' => $form,
                'these' => $these,
            ]
+2 −2
Changes for module/Soutenance/src/Soutenance/Entity/Proposition.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -235,7 +235,7 @@ class Proposition {
        /** Au moins la motié du jury de rang A */
        $ratioRangA = ($nbMembre)?($nbRangA / $nbMembre):0;
        $indicateurs["rang A"]      = ["Nombre" => $nbRangA, "Ratio" => $ratioRangA];
        if ($ratioRangA < 0.5 && !$nbMembre)  {
        if ($ratioRangA < 0.5 || !$nbMembre)  {
            $indicateurs["rang A"]["valide"]    = false;
        } else {
            $indicateurs["rang A"]["valide"]    = true;
@@ -244,7 +244,7 @@ class Proposition {
        /** Au moins la motié du jury exterieur*/
        $ratioExterieur = ($nbMembre)?($nbExterieur / $nbMembre):0;
        $indicateurs["exterieur"]      = ["Nombre" => $nbExterieur, "Ratio" => $ratioExterieur];
        if ($ratioExterieur < 0.5 && !$nbMembre)  {
        if ($ratioExterieur < 0.5 || !$nbMembre)  {
            $indicateurs["exterieur"]["valide"]    = false;
        } else {
            $indicateurs["exterieur"]["valide"]    = true;
+1 −1
Changes for module/Soutenance/src/Soutenance/Form/SoutenanceMembre/SoutenanceMembreForm.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ class SoutenanceMembreForm extends Form {
        $this->add(
            (new Radio('exterieur'))
                ->setLabel("Le membre est extérieur à l'établissement encadrant la thèse :")
                ->setValueOptions([ 'oui' => 'Oui', 'non' => 'non'])
                ->setValueOptions([ 'oui' => 'Oui', 'non' => 'Non'])
        );
        $this->add(
            (new Text('role'))
Loading