mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-24 08:33:49 +00:00
some improvement to the Update / create event pages
- i18n of all the form - add a title to each page - chill layout of each page - add flash message on successfully creation and update action For the update page, (see #23), the user is not allowed to update the center close #23 close #2
This commit is contained in:
@@ -41,6 +41,9 @@ class EventController extends Controller
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->persist($entity);
|
||||
$em->flush();
|
||||
|
||||
$this->addFlash('success', $this->get('translator')
|
||||
->trans('The event was created'));
|
||||
|
||||
return $this->redirect($this->generateUrl('chill_event__event_show', array('event_id' => $entity->getId())));
|
||||
}
|
||||
@@ -186,6 +189,7 @@ class EventController extends Controller
|
||||
'method' => 'PUT',
|
||||
));
|
||||
|
||||
$form->remove('center');
|
||||
|
||||
$form->add('submit', 'submit', array('label' => 'Update'));
|
||||
|
||||
@@ -211,6 +215,9 @@ class EventController extends Controller
|
||||
|
||||
if ($editForm->isValid()) {
|
||||
$em->flush();
|
||||
|
||||
$this->addFlash('success', $this->get('translator')
|
||||
->trans('The event was updated'));
|
||||
|
||||
return $this->redirect($this->generateUrl('chill_event__event_edit', array('event_id' => $event_id)));
|
||||
}
|
||||
|
Reference in New Issue
Block a user