Skip to content
Snippets Groups Projects
Commit 86e80e25 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Perimetre multiple

parent de1eefe8
No related branches found
No related tags found
No related merge requests found
Pipeline #33954 failed
......@@ -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
......@@ -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);
}
}
......
......@@ -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);
}
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);
}
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);
}
return $tableau;
}
......
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment