From 8044300ef7908cf81122f10483a6a0e55a1aa730 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 23 May 2010 20:37:28 +0000 Subject: [PATCH] Work on gantt view. --- htdocs/langs/en_US/projects.lang | 1 + htdocs/langs/fr_FR/projects.lang | 1 + htdocs/projet/contact.php | 3 +- htdocs/projet/element.php | 3 +- htdocs/projet/ganttview.php | 65 ++++++++++++++++++-------------- htdocs/projet/tasks/fiche.php | 13 +++++-- 6 files changed, 52 insertions(+), 34 deletions(-) diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index db69bca7b3b..789dc994540 100755 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -78,6 +78,7 @@ DoNotShowMyTasksOnly=See also tasks i am not affected to ShowMyTasksOnly=View only tasks i am affected to TaskRessourceLinks=Ressources ProjectsDedicatedToThisThirdParty=Projects dedicated to this third party +NoTasks=No tasks for this project ##### Types de contacts ##### TypeContact_project_internal_PROJECTLEADER=Project leader TypeContact_project_external_PROJECTLEADER=Project leader diff --git a/htdocs/langs/fr_FR/projects.lang b/htdocs/langs/fr_FR/projects.lang index 097c6c4f3e3..6ff8c44a734 100755 --- a/htdocs/langs/fr_FR/projects.lang +++ b/htdocs/langs/fr_FR/projects.lang @@ -78,6 +78,7 @@ DoNotShowMyTasksOnly=Voir aussi les taches qui ne me sont pas affectées ShowMyTasksOnly=Ne voir que les taches qui me sont affectées TaskRessourceLinks=Affectation ressources ProjectsDedicatedToThisThirdParty=Projets dédiés à ce tiers +NoTasks=Aucune tache pour ce projet ##### Types de contacts ##### TypeContact_project_internal_PROJECTLEADER=Chef de projet TypeContact_project_external_PROJECTLEADER=Chef de projet diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index 57136f0c2c9..7783583f8cf 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -157,7 +157,8 @@ if ($_GET["action"] == 'deleteline' && $user->rights->projet->creer) * View */ -llxHeader('', $langs->trans("Project"), "Project"); +$help_url="EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"; +llxHeader('', $langs->trans("Project"), $help_url); $html = new Form($db); $formcompany= new FormCompany($db); diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 6f9e05b3356..87617117162 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -73,7 +73,8 @@ $result = restrictedArea($user, 'projet', $projectid); * View */ -llxHeader("",$langs->trans("Referers"),"EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"); +$help_url="EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"; +llxHeader("",$langs->trans("Referers"),$help_url); $form = new Form($db); diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index 9a3037c24d6..f8b97184082 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -179,37 +179,44 @@ $tasksrole=($_REQUEST["mode"]=='mine' ? $task->getUserRolesForProjectsOrTasks(0, //var_dump($tasksrole); -// Show Gant diagram from $taskarray using JSGantt - -$dateformat=$langs->trans("FormatDateShort"); -$dateformat=strtolower($langs->trans("FormatDateShortJava")); -$array_contacts=array(); -$tasks=array(); -$project_dependencies=array(); -$project_id=$project->id; -$i=0; -foreach($tasksarray as $key => $val) +if (sizeof($tasksarray)>0) { -// if ($val->date_start && $val->date_end) -// { - $tasks[$i]['task_id']=$val->id; - $tasks[$i]['task_parent']=$val->fk_parent; - $tasks[$i]['task_is_group']=0; - $tasks[$i]['task_milestone']=0; - $tasks[$i]['task_percent_complete']=$val->progress; - $tasks[$i]['task_name']=$val->label; - $tasks[$i]['task_start_date']=$val->date_start; - $tasks[$i]['task_end_date']=$val->date_end; - $i++; -// } + + // Show Gant diagram from $taskarray using JSGantt + + $dateformat=$langs->trans("FormatDateShort"); + $dateformat=strtolower($langs->trans("FormatDateShortJava")); + $array_contacts=array(); + $tasks=array(); + $project_dependencies=array(); + $project_id=$project->id; + $i=0; + foreach($tasksarray as $key => $val) + { + // if ($val->date_start && $val->date_end) + // { + $tasks[$i]['task_id']=$val->id; + $tasks[$i]['task_parent']=$val->fk_parent; + $tasks[$i]['task_is_group']=0; + $tasks[$i]['task_milestone']=0; + $tasks[$i]['task_percent_complete']=$val->progress; + $tasks[$i]['task_name']=$val->label; + $tasks[$i]['task_start_date']=$val->date_start; + $tasks[$i]['task_end_date']=$val->date_end; + $i++; + // } + } + //var_dump($tasks); + + print "\n"; + print '
'."\n"; + include_once(DOL_DOCUMENT_ROOT.'/projet/ganttchart.php'); + print '
'."\n"; +} +else +{ + print $langs->trans("NoTasks"); } -//var_dump($tasks); - -print "\n"; -print '
'."\n"; -include_once(DOL_DOCUMENT_ROOT.'/projet/ganttchart.php'); -print '
'."\n"; - $db->close(); diff --git a/htdocs/projet/tasks/fiche.php b/htdocs/projet/tasks/fiche.php index 19a2769980f..e6c9b9da7d2 100644 --- a/htdocs/projet/tasks/fiche.php +++ b/htdocs/projet/tasks/fiche.php @@ -309,9 +309,16 @@ else print ''.$langs->trans("Progress").''; print ''.$langs->trans("TimeSpent").''; print "\n"; - // Show all lines in taskarray (recursive function to go down on tree) - $j=0; - $nboftaskshown=PLines($j, 0, $tasksarray, $level, true, 0, $tasksrole); + if (sizeof($tasksarray) > 0) + { + // Show all lines in taskarray (recursive function to go down on tree) + $j=0; + $nboftaskshown=PLines($j, 0, $tasksarray, $level, true, 0, $tasksrole); + } + else + { + print ''.$langs->trans("NoTasks").''; + } print "";