From a853aed348f2fcc9c8e0258beec591407f1b4634 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 3 Oct 2014 03:42:11 +0200 Subject: [PATCH] Fix: Some fields not visibles. Wrong value for calculated time. --- htdocs/projet/class/task.class.php | 2 +- htdocs/projet/tasks/task.php | 9 +++++---- htdocs/projet/tasks/time.php | 31 +++++++++++++++++++++++++----- 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index ea0cce9e121..c97b51e53a4 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -41,7 +41,7 @@ class Task extends CommonObject var $fk_task_parent; var $label; var $description; - var $duration_effective; + var $duration_effective; // total of time spent on this task var $planned_workload; var $date_c; var $date_start; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index dd83cf57d8f..908a9513162 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -348,7 +348,7 @@ if ($id > 0 || ! empty($ref)) print ''; // Progress - print ''.$langs->trans("Progress").''; + print ''.$langs->trans("ProgressDeclared").''; print $formother->select_percent($object->progress,'progress'); print ''; @@ -436,14 +436,15 @@ if ($id > 0 || ! empty($ref)) print convertSecondToTime($object->planned_workload,'allhourmin'); print ''; - // Progress + // Declared progress print ''.$langs->trans("ProgressDeclared").''; print $object->progress.' %'; print ''; - // Progress + // Calculated progress print ''.$langs->trans("ProgressCalculated").''; - print $object->progress.' %'; + if ($object->planned_workload) print round(100 * $object->duration_effective / $object->planned_workload,2).' %'; + else print ''; print ''; // Description diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index cb8a4dd193a..7136ffc43c5 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -50,7 +50,7 @@ $projectstatic = new Project($db); /* * Actions -*/ + */ if ($action == 'addtimespent' && $user->rights->projet->creer) { @@ -171,7 +171,7 @@ if (! empty($project_ref) && ! empty($withproject)) /* * View -*/ + */ llxHeader("",$langs->trans("Task")); @@ -283,9 +283,6 @@ if ($id > 0 || ! empty($ref)) // Label print ''.$langs->trans("Label").''.$object->label.''; - // Planned workload - print ''.$langs->trans("PlannedWorkload").''.convertSecondToTime($object->planned_workload,'allhourmin').''; - // Project if (empty($withproject)) { @@ -300,6 +297,30 @@ if ($id > 0 || ! empty($ref)) print ''; } + // 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").''.convertSecondToTime($object->planned_workload,'allhourmin').''; + + // Declared progress + print ''.$langs->trans("ProgressDeclared").''; + print $object->progress.' %'; + print ''; + + // Calculated progress + print ''.$langs->trans("ProgressCalculated").''; + if ($object->planned_workload) print round(100 * $object->duration_effective / $object->planned_workload,2).' %'; + else print ''; + print ''; + print ''; dol_fiche_end();