Commit 2c18af29 authored by Jean-Baptiste Oellers's avatar Jean-Baptiste Oellers
Browse files

Ajout création activité

parent af293bd9
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -22,9 +22,26 @@ class ConventionModeleInstanceController extends AbstractOscarController

        if ($this->params()->fromPost('action') == "enregistrer_reponse") {
            $this->conventionModeleInstanceService->enregitrerRéponse($conventionModeleInstance, $this->params()->fromQuery('question', ''), $this->params()->fromQuery('reponse', ''), $this->getCurrentPerson());

            $this->créerActivité();

            $conventionModeleInstance->conventionModeleEtapeEnCours = NULL;
            $conventionModeleInstance->updatedBy = $this->getCurrentPerson();
            $conventionModeleInstance->dateUpdated = new \DateTime();
            $this->getEntityManager()->flush();
        }

        return $this->redirect()->toRoute('conventionModeleInstances/afficher', ['id' => $conventionModeleInstance->id]);
    }

    private function créerActivité() {
        $newActivity = new \Oscar\Entity\Activity();
        $newActivity->setCurrency($this->getEntityManager()->getRepository(\Oscar\Entity\Currency::class)->findAll()[0]);
        $newActivity->setPcruValidPoleCompetitivite(false);
        $newActivity->setDisciplines([]);
        $newActivity->setMotscles([]);
        $this->getEntityManager()->persist($newActivity);
        $this->getEntityManager()->flush();
    }

}
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@
<div id="demarrer-chemin-decisionnel" class="container">
  <div style="background-color: white; padding-left: 4em; padding-bottom: 1em; padding-right: 4em; min-width: 40%;">
    <?php if ($conventionModeleInstance->conventionModeleEtapeEnCours == NULL): ?>
      <h1 style="padding-bottom: 3rem;">Ce parcours de création n'est plus en cours. Veuillez retourner à la page d'acceuil et recommencer.</h1>
      <h1 style="padding-bottom: 3rem;">Votre demande de convention a bien été enregistrée.</h1>
    <?php else: ?>
      <h1 style="padding-bottom: 3rem;"><?= $conventionModeleInstance->conventionModeleEtapeEnCours->titre ?></h1>