API: allow to set user for timesheet (#1259)

This commit is contained in:
Kevin Papst
2019-11-23 14:21:46 +01:00
committed by GitHub
parent 04dd6b900f
commit 641c199c8c
3 changed files with 8 additions and 2 deletions

View File

@@ -307,12 +307,13 @@ class TimesheetController extends BaseApiController
$form = $this->createForm(TimesheetApiEditForm::class, $timesheet, [
'include_rate' => $this->isGranted('edit_rate', $timesheet),
'include_exported' => $this->isGranted('edit_export', $timesheet),
'include_user' => $this->isGranted('create_other_timesheet'),
'allow_begin_datetime' => $mode->canUpdateTimesWithAPI(),
'allow_end_datetime' => $mode->canUpdateTimesWithAPI(),
'date_format' => self::DATE_FORMAT,
]);
$form->submit($request->request->all());
$form->submit($request->request->all(), false);
if ($form->isValid()) {
if (null === $timesheet->getEnd()) {
@@ -387,6 +388,7 @@ class TimesheetController extends BaseApiController
$form = $this->createForm(TimesheetApiEditForm::class, $timesheet, [
'include_rate' => $this->isGranted('edit_rate', $timesheet),
'include_exported' => $this->isGranted('edit_export', $timesheet),
'include_user' => $this->isGranted('edit', $timesheet),
'allow_begin_datetime' => $mode->canUpdateTimesWithAPI(),
'allow_end_datetime' => $mode->canUpdateTimesWithAPI(),
'date_format' => self::DATE_FORMAT,