*
@@ -181,7 +181,7 @@ if (! empty($project_ref) && ! empty($withproject))
/*
* View
-*/
+ */
llxHeader("",$langs->trans("Task"));
@@ -193,7 +193,7 @@ if ($id > 0 || ! empty($ref))
{
/*
* Fiche projet en mode visu
- */
+ */
if ($object->fetch($id) >= 0)
{
$result=$projectstatic->fetch($object->fk_project);
@@ -292,9 +292,37 @@ if ($id > 0 || ! empty($ref))
// Label
print '| '.$langs->trans("Label").' | '.$object->label.' |
';
- // Planned workload
- print '| '.$langs->trans("PlannedWorkload").' | '.convertSecondToTime($object->planned_workload,'allhourmin').' |
';
-
+ // Date start
+ print '| '.$langs->trans("DateStart").' | ';
+ print dol_print_date($object->date_start,'dayhour');
+ print ' |
';
+
+ // Date end
+ print '| '.$langs->trans("DateEnd").' | ';
+ print dol_print_date($object->date_end,'dayhour');
+ print ' |
';
+
+ // Planned workload
+ print '| '.$langs->trans("PlannedWorkload").' | ';
+ print convertSecondToTime($object->planned_workload,'allhourmin');
+ print ' |
';
+
+ // Progress declared
+ print '| '.$langs->trans("ProgressDeclared").' | ';
+ print $object->progress.' %';
+ print ' |
';
+
+ // Progress calculated
+ print '| '.$langs->trans("ProgressCalculated").' | ';
+ if ($object->planned_workload)
+ {
+ $tmparray=$object->getSummaryOfTimeSpent();
+ if ($tmparray['total_duration'] > 0) print round($tmparray['total_duration']/$object->planned_workload*100, 2).' %';
+ else print '0 %';
+ }
+ else print '';
+ print ' |
';
+
// Project
if (empty($withproject))
{
@@ -316,7 +344,7 @@ if ($id > 0 || ! empty($ref))
/*
* Add time spent
- */
+ */
if ($user->rights->projet->creer)
{
print '
';
@@ -333,7 +361,7 @@ if ($id > 0 || ! empty($ref))
print ''.$langs->trans("Date").' | ';
print ''.$langs->trans("By").' | ';
print ''.$langs->trans("Note").' | ';
- print ''.$langs->trans("Progress").' | ';
+ print ''.$langs->trans("ProgressDeclared").' | ';
print ''.$langs->trans("Duration").' | ';
print ' | ';
print "\n";
@@ -363,14 +391,14 @@ if ($id > 0 || ! empty($ref))
print '';
print '';
- // Progress
+ // Progress declared
print '';
- print $formother->select_percent($object->progress,'progress');
+ print $formother->select_percent(GETPOST('progress')?GETPOST('progress'):$object->progress,'progress');
print ' | ';
// Duration
print '';
- print $form->select_duration('timespent_duration',($_POST['timespent_duration']?$_POST['timespent_duration']:''),0,'text');
+ print $form->select_duration('timespent_duration', ($_POST['timespent_duration']?$_POST['timespent_duration']:''), 0, 'text');
print ' | ';
print '';
@@ -384,7 +412,7 @@ if ($id > 0 || ! empty($ref))
/*
* List of time spent
- */
+ */
$sql = "SELECT t.rowid, t.task_date, t.task_duration, t.fk_user, t.note";
$sql.= ", u.lastname, u.firstname";
$sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t";
|