mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-29 13:36:13 +00:00
Feature: [calendar] Add button to generate document immediatly after saving the calendar
This commit is contained in:
parent
55095ee6ac
commit
2c5fa82380
@ -152,7 +152,10 @@ class CalendarController extends AbstractController
|
|||||||
$view = '@ChillCalendar/Calendar/editByUser.html.twig';
|
$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);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
@ -162,6 +165,10 @@ class CalendarController extends AbstractController
|
|||||||
|
|
||||||
$params = $this->buildParamsToUrl($user, $accompanyingPeriod);
|
$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);
|
return $this->redirectToRoute('chill_calendar_calendar_list_by_period', $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -277,7 +284,10 @@ class CalendarController extends AbstractController
|
|||||||
$entity->setAccompanyingPeriod($accompanyingPeriod);
|
$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);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
@ -288,6 +298,10 @@ class CalendarController extends AbstractController
|
|||||||
|
|
||||||
$params = $this->buildParamsToUrl($user, $accompanyingPeriod);
|
$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);
|
return $this->redirectToRoute('chill_calendar_calendar_list_by_period', $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -611,7 +611,7 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface
|
|||||||
|
|
||||||
public function setEndDate(DateTimeImmutable $endDate): self
|
public function setEndDate(DateTimeImmutable $endDate): self
|
||||||
{
|
{
|
||||||
if ($this->endDate->getTimestamp() !== $endDate->getTimestamp()) {
|
if (null === $this->endDate || $this->endDate->getTimestamp() !== $endDate->getTimestamp()) {
|
||||||
$this->increaseaDatetimeVersion();
|
$this->increaseaDatetimeVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -662,7 +662,7 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface
|
|||||||
|
|
||||||
public function setStartDate(DateTimeImmutable $startDate): self
|
public function setStartDate(DateTimeImmutable $startDate): self
|
||||||
{
|
{
|
||||||
if ($this->startDate->getTimestamp() !== $startDate->getTimestamp()) {
|
if (null === $this->startDate || $this->startDate->getTimestamp() !== $startDate->getTimestamp()) {
|
||||||
$this->increaseaDatetimeVersion();
|
$this->increaseaDatetimeVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,9 +78,10 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<button class="btn btn-create" type="submit">
|
{{ form_widget(form.save_and_create_doc, { 'attr' : { 'class' : 'btn btn-create' }, 'label': 'chill_calendar.Save and add a document'|trans }) }}
|
||||||
{{ 'Save'|trans }}
|
</li>
|
||||||
</button>
|
<li>
|
||||||
|
{{ form_widget(form.save, { 'attr' : { 'class' : 'btn btn-create' }, 'label': 'Save'|trans }) }}
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
{{ form_end(form) }}
|
{{ form_end(form) }}
|
||||||
|
@ -78,9 +78,10 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<button class="btn btn-create" type="submit">
|
{{ form_widget(form.save_and_create_doc, { 'attr' : { 'class' : 'btn btn-create' }, 'label': 'chill_calendar.Create and add a document'|trans }) }}
|
||||||
{{ 'Create'|trans }}
|
</li>
|
||||||
</button>
|
<li>
|
||||||
|
{{ form_widget(form.save, { 'attr' : { 'class' : 'btn btn-create' }, 'label': 'Create'|trans }) }}
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
{{ form_end(form) }}
|
{{ form_end(form) }}
|
||||||
|
@ -52,6 +52,8 @@ chill_calendar:
|
|||||||
Next calendars: Prochains rendez-vous
|
Next calendars: Prochains rendez-vous
|
||||||
Add a document: Ajouter un document
|
Add a document: Ajouter un document
|
||||||
Documents: Documents
|
Documents: Documents
|
||||||
|
Create and add a document: Créer et ajouter un document
|
||||||
|
Save and add a document: Enregistrer et ajouter un document
|
||||||
|
|
||||||
|
|
||||||
remote_ms_graph:
|
remote_ms_graph:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user