Skip to content
Snippets Groups Projects
Commit dffd371c authored by Regis Houssin's avatar Regis Houssin
Browse files

Fix: only one records in database

parent fcb24424
No related branches found
No related tags found
No related merge requests found
...@@ -89,15 +89,20 @@ if ($_POST["action"] == 'addtime' && $user->rights->projet->creer) ...@@ -89,15 +89,20 @@ if ($_POST["action"] == 'addtime' && $user->rights->projet->creer)
if($matches[2]=='min') $timespent_duration += $time*60; if($matches[2]=='min') $timespent_duration += $time*60;
} }
} }
if(intval($time)<0) $mesg='<div class="error">'.$langs->trans("ErrorBadValue").'</div>';
} }
$task->fetch($id); if ($timespent_duration > O)
$task->timespent_duration = $timespent_duration; {
$task->timespent_fk_user = $user->id; $task->fetch($id);
$task->timespent_date = dol_mktime(12,0,0,$_POST["{$id}month"],$_POST["{$id}day"],$_POST["{$id}year"]); $task->timespent_duration = $timespent_duration;
$task->addTimeSpent($user); $task->timespent_fk_user = $user->id;
$task->timespent_date = dol_mktime(12,0,0,$_POST["{$id}month"],$_POST["{$id}day"],$_POST["{$id}year"]);
$task->addTimeSpent($user);
}
else
{
$mesg='<div class="error">'.$langs->trans("ErrorBadValue").'</div>';
}
} }
/* /*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment