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

Ajout possibilité de modifier le nom d'une réponse

parent c5a60656
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ class ConventionModeleEtapeAdministrationController extends AbstractOscarControl
                return $this->getResponseNotFound("L'information à saisir pour l'étape de saisie du modèle de convention n'a pas été trouvée.");
            }
            $this->conventionModeleEtapeService->modifierInformation($conventionModeleEtape, $conventionModeleEtapeInformation,
            $this->params()->fromPost('obligatoire'), $this->getCurrentPerson());
            $this->params()->fromPost('nom'), $this->params()->fromPost('obligatoire'), $this->getCurrentPerson());
        } else if ($this->params()->fromPost('action') == "ajouter_information_reponse") {
            /** @var \Oscar\Entity\ConventionModeleEtapeInformation $conventionModeleEtapeInformation */
            $conventionModeleEtapeInformation = $this->getEntityManager()->find(\Oscar\Entity\ConventionModeleEtapeInformation::class, $this->params()->fromPost('id'));
+2 −2
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ class ConventionModeleEtapeService implements UseEntityManager, UseLoggerService
    $this->getEntityManager()->flush();
  }

  public function modifierInformation(\Oscar\Entity\ConventionModeleEtape $etape, \Oscar\Entity\ConventionModeleEtapeInformation $conventionModeleEtapeInformation, ?string $obligatoire, \Oscar\Entity\Person $person): void
  public function modifierInformation(\Oscar\Entity\ConventionModeleEtape $etape, \Oscar\Entity\ConventionModeleEtapeInformation $conventionModeleEtapeInformation, string $nom, ?string $obligatoire, \Oscar\Entity\Person $person): void
  {
    $this->getLoggerService()->info("ConventionModeleEtapeService modifierInformation");
    $this->getLoggerService()->info("by: " . $person);
@@ -92,7 +92,7 @@ class ConventionModeleEtapeService implements UseEntityManager, UseLoggerService
    
    $conventionModeleEtapeInformation->updatedBy = $person;
    $conventionModeleEtapeInformation->dateUpdated = new \DateTime();

    $conventionModeleEtapeInformation->nom = $nom;
    if ($obligatoire) {
      $conventionModeleEtapeInformation->obligatoire = true;
    } else {
+7 −2
Original line number Diff line number Diff line
@@ -51,12 +51,17 @@
      </details>
    </div>

    <p><b>Type :</b> <?= $information->type ?></p>
    
    <form method="post">
      <input type="hidden" name="action" value="modifier_information">
      <input type="hidden" name="id" value="<?= $information->id ?>">
      <div>
        <label style="color: black;" for="obligatoire">Obligatoire : </label>
        <label style="color: black;" for="nom"><b>Nom :</b> </label>
        <input type="text" id="nom" name="nom" value="<?= $information->nom ?>" />
      </div>
      <p><b>Type :</b> <?= $information->type ?></p>
      <div>
        <label style="color: black;" for="obligatoire"><b>Obligatoire :</b> </label>
        <input type="checkbox" id="obligatoire" name="obligatoire" <?= $information->obligatoire ? 'checked' : '' ?> />
      </div>
      <input type="submit" value="Enregistrer les modifications">