FIX : filter only if t.task_duration checked
This commit is contained in:
parent
3ed5edc003
commit
c84d17eced
@ -1629,16 +1629,20 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
$sql .= " AND t.task_date <= '".$db->idate($search_date_end)."'";
|
||||
}
|
||||
|
||||
if($search_timespent_starthour || $search_timespent_startmin) {
|
||||
$timespent_duration_start = $search_timespent_starthour * 60 * 60; // We store duration in seconds
|
||||
$timespent_duration_start += ($search_timespent_startmin ? $search_timespent_startmin : 0) * 60; // We store duration in seconds
|
||||
$sql .= " AND t.task_duration >= ".$timespent_duration_start;
|
||||
}
|
||||
if (!empty($arrayfields['t.task_duration']['checked'])) {
|
||||
|
||||
if($search_timespent_endhour || $search_timespent_endmin) {
|
||||
$timespent_duration_end = $search_timespent_endhour * 60 * 60; // We store duration in seconds
|
||||
$timespent_duration_end += ($search_timespent_endmin ? $search_timespent_endmin : 0) * 60; // We store duration in seconds
|
||||
$sql .= " AND t.task_duration <= ".$timespent_duration_end;
|
||||
if ($search_timespent_starthour || $search_timespent_startmin) {
|
||||
$timespent_duration_start = $search_timespent_starthour * 60 * 60; // We store duration in seconds
|
||||
$timespent_duration_start += ($search_timespent_startmin ? $search_timespent_startmin : 0) * 60; // We store duration in seconds
|
||||
$sql .= " AND t.task_duration >= " . $timespent_duration_start;
|
||||
}
|
||||
|
||||
if ($search_timespent_endhour || $search_timespent_endmin) {
|
||||
$timespent_duration_end = $search_timespent_endhour * 60 * 60; // We store duration in seconds
|
||||
$timespent_duration_end += ($search_timespent_endmin ? $search_timespent_endmin : 0) * 60; // We store duration in seconds
|
||||
$sql .= " AND t.task_duration <= " . $timespent_duration_end;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$sql .= dolSqlDateFilter('t.task_datehour', $search_day, $search_month, $search_year);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user