mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
no message
This commit is contained in:
1 parent
9c7b176508
commit
a5f6fbd720
3 files changed
+144
-45
No files matched your search
@@ -44,6 +44,22 @@ class SubTaskResource extends JsonResource
|
||||
// Pre drafty pridáme employees dáta
|
||||
if ($this->is_draft && $this->draft_data) {
|
||||
$data['employees'] = $this->draft_data;
|
||||
|
||||
// Agregované timeblocks zo všetkých zamestnancov pre kalendárne zobrazenie
|
||||
$allDraftTimeblocks = [];
|
||||
foreach ($this->draft_data as $employee) {
|
||||
if (isset($employee['timeblocks']) && is_array($employee['timeblocks'])) {
|
||||
foreach ($employee['timeblocks'] as $timeblock) {
|
||||
$allDraftTimeblocks[] = [
|
||||
'employee_id' => $employee['id'],
|
||||
'start' => $timeblock['start'] ?? null,
|
||||
'end' => $timeblock['end'] ?? null,
|
||||
'is_finished' => $timeblock['is_finished'] ?? false,
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
$data['all_draft_timeblocks'] = $allDraftTimeblocks;
|
||||
}
|
||||
|
||||
return $data;
|
||||
|
||||
Reference in new issue
Block a user