Skip to content

Commit

Permalink
#47 [TimeSpent] add: filter exclude project
Browse files Browse the repository at this point in the history
  • Loading branch information
evarisk-theo committed Nov 4, 2022
1 parent 4874cfe commit c3c533f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/dolisirh_function.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ function loadTimeSpentWithinRangeByProject($datestart, $dateend, $project_id, $t
* @return array Array with minutes, hours and total time spent
* @throws Exception
*/
function loadTimeSpentWithinRange($datestart, $dateend, $taskid = 0, $userid = 0)
function loadTimeSpentWithinRange($datestart, $dateend, $taskid = 0, $userid = 0, $exclude_project = 0)
{
global $db;

Expand All @@ -333,6 +333,9 @@ function loadTimeSpentWithinRange($datestart, $dateend, $taskid = 0, $userid = 0
if ($userid) {
$sql .= " AND ptt.fk_user=".((int) $userid);
}
if ($exclude_project) {
$sql .= " AND pt.fk_projet != ". $exclude_project;
}

$timeSpent = array(
'days' => 0,
Expand Down

0 comments on commit c3c533f

Please sign in to comment.