add flash message for custom fields group

This commit is contained in:
Julien Fastré 2015-11-27 14:26:46 +01:00
parent 46173231d2
commit 2401270754
2 changed files with 19 additions and 0 deletions

View File

@ -98,9 +98,15 @@ class CustomFieldsGroupController extends Controller
$em->persist($entity);
$em->flush();
$this->addFlash('success', $this->get('translator')
->trans("The custom fields group has been created"));
return $this->redirect($this->generateUrl('customfieldsgroup_show', array('id' => $entity->getId())));
}
$this->addFlash('error', $this->get('translator')
->trans("The custom fields group form contains errors"));
return $this->render('ChillCustomFieldsBundle:CustomFieldsGroup:new.html.twig', array(
'entity' => $entity,
'form' => $form->createView(),
@ -275,9 +281,15 @@ class CustomFieldsGroupController extends Controller
if ($editForm->isValid()) {
$em->flush();
$this->addFlash('success', $this->get('translator')
->trans("The custom fields group has been updated"));
return $this->redirect($this->generateUrl('customfieldsgroup_edit', array('id' => $id)));
}
$this->addFlash('error', $this->get('translator')
->trans("The custom fields group form contains errors"));
return $this->render('ChillCustomFieldsBundle:CustomFieldsGroup:edit.html.twig', array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
@ -325,6 +337,9 @@ class CustomFieldsGroupController extends Controller
$em->persist($newCFDefaultGroup);
$em->flush();
$this->addFlash('success', $this->get('translator')
->trans("The default custom fields group has been changed"));
return $this->redirect($this->generateUrl('customfieldsgroup'));
}

View File

@ -21,6 +21,10 @@ active: actif
No value defined for this option: Pas de valeur pour cette option
CustomFieldsGroup edit: Edition d'un groupe de champs personnalisé
type: type
The custom fields group has been created: Le groupe de champs personnalisés a été créé
The custom fields group has been updated: Le groupe de champs personnalisés a été mis à jour
The custom fields group form contains errors: Le formulaire contient des erreurs
The default custom fields group has been changed: Le groupe par défaut a été changé
#menu entries