From 2401270754746b631a370c1a2a523e433e25b5d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 27 Nov 2015 14:26:46 +0100 Subject: [PATCH] add flash message for custom fields group --- Controller/CustomFieldsGroupController.php | 15 +++++++++++++++ Resources/translations/messages.fr.yml | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/Controller/CustomFieldsGroupController.php b/Controller/CustomFieldsGroupController.php index f31edd4df..46b95fd5a 100644 --- a/Controller/CustomFieldsGroupController.php +++ b/Controller/CustomFieldsGroupController.php @@ -97,9 +97,15 @@ class CustomFieldsGroupController extends Controller $em = $this->getDoctrine()->getManager(); $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, @@ -274,9 +280,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, @@ -324,6 +336,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')); } diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index 38e037506..77c13fd1c 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -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