Skip to content

Commit

Permalink
Merge pull request #565 from evarisk-micka/fix_projectdocument
Browse files Browse the repository at this point in the history
#564 [Hook] fix: elementtype without the ptt for projectdocument task
  • Loading branch information
nicolas-eoxia authored Sep 18, 2024
2 parents a352035 + 37a7bbe commit 58eb534
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion class/actions_dolisirh.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ function getDiffTimestampEvent() {
}

if ($parameters['currentcontext'] == 'projectcard') {
if (GETPOST('action') == 'view' || empty(GETPOST('action'))) {
if (GETPOST('action') != 'create') {
global $user;

print '<link rel="stylesheet" type="text/css" href="../custom/saturne/css/saturne.min.css">';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function fillTagsLines(Odf $odfHandler, Translate $outputLangs, array $mo
$allTimespentUser = 0;
foreach ($allTasks as $task) {
if ($versionEighteenOrMore) {
$filter = ' AND fk_element = ' . $task->id . ' AND ptt.elementtype = "task" AND fk_user = ' . $contact['id'];
$filter = ' AND fk_element = ' . $task->id . ' AND elementtype = "task" AND fk_user = ' . $contact['id'];
} else {
$filter = ' AND fk_element = ' . $task->id . ' AND fk_user = ' . $contact['id'];
}
Expand Down Expand Up @@ -207,7 +207,7 @@ public function fillTagsLines(Odf $odfHandler, Translate $outputLangs, array $mo
if (is_array($allTasks) && !empty($allTasks)) {
foreach ($allTasks as $task) {
if ($versionEighteenOrMore) {
$filter = ' AND fk_element = ' . $task->id . ' AND ptt.elementtype = "task" AND fk_user = ' . $contact['id'];
$filter = ' AND fk_element = ' . $task->id . ' AND elementtype = "task" AND fk_user = ' . $contact['id'];
} else {
$filter = ' AND fk_element = ' . $task->id . ' AND fk_user = ' . $contact['id'];
}
Expand Down Expand Up @@ -333,9 +333,10 @@ public function write_file(SaturneDocuments $objectDocument, Translate $outputLa
if (is_array($tasksArray) && !empty($tasksArray)) {
$nbTasks = count($tasksArray);
foreach ($tasksArray as $task) {
$task->getSummaryOfTimeSpent();
$totalProgress += $task->progress;
$totalPlannedWorkload += $task->planned_workload;
$totalConsumedTime += $task->duration;
$totalConsumedTime += $task->timespent_total_duration;
}
$tmpArray['project_progress'] = (($totalProgress) ? price2num($totalProgress / $nbTasks, 2) . ' %' : '0 %');
$tmpArray['project_status'] = $object->getLibStatut();
Expand Down

0 comments on commit 58eb534

Please sign in to comment.