weekly timesheet uses automatic billable mode, auto responsiveness (#3679)

This commit is contained in:
Kevin Papst
2022-12-07 18:44:17 +01:00
committed by GitHub
parent 58a9facc6d
commit db0e555eae
2 changed files with 14 additions and 7 deletions

View File

@@ -134,12 +134,12 @@ class QuickEntryController extends AbstractController
foreach ($row['days'] as $dayId => $day) {
if (!\array_key_exists('entry', $day)) {
// fill all rows and columns to make sure we do not have missing records
$tmp = new Timesheet();
$tmp->setUser($user);
$tmp = $this->timesheetService->createNewTimesheet($user);
$tmp->setProject($row['project']);
$tmp->setActivity($row['activity']);
$tmp->setBegin(clone $day['day']);
$tmp->getBegin()->setTime($defaultHour, $defaultMinute, 0, 0);
$this->timesheetService->prepareNewTimesheet($tmp);
$model->addTimesheet($tmp);
} else {
$model->addTimesheet($day['entry']);
@@ -151,10 +151,10 @@ class QuickEntryController extends AbstractController
$empty = $formModel->createRow($user);
$empty->markAsPrototype();
foreach ($week as $dayId => $day) {
$tmp = new Timesheet();
$tmp->setUser($user);
$tmp = $this->timesheetService->createNewTimesheet($user);
$tmp->setBegin(clone $day['day']);
$tmp->getBegin()->setTime($defaultHour, $defaultMinute, 0, 0);
$this->timesheetService->prepareNewTimesheet($tmp);
$empty->addTimesheet($tmp);
}
@@ -165,10 +165,10 @@ class QuickEntryController extends AbstractController
for ($a = 0; $a < $newRows; $a++) {
$model = $formModel->addRow($user);
foreach ($week as $dayId => $day) {
$tmp = new Timesheet();
$tmp->setUser($user);
$tmp = $this->timesheetService->createNewTimesheet($user);
$tmp->setBegin(clone $day['day']);
$tmp->getBegin()->setTime($defaultHour, $defaultMinute, 0, 0);
$this->timesheetService->prepareNewTimesheet($tmp);
$model->addTimesheet($tmp);
}
}