diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index f5eab2587cf..7721633c4e8 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -430,6 +430,8 @@ if ($id > 0 || ! empty($ref))
/*
* List of time spent
*/
+ $tasks = array();
+
$sql = "SELECT t.rowid, t.task_date, t.task_datehour, t.task_date_withhour, t.task_duration, t.fk_user, t.note, t.thm";
$sql.= ", u.lastname, u.firstname";
$sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t";
@@ -444,7 +446,6 @@ if ($id > 0 || ! empty($ref))
{
$num = $db->num_rows($resql);
$i = 0;
- $tasks = array();
while ($i < $num)
{
$row = $db->fetch_object($resql);
@@ -470,7 +471,7 @@ if ($id > 0 || ! empty($ref))
print '
'.$langs->trans("By").' | ';
print ''.$langs->trans("Note").' | ';
print ''.$langs->trans("TimeSpent").' | ';
- if ($conf->salaries->enabled)
+ if (! empty($conf->salaries->enabled))
{
print ''.$langs->trans("Value").' | ';
}
@@ -491,11 +492,11 @@ if ($id > 0 || ! empty($ref))
print '';
if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid)
{
- print $form->select_date($db->jdate($date2?$date2:$date1),'timeline',1,1,2,"timespent_date",1,0,1);
+ print $form->select_date(($date2?$date2:$date1),'timeline',1,1,2,"timespent_date",1,0,1);
}
else
{
- print dol_print_date($date2?$date2:$date1,($task_time->task_date_withhour?'dayhour':'day'));
+ print dol_print_date(($date2?$date2:$date1),($task_time->task_date_withhour?'dayhour':'day'));
}
print ' | ';