Skip to content

Commit

Permalink
#282 [ODT] fix: task info and timespent
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-eoxia committed Jun 7, 2023
1 parent e11e0a2 commit 31f74f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,14 @@ public function fillTagsLines(Odf $odfHandler, Translate $outputLangs, array $mo
if (is_array($allTasks) && !empty($allTasks)) {
foreach ($allTasks as $task) {
$tmpArray['project_task_ref'] = $task->ref;
$tmpArray['project_task_description'] = $task->description;
$tmpArray['project_task_timespent'] = convertSecondToTime($task->duration, 'allhourmin');
$tmpArray['project_task_label'] = $task->label;
$tmpArray['project_task_description'] = !empty($task->description) ? $task->description : ' ';
$tmpArray['project_task_timespent'] = !empty($task->duration) ? convertSecondToTime($task->duration, 'allhourmin') : ' ';
$this->setTmpArrayVars($tmpArray, $listLines, $outputLangs);
}
} else {
$tmpArray['project_task_ref'] = '';
$tmpArray['project_task_label'] = '';
$tmpArray['project_task_description'] = '';
$tmpArray['project_task_timespent'] = '';
$this->setTmpArrayVars($tmpArray, $listLines, $outputLangs);
Expand Down Expand Up @@ -209,10 +211,10 @@ public function fillTagsLines(Odf $odfHandler, Translate $outputLangs, array $mo
$filter = ' AND ptt.fk_task = ' . $task->id . ' AND ptt.fk_user = ' . $contact['id'];
$timespentsUser = $saturneTask->fetchAllTimeSpentAllUsers($filter);
foreach ($timespentsUser as $timespent) {
$tmpArray['project_task_timespent_date'] = dol_print_date($timespent->task_datehour, 'dayhour');
$tmpArray['project_task_timespent_date'] = dol_print_date($timespent->timespent_datehour, (($timespent->timespent_withhour > 0) ? 'dayhour' : 'day'));
$tmpArray['project_task_timespent_task_ref'] = $task->ref;
$tmpArray['project_task_timespent_user'] = strtoupper($contact['lastname']) . ' ' . ucfirst($contact['firstname']);
$tmpArray['project_task_timespent_note'] = $timespent->note;
$tmpArray['project_task_timespent_note'] = !empty($timespent->timespent_note) ? dol_htmlentitiesbr_decode($timespent->timespent_note) : ' ';
$tmpArray['project_task_timespent_duration'] = convertSecondToTime($timespent->timespent_duration, 'allhourmin');
$this->setTmpArrayVars($tmpArray, $listLines, $outputLangs);
}
Expand Down
Binary file modified documents/doctemplates/projectdocument/template_projectdocument.odt
Binary file not shown.

0 comments on commit 31f74f6

Please sign in to comment.