mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
parent
0a1ff9e141
commit
d554407dce
@ -91,16 +91,11 @@ class PersonController extends Controller
|
|||||||
|
|
||||||
if ($request->getMethod() === 'POST') {
|
if ($request->getMethod() === 'POST') {
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
$errors = $this->get('validator')
|
if ( ! $form->isValid() ) {
|
||||||
->validate($person, array('general'));
|
|
||||||
|
|
||||||
if ( count($errors) > 0 ) {
|
|
||||||
|
|
||||||
$errors = $form->getErrorsAsString();
|
|
||||||
|
|
||||||
$this->get('session')
|
$this->get('session')
|
||||||
->getFlashBag()->add('danger', 'error' . $errors);
|
->getFlashBag()->add('danger', 'Thp person data provided'
|
||||||
|
. ' are not valid');
|
||||||
|
|
||||||
return $this->render('ChillPersonBundle:Person:edit.html.twig',
|
return $this->render('ChillPersonBundle:Person:edit.html.twig',
|
||||||
array('person' => $person,
|
array('person' => $person,
|
||||||
@ -110,7 +105,7 @@ class PersonController extends Controller
|
|||||||
$this->get('session')->getFlashBag()
|
$this->get('session')->getFlashBag()
|
||||||
->add('success',
|
->add('success',
|
||||||
$this->get('translator')
|
$this->get('translator')
|
||||||
->trans('The person has been created')
|
->trans('The person data has been updated')
|
||||||
);
|
);
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
@ -74,7 +74,8 @@ class PersonType extends AbstractType
|
|||||||
public function setDefaultOptions(OptionsResolverInterface $resolver)
|
public function setDefaultOptions(OptionsResolverInterface $resolver)
|
||||||
{
|
{
|
||||||
$resolver->setDefaults(array(
|
$resolver->setDefaults(array(
|
||||||
'data_class' => 'Chill\PersonBundle\Entity\Person'
|
'data_class' => 'Chill\PersonBundle\Entity\Person',
|
||||||
|
'validation_groups' => array('general', 'creation')
|
||||||
));
|
));
|
||||||
|
|
||||||
$resolver->setRequired(array(
|
$resolver->setRequired(array(
|
||||||
|
@ -47,6 +47,7 @@ Return: Retour
|
|||||||
Submit: Envoi
|
Submit: Envoi
|
||||||
Reset: 'Remise à zéro'
|
Reset: 'Remise à zéro'
|
||||||
'The person data has been updated': 'Bravo ! Les données ont été mises à jour.'
|
'The person data has been updated': 'Bravo ! Les données ont été mises à jour.'
|
||||||
|
'The person data provided are not valid': 'Les données introduites ne sont pas valides'
|
||||||
'{1} The person field %field% is incorrect. Please check. | ]1, Inf] Several person fields are incorrect. Please check.': '{1} Le champs %field% est incorrect. Veuillez le corriger. | ]1, Inf] Plusieurs champs sont incorrects. Veuillez les vérifier.'
|
'{1} The person field %field% is incorrect. Please check. | ]1, Inf] Several person fields are incorrect. Please check.': '{1} Le champs %field% est incorrect. Veuillez le corriger. | ]1, Inf] Plusieurs champs sont incorrects. Veuillez les vérifier.'
|
||||||
'Add a person': 'Ajout d''une personne'
|
'Add a person': 'Ajout d''une personne'
|
||||||
'Person Menu': 'Menu personne'
|
'Person Menu': 'Menu personne'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user