diff --git a/readme.md b/readme.md index 81fd837752ec8416f340d7f2171c6d29791683ba..bf9c5e4d6132ccf8fb3c2316e5c3926326ceaaef 100644 --- a/readme.md +++ b/readme.md @@ -63,6 +63,5 @@ Par exemple pour les périmètres de structure 5 et 12 et de domaine 1 cette mé Améliorations ------------- 1. **PERIMÈTRE** Exposer plusieurs périmètres - 1. **SECURITE** Verifier qu'il n'y est que des selects 1. **QoL** Coloration tinyMCE \ No newline at end of file diff --git a/src/UnicaenIndicateur/Controller/IndicateurController.php b/src/UnicaenIndicateur/Controller/IndicateurController.php index 840afa29b6fb563dc9254cb4cb63d1bf9afb6c77..000b53851990ffe25d96698b1da9dd7bc0cae2cd 100644 --- a/src/UnicaenIndicateur/Controller/IndicateurController.php +++ b/src/UnicaenIndicateur/Controller/IndicateurController.php @@ -117,7 +117,6 @@ class IndicateurController extends AbstractActionController { $count = $this->getIndicateurService()->getCount($indicateur); $indicateur->setNbElements($count); $this->getIndicateurService()->update($indicateur); - return $this->redirect()->toRoute('indicateur/afficher', ['indicateur' => $indicateur->getId()], [], true); } } @@ -131,7 +130,7 @@ class IndicateurController extends AbstractActionController { return $vm; } - public function modifierAction(): ViewModel + public function modifierAction(): ViewModel|Response { $indicateur = $this->getIndicateurService()->getRequestedIndicateur($this); $namespace = $this->params()->fromQuery('namespace'); @@ -153,6 +152,7 @@ class IndicateurController extends AbstractActionController { if ($form->isValid()) { $this->getIndicateurService()->update($indicateur); $this->getIndicateurService()->updateView($indicateur); + return $this->redirect()->toRoute('indicateur/afficher', ['indicateur' => $indicateur->getId()], [], true); } } diff --git a/src/UnicaenIndicateur/Service/TableauDeBord/TableauDeBordService.php b/src/UnicaenIndicateur/Service/TableauDeBord/TableauDeBordService.php index 7b87f385bb2e10141bf4699ea473ebb9ec4d8d1d..f1985b772dac4c55b7b10c39077c84cee9cd6ad1 100644 --- a/src/UnicaenIndicateur/Service/TableauDeBord/TableauDeBordService.php +++ b/src/UnicaenIndicateur/Service/TableauDeBord/TableauDeBordService.php @@ -4,7 +4,6 @@ namespace UnicaenIndicateur\Service\TableauDeBord; use Doctrine\ORM\EntityManager; use Doctrine\ORM\NonUniqueResultException; -use Doctrine\ORM\ORMException; use Doctrine\ORM\QueryBuilder; use DoctrineModule\Persistence\ProvidesObjectManager; use Laminas\Mvc\Controller\AbstractActionController; @@ -21,33 +20,21 @@ class TableauDeBordService { public function create(TableauDeBord $tableau) : TableauDeBord { - try { - $this->getObjectManager()->persist($tableau); - $this->getObjectManager()->flush($tableau); - } catch (ORMException $e) { - throw new RuntimeException("Un problème est survenu en BD", 0 , $e); - } + $this->getObjectManager()->persist($tableau); + $this->getObjectManager()->flush($tableau); return $tableau; } public function update(TableauDeBord $tableau) : TableauDeBord { - try { - $this->getObjectManager()->flush($tableau); - } catch (ORMException $e) { - throw new RuntimeException("Un problème est survenu en BD", 0 , $e); - } + $this->getObjectManager()->flush($tableau); return $tableau; } public function delete(TableauDeBord $tableau) : TableauDeBord { - try { - $this->getObjectManager()->remove($tableau); - $this->getObjectManager()->flush($tableau); - } catch (ORMException $e) { - throw new RuntimeException("Un problème est survenu en BD", 0 , $e); - } + $this->getObjectManager()->remove($tableau); + $this->getObjectManager()->flush($tableau); return $tableau; } diff --git a/view/unicaen-indicateur/indicateur/index.phtml b/view/unicaen-indicateur/indicateur/index.phtml index c5464bb3dab14c9cc1fc8e905b8d60a87193be5d..56038326cfe96113471a0e486642603138c933da 100644 --- a/view/unicaen-indicateur/indicateur/index.phtml +++ b/view/unicaen-indicateur/indicateur/index.phtml @@ -120,8 +120,7 @@ $canCategories = $this->isAllowed(IndicateurPrivileges::getResourceId(Indicateur <?php if ($canEditer): ?> <?php /** @see IndicateurController::modifierAction() */?> - <a href="<?php echo $this->url("indicateur/modifier", ['indicateur' => $indicateur->getId()], [], true); ?>" - class="ajax-modal" data-event="modification"> + <a href="<?php echo $this->url("indicateur/modifier", ['indicateur' => $indicateur->getId()], [], true); ?>" > <span class="icon icon-editer" title="Modifier l'indicateur"></span></a> <?php else : ?> <span class="icon icon-editer" style="color:lightgray"></span>