diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index ce2e1c32889..7dc9fe10930 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -602,7 +602,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
if ($projectstatic->id > 0)
{
- if ($action == 'deleteline')
+ if ($action == 'deleteline' && ! empty($projectidforalltimes))
{
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id.'&lineid='.$_GET["lineid"].($withproject?'&withproject=1':''),$langs->trans("DeleteATimeSpent"),$langs->trans("ConfirmDeleteATimeSpent"),"confirm_delete",'','',1);
}
@@ -976,12 +976,12 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
if ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids) || $user->rights->projet->all->creer)
{
print ' ';
- print 'fk_task.'&action=editline&lineid='.$task_time->rowid.($withproject?'&withproject=1':'').'">';
+ print 'fk_task.'&action=editline&lineid='.$task_time->rowid.($withproject?'&withproject=1':'').'">';
print img_edit();
print '';
print ' ';
- print 'fk_task.'&action=deleteline&lineid='.$task_time->rowid.($withproject?'&withproject=1':'').'">';
+ print 'fk_task.'&action=deleteline&lineid='.$task_time->rowid.($withproject?'&withproject=1':'').'">';
print img_delete();
print '';
}