Fix: Display correct user in project tasks' time spent list

Use a local object rather than modifying the global $user object (sic!)
This commit is contained in:
Raphaël Doursenaud 2012-08-07 14:10:16 +02:00 committed by Regis Houssin
parent 7f7fa693f3
commit 34673e220d

View File

@ -403,17 +403,17 @@ if ($id > 0 || ! empty($ref))
print '</td>'; print '</td>';
// User // User
$user->id = $task_time->fk_user; $userstatic = new User($task_time->fk_user);
print '<td>'; print '<td>';
if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid) if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid)
{ {
print $form->select_users($user->id,'userid_line'); print $form->select_users($userstatic->id,'userid_line');
} }
else else
{ {
$user->nom = $task_time->name; $userstatic->nom = $task_time->name;
$user->prenom = $task_time->firstname; $userstatic->prenom = $task_time->firstname;
print $user->getNomUrl(1); print $userstatic->getNomUrl(1);
} }
print '</td>'; print '</td>';