mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-19 00:34:24 +00:00
adding flash messages for customfield
This commit is contained in:
parent
cbf9cee65c
commit
46173231d2
@ -28,9 +28,16 @@ class CustomFieldController extends Controller
|
|||||||
$em->persist($entity);
|
$em->persist($entity);
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
||||||
return $this->redirect($this->generateUrl('customfield_show', array('id' => $entity->getId())));
|
$this->addFlash('success', $this->get('translator')
|
||||||
|
->trans('The custom field has been created'));
|
||||||
|
|
||||||
|
return $this->redirect($this->generateUrl('customfieldsgroup_show',
|
||||||
|
array('id' => $entity->getCustomFieldsGroup()->getId())));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->addFlash('error', $this->get('translator')
|
||||||
|
->trans("The custom field form contains errors"));
|
||||||
|
|
||||||
return $this->render('ChillCustomFieldsBundle:CustomField:new.html.twig', array(
|
return $this->render('ChillCustomFieldsBundle:CustomField:new.html.twig', array(
|
||||||
'entity' => $entity,
|
'entity' => $entity,
|
||||||
'form' => $form->createView(),
|
'form' => $form->createView(),
|
||||||
@ -167,9 +174,15 @@ class CustomFieldController extends Controller
|
|||||||
if ($editForm->isValid()) {
|
if ($editForm->isValid()) {
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
||||||
|
$this->addFlash('success', $this->get('translator')
|
||||||
|
->trans("The custom field has been updated"));
|
||||||
|
|
||||||
return $this->redirect($this->generateUrl('customfield_edit', array('id' => $id)));
|
return $this->redirect($this->generateUrl('customfield_edit', array('id' => $id)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->addFlash('error', $this->get('translator')
|
||||||
|
->trans("The custom field form contains errors"));
|
||||||
|
|
||||||
return $this->render('ChillCustomFieldsBundle:CustomField:edit.html.twig', array(
|
return $this->render('ChillCustomFieldsBundle:CustomField:edit.html.twig', array(
|
||||||
'entity' => $entity,
|
'entity' => $entity,
|
||||||
'edit_form' => $editForm->createView(),
|
'edit_form' => $editForm->createView(),
|
||||||
|
@ -37,6 +37,9 @@ Custom fields group: Groupe de champ personnalisé
|
|||||||
Ordering: Ordre d'apparition
|
Ordering: Ordre d'apparition
|
||||||
Back to the group: Retour au groupe de champs personnalisé
|
Back to the group: Retour au groupe de champs personnalisé
|
||||||
Slug: Identifiant textuel
|
Slug: Identifiant textuel
|
||||||
|
The custom field has been created: Le champ personnalisé est créé
|
||||||
|
The custom field form contains errors: Le formulaire contient des erreurs
|
||||||
|
The custom field has been updated: Le champ personnalisé a été mis à jour
|
||||||
|
|
||||||
#custom field name
|
#custom field name
|
||||||
choice: choix
|
choice: choix
|
||||||
|
Loading…
x
Reference in New Issue
Block a user