From 2fb8f908a28f8556caee6bcfa87bf4eca9df3fbc Mon Sep 17 00:00:00 2001
From: Jonathan Foucher <jfoucher@gmail.com>
Date: Mon, 16 Oct 2023 12:04:56 +0200
Subject: [PATCH] Do not set AIPD to valid when the responsable has given their
 reponse and we clicked on the save draft button. Fixes
 https://gitlab.adullact.net/soluris/madis/-/issues/842

---
 src/Domain/AIPD/Controller/AnalyseImpactController.php | 5 -----
 templates/Aipd/Analyse_impact/list.html.twig           | 2 +-
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/Domain/AIPD/Controller/AnalyseImpactController.php b/src/Domain/AIPD/Controller/AnalyseImpactController.php
index 07ff8e050..dcdb4d1e8 100644
--- a/src/Domain/AIPD/Controller/AnalyseImpactController.php
+++ b/src/Domain/AIPD/Controller/AnalyseImpactController.php
@@ -436,11 +436,6 @@ class AnalyseImpactController extends CRUDController
         $form->handleRequest($request);
 
         if ($form->isSubmitted() && $form->isValid()) {
-            if ('saveDraft' !== $form->getClickedButton() && ReponseAvisDictionary::REPONSE_NONE !== $object->getAvisResponsable()->getReponse()) {
-                $object->setDateValidation(new \DateTime());
-                $object->setIsValidated(true);
-                $object->setStatut($object->getAvisResponsable()->getReponse());
-            }
             $this->entityManager->flush();
 
             return $this->redirectToRoute($this->getRouteName('list'));
diff --git a/templates/Aipd/Analyse_impact/list.html.twig b/templates/Aipd/Analyse_impact/list.html.twig
index 6bb1c8225..040c78793 100644
--- a/templates/Aipd/Analyse_impact/list.html.twig
+++ b/templates/Aipd/Analyse_impact/list.html.twig
@@ -38,7 +38,7 @@
     <div class="row">
         <div class="col-xs-12">
             <div class="box box-solid">
-                <div class="box-body">
+                <div class="box-body" style="overflow-x: auto">
                     <table role="presentation" id="table" class="table table-bordered table-hover">
                         <thead>
                         <tr>
-- 
GitLab