javascript and api to stop and display active records (#772)

This commit is contained in:
Kevin Papst
2019-05-10 13:45:09 +02:00
committed by GitHub
parent e619b5fd31
commit 09da7cd242
86 changed files with 918 additions and 449 deletions

View File

@@ -133,20 +133,6 @@ class TimesheetController extends AbstractController
);
}
/**
* The route to stop a running entry.
*
* @Route(path="/{id}/stop", name="timesheet_stop", methods={"GET"})
* @Security("is_granted('stop', entry)")
*
* @param Timesheet $entry
* @return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
*/
public function stopAction(Timesheet $entry)
{
return $this->stop($entry, 'timesheet');
}
/**
* @Route(path="/start/{id}", name="timesheet_start", requirements={"id" = "\d+"}, methods={"GET", "POST"})
* @Security("is_granted('start', timesheet)")
@@ -233,10 +219,17 @@ class TimesheetController extends AbstractController
* @param Timesheet $entry
* @param Request $request
* @return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
* @throws \Exception
*/
public function deleteAction(Timesheet $entry, Request $request)
{
$deleteForm = $this->createFormBuilder()
$deleteForm = $this->createFormBuilder(null, [
'attr' => [
'data-form-event' => 'kimai.timesheetUpdate kimai.timesheetDelete',
'data-msg-success' => 'action.delete.success',
'data-msg-error' => 'action.delete.error',
],
])
->setAction($this->generateUrl('timesheet_delete', ['id' => $entry->getId()]))
->setMethod('POST')
->getForm();