mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-02 13:03:50 +00:00
Feature: [calendar] Add button to generate document immediatly after saving the calendar
This commit is contained in:
@@ -152,7 +152,10 @@ class CalendarController extends AbstractController
|
||||
$view = '@ChillCalendar/Calendar/editByUser.html.twig';
|
||||
}
|
||||
|
||||
$form = $this->createForm(CalendarType::class, $entity);
|
||||
$form = $this->createForm(CalendarType::class, $entity)
|
||||
->add('save', SubmitType::class)
|
||||
->add('save_and_create_doc', SubmitType::class);
|
||||
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
@@ -162,6 +165,10 @@ class CalendarController extends AbstractController
|
||||
|
||||
$params = $this->buildParamsToUrl($user, $accompanyingPeriod);
|
||||
|
||||
if ($form->get('save_and_create_doc')->isClicked()) {
|
||||
return $this->redirectToRoute('chill_calendar_calendardoc_pick_template', ['id' => $entity->getId()]);
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('chill_calendar_calendar_list_by_period', $params);
|
||||
}
|
||||
|
||||
@@ -277,7 +284,10 @@ class CalendarController extends AbstractController
|
||||
$entity->setAccompanyingPeriod($accompanyingPeriod);
|
||||
}
|
||||
|
||||
$form = $this->createForm(CalendarType::class, $entity);
|
||||
$form = $this->createForm(CalendarType::class, $entity)
|
||||
->add('save', SubmitType::class)
|
||||
->add('save_and_create_doc', SubmitType::class);
|
||||
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
@@ -288,6 +298,10 @@ class CalendarController extends AbstractController
|
||||
|
||||
$params = $this->buildParamsToUrl($user, $accompanyingPeriod);
|
||||
|
||||
if ($form->get('save_and_create_doc')->isClicked()) {
|
||||
return $this->redirectToRoute('chill_calendar_calendardoc_pick_template', ['id' => $entity->getId()]);
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('chill_calendar_calendar_list_by_period', $params);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user