Skip to content
Snippets Groups Projects
Commit c478a8d8 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Correction de bug empêchant l'administration des domaines fonctionnels

parent 90ef08ac
No related branches found
No related tags found
No related merge requests found
......@@ -22,9 +22,9 @@ return [
'delete' => [
'type' => 'Segment',
'options' => [
'route' => '/delete/:domaine-fonctionnel',
'route' => '/delete/:domaineFonctionnel',
'constraints' => [
'domaine-fonctionnel' => '[0-9]*',
'domaineFonctionnel' => '[0-9]*',
],
'defaults' => [
'action' => 'delete',
......@@ -34,9 +34,9 @@ return [
'saisie' => [
'type' => 'Segment',
'options' => [
'route' => '/saisie/[:domaine-fonctionnel]',
'route' => '/saisie/[:domaineFonctionnel]',
'constraints' => [
'domaine-fonctionnel' => '[0-9]*',
'domaineFonctionnel' => '[0-9]*',
],
'defaults' => [
'action' => 'saisie',
......
......@@ -14,6 +14,8 @@ class DomaineFonctionnelController extends AbstractController
use DomaineFonctionnelSaisieFormAwareTrait;
use SourceServiceAwareTrait;
public function indexAction()
{
$this->em()->getFilters()->enable('historique')->init([
......@@ -31,14 +33,13 @@ class DomaineFonctionnelController extends AbstractController
{
/* @var $domaineFonctionnel DomaineFonctionnel */
$domaineFonctionnel = $this->getEvent()->getParam('domaine-fonctionnel');
$domaineFonctionnel = $this->getEvent()->getParam('domaineFonctionnel');
$form = $this->getFormDomaineFonctionnelSaisie();
if (empty($domaineFonctionnel)) {
$title = 'Création d\'un nouveau domaine fonctionnel';
$domaineFonctionnel = $this->getServiceDomaineFonctionnel()->newEntity()
->setSource($this->getServiceSource()->getOse());
} else {
$title = 'Édition d\'un domaine fonctionnel';
}
......@@ -56,9 +57,11 @@ class DomaineFonctionnelController extends AbstractController
return compact('form', 'title');
}
public function deleteAction()
{
$domaineFonctionnel = $this->getEvent()->getParam('domaine-fonctionnel');
$domaineFonctionnel = $this->getEvent()->getParam('domaineFonctionnel');
try {
$this->getServiceDomaineFonctionnel()->delete($domaineFonctionnel);
......@@ -66,6 +69,7 @@ class DomaineFonctionnelController extends AbstractController
} catch (\Exception $e) {
$this->flashMessenger()->addErrorMessage(DbException::translate($e)->getMessage());
}
return new MessengerViewModel(compact('domaineFonctionnel'));
}
}
......@@ -29,11 +29,11 @@ $canEdit = $this->isAllowed(Privileges::getResourceId(Privileges::DOMAINES_FONCT
<?php if (($canEdit) && ($fr->getSource() == 'OSE')) { ?>
<td style="text-align:center;width:1px;white-space: nowrap">
<a class="ajax-modal" data-event="domaine-fonctionnel-saisie"
href="<?= $this->url('domaine-fonctionnel/saisie', ['domaine-fonctionnel' => $fr->getId()]) ?>"
href="<?= $this->url('domaine-fonctionnel/saisie', ['domaineFonctionnel' => $fr->getId()]) ?>"
title="Modifier la DomaineFonctionnel">
<span class="glyphicon glyphicon-edit"></span></a>
<a class="pop-ajax"
href="<?= $this->url('domaine-fonctionnel/delete', ['domaine-fonctionnel' => $fr->getId()]) ?>"
href="<?= $this->url('domaine-fonctionnel/delete', ['domaineFonctionnel' => $fr->getId()]) ?>"
title="Supprimer la DomaineFonctionnel"
data-content="<p class='lead text-danger'><strong>Attention!</strong> Confirmez-vous cette suppression ?</p>"
data-confirm="true"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment