Skip to content

Commit

Permalink
#156 [TimeSpent] fix: missing daterange with conf DOLISIRH_SHOW_ONLY_…
Browse files Browse the repository at this point in the history
…TASKS_WITH_TIMESPENT
  • Loading branch information
nicolas-eoxia committed Feb 8, 2023
1 parent a3ff033 commit decdd0a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/dolisirh_function.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ function doliSirhGetTasksArray($usert = null, $userp = null, $projectid = 0, $so
} else if ($timeMode == 'day') {
$sql .= " AND DAY(ptt.task_date) = " . $timeArray['day'];
}
$sql .= ' AND (ptt.task_date >= "' . $db->idate($timeArray['firstdaytoshow']) . '" AND ptt.task_date < "' . $db->idate(dol_time_plus_duree($timeArray['lastdaytoshow'], 1, 'd')) . '")';
}

} elseif ($mode == 1) {
Expand Down
2 changes: 1 addition & 1 deletion view/timespent_month.php
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@
$morewherefilter .= Categorie::getFilterSelectQuery(Categorie::TYPE_PROJECT, 'p.rowid', $search_category_array);
}

$timeArray = ['year' => $year, 'month' => $month, 'week' => $week, 'day' => $day];
$timeArray = ['year' => $year, 'month' => $month, 'week' => $week, 'day' => $day, 'firstdaytoshow' => $firstdaytoshow, 'lastdaytoshow' => $lastdaytoshow];
$tasksarray = [];
$tasksarray = doliSirhGetTasksArray(0, 0, ($project->id ?: 0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter, ($search_usertoprocessid ? $search_usertoprocessid : 0), 0, $extrafields,0,array(), 0,$timeArray, 'month');

Expand Down
2 changes: 1 addition & 1 deletion view/timespent_week.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@
$morewherefilter .= Categorie::getFilterSelectQuery(Categorie::TYPE_PROJECT, 'p.rowid', $search_category_array);
}

$timeArray = array('year' => $year, 'month' => $month, 'week' => $week, 'day' => $day);
$timeArray = ['year' => $year, 'month' => $month, 'week' => $week, 'day' => $day, 'firstdaytoshow' => $firstdaytoshow, 'lastdaytoshow' => $lastdaytoshow];
$tasksarray = [];
$tasksarray = doliSirhGetTasksArray(0, 0, ($project->id ?: 0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter, ($search_usertoprocessid ? $search_usertoprocessid : 0), 0, $extrafields,0,array(), 0, $timeArray, 'week');

Expand Down

0 comments on commit decdd0a

Please sign in to comment.