Fix bad date on time spent view

This commit is contained in:
Laurent Destailleur 2017-10-06 14:38:33 +02:00
parent afc1938676
commit 1becbb8805
2 changed files with 10 additions and 9 deletions

View File

@ -640,12 +640,6 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]);
print "</td>";
// Ref
print '<td>';
$taskstatic->ref=($lines[$i]->ref?$lines[$i]->ref:$lines[$i]->id);
print $taskstatic->getNomUrl(1,'withproject');
print '</td>';
if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY))
{
// Thirdparty
@ -656,6 +650,12 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
print '</td>';
}
// Ref
print '<td>';
$taskstatic->ref=($lines[$i]->ref?$lines[$i]->ref:$lines[$i]->id);
print $taskstatic->getNomUrl(1, 'withproject', 'time');
print '</td>';
// Label task
print "<td>";
for ($k = 0 ; $k < $level ; $k++) print "&nbsp;&nbsp;&nbsp;";
@ -663,7 +663,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
$taskstatic->ref=$lines[$i]->label;
$taskstatic->date_start=$lines[$i]->date_start;
$taskstatic->date_end=$lines[$i]->date_end;
print $taskstatic->getNomUrl(0,'withproject');
print $taskstatic->getNomUrl(0, 'withproject', 'time');
//print "<br>";
//for ($k = 0 ; $k < $level ; $k++) print "&nbsp;&nbsp;&nbsp;";
//print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0);

View File

@ -241,13 +241,14 @@ if ($action == 'addtime' && $user->rights->projet->lire)
$object->timespent_note = GETPOST($key.'note');
if (GETPOST($key."hour") != '' && GETPOST($key."hour") >= 0) // If hour was entered
{
$object->timespent_date = dol_mktime(GETPOST($key."hour"),GETPOST($key."min"),0,$monthofday,$dayofday,$yearofday);
$object->timespent_datehour = dol_mktime(GETPOST($key."hour"),GETPOST($key."min"),0,$monthofday,$dayofday,$yearofday);
$object->timespent_withhour = 1;
}
else
{
$object->timespent_date = dol_mktime(12,0,0,$monthofday,$dayofday,$yearofday);
$object->timespent_datehour = dol_mktime(12,0,0,$monthofday,$dayofday,$yearofday);
}
$object->timespent_date = $object->timespent_datehour;
if ($object->timespent_date > 0)
{