go back to calendar after editing and creation of time-records (#519)
This commit is contained in:
@@ -77,7 +77,7 @@ trait TimesheetControllerTrait
|
||||
*/
|
||||
protected function edit(Timesheet $entry, Request $request, $redirectRoute, $renderTemplate)
|
||||
{
|
||||
$editForm = $this->getEditForm($entry, $request->get('page'));
|
||||
$editForm = $this->getEditForm($entry, $request->get('page'), $request->get('origin', 'timesheet'));
|
||||
$editForm->handleRequest($request);
|
||||
|
||||
if ($editForm->isSubmitted() && $editForm->isValid()) {
|
||||
@@ -154,7 +154,7 @@ trait TimesheetControllerTrait
|
||||
}
|
||||
}
|
||||
|
||||
$createForm = $this->getCreateForm($entry);
|
||||
$createForm = $this->getCreateForm($entry, $redirectRoute);
|
||||
$createForm->handleRequest($request);
|
||||
|
||||
if ($createForm->isSubmitted() && $createForm->isValid()) {
|
||||
@@ -203,16 +203,18 @@ trait TimesheetControllerTrait
|
||||
|
||||
/**
|
||||
* @param Timesheet $entry
|
||||
* @param string $redirectRoute
|
||||
* @return \Symfony\Component\Form\FormInterface
|
||||
*/
|
||||
abstract protected function getCreateForm(Timesheet $entry);
|
||||
abstract protected function getCreateForm(Timesheet $entry, string $redirectRoute);
|
||||
|
||||
/**
|
||||
* @param Timesheet $entry
|
||||
* @param int $page
|
||||
* @param string $redirectRoute
|
||||
* @return \Symfony\Component\Form\FormInterface
|
||||
*/
|
||||
abstract protected function getEditForm(Timesheet $entry, $page);
|
||||
abstract protected function getEditForm(Timesheet $entry, $page, string $redirectRoute);
|
||||
|
||||
/**
|
||||
* Adds a "successful" flash message to the stack.
|
||||
|
||||
Reference in New Issue
Block a user