From e776f685ba3c509fe64eb07534b1e8f77d33365d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 6 Oct 2015 16:09:24 +0200 Subject: [PATCH] FIX when editing time spent, date of line suggested was a rubbish value --- htdocs/projet/tasks/time.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 '';