FIX summary of time spent in preview tab of projects
This commit is contained in:
parent
2dccaef1cd
commit
559a902405
@ -599,13 +599,13 @@ class Project extends CommonObject
|
||||
$sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . $tablename." WHERE ".$projectkey." IN (". $ids .") AND entity IN (".getEntity($type).")";
|
||||
}
|
||||
|
||||
if ($dates > 0)
|
||||
if ($dates > 0 && ($type != 'project_task')) // For table project_taks, we want the filter on date apply on project_time_spent table
|
||||
{
|
||||
if (empty($datefieldname) && ! empty($this->table_element_date)) $datefieldname=$this->table_element_date;
|
||||
if (empty($datefieldname)) return 'Error this object has no date field defined';
|
||||
$sql.=" AND (".$datefieldname." >= '".$this->db->idate($dates)."' OR ".$datefieldname." IS NULL)";
|
||||
}
|
||||
if ($datee > 0)
|
||||
if ($datee > 0 && ($type != 'project_task')) // For table project_taks, we want the filter on date apply on project_time_spent table
|
||||
{
|
||||
if (empty($datefieldname) && ! empty($this->table_element_date)) $datefieldname=$this->table_element_date;
|
||||
if (empty($datefieldname)) return 'Error this object has no date field defined';
|
||||
|
||||
@ -532,7 +532,8 @@ if (! $showdatefilter)
|
||||
{
|
||||
print '<div class="center centpercent">';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$projectid.'" method="post">';
|
||||
print '<input type="hidden" name="tablename" value="'.$tablename.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION["newtoken"].'">';
|
||||
print '<input type="hidden" name="tablename" value="'.$tablename.'">';
|
||||
print '<input type="hidden" name="action" value="view">';
|
||||
print '<table class="center"><tr>';
|
||||
print '<td>'.$langs->trans("From").' ';
|
||||
@ -762,7 +763,8 @@ foreach ($listofreferent as $key => $value)
|
||||
// Define form with the combo list of elements to link
|
||||
$addform.='<div class="inline-block valignmiddle">';
|
||||
$addform.='<form action="'.$_SERVER["PHP_SELF"].'?id='.$projectid.'" method="post">';
|
||||
$addform.='<input type="hidden" name="tablename" value="'.$tablename.'">';
|
||||
$addform.='<input type="hidden" name="token" value="'.$_SESSION["newtoken"].'">';
|
||||
$addform.='<input type="hidden" name="tablename" value="'.$tablename.'">';
|
||||
$addform.='<input type="hidden" name="action" value="addelement">';
|
||||
$addform.='<input type="hidden" name="datesrfc" value="'.dol_print_date($dates, 'dayhourrfc').'">';
|
||||
$addform.='<input type="hidden" name="dateerfc" value="'.dol_print_date($datee, 'dayhourrfc').'">';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user