Skip to content

Commit

Permalink
#212 [TimeSpent] fix: show child task of task with DOLISIRH_SHOW_ONLY…
Browse files Browse the repository at this point in the history
…_TASKS_WITH_TIMESPENT conf
  • Loading branch information
nicolas-eoxia committed Apr 5, 2023
1 parent 0e69406 commit 701f11d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/dolisirh_function.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,6 @@ function doliSirhGetTasksArray($usert = null, $userp = null, $projectid = 0, $so
}
$sql .= " AND YEAR(ptt.task_date) = " . $timeArray['year'];
}

} elseif ($mode == 1) {
if ($filteronprojuser > 0) {
$sql .= ", ".MAIN_DB_PREFIX."element_contact as ec";
Expand Down Expand Up @@ -1180,12 +1179,16 @@ function doliSirhTaskLinesWithinRange(&$inc, $firstdaytoshow, $lastdaytoshow, $f
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$restrictBefore = dol_time_plus_duree(dol_now(), - $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS, 'm');
}

for ($i = 0; $i < $numlines; $i++) {
if ($parent == 0) {
$level = 0;
}

if ($lines[$i]->fk_task_parent != $parent && $user->conf->DOLISIRH_SHOW_ONLY_TASKS_WITH_TIMESPENT) {
$lines[$i]->fk_task_parent = 0;
}

if ($lines[$i]->fk_task_parent == $parent) {
$obj = &$lines[$i]; // To display extrafields
// If we want all or we have a role on task, we show it
Expand Down

0 comments on commit 701f11d

Please sign in to comment.