';
print $lines[$i]->progress.' %';
diff --git a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql
index 5dd2ae69142..8d6cc91d1d1 100755
--- a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql
+++ b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql
@@ -18,4 +18,8 @@
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
-DELETE FROM llx_menu where module='holiday';
\ No newline at end of file
+DELETE FROM llx_menu where module='holiday';
+
+ALTER TABLE llx_projet_task ADD COLUMN duration_planned real DEFAULT 0 NOT NULL AFTER duration_effective;
+
+
diff --git a/htdocs/install/mysql/tables/llx_projet_task.sql b/htdocs/install/mysql/tables/llx_projet_task.sql
index ff54d3cec21..8e12ec8f973 100644
--- a/htdocs/install/mysql/tables/llx_projet_task.sql
+++ b/htdocs/install/mysql/tables/llx_projet_task.sql
@@ -29,7 +29,8 @@ create table llx_projet_task
datev datetime, -- date validation
label varchar(255) NOT NULL,
description text,
- duration_effective real DEFAULT 0 NOT NULL,
+ duration_effective real DEFAULT 0 NOT NULL,
+ duration_planned real DEFAULT 0 NOT NULL,
progress integer DEFAULT 0, -- percentage increase
priority integer DEFAULT 0, -- priority
fk_user_creat integer, -- user who created the task
diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php
index a177ddf838b..18824f81140 100644
--- a/htdocs/projet/class/task.class.php
+++ b/htdocs/projet/class/task.class.php
@@ -41,6 +41,7 @@ class Task extends CommonObject
var $label;
var $description;
var $duration_effective;
+ var $duration_planned;
var $date_c;
var $date_start;
var $date_end;
@@ -101,6 +102,7 @@ class Task extends CommonObject
$sql.= ", fk_user_creat";
$sql.= ", dateo";
$sql.= ", datee";
+ $sql.= ", duration_planned";
$sql.= ", progress";
$sql.= ") VALUES (";
$sql.= $this->fk_project;
@@ -111,6 +113,7 @@ class Task extends CommonObject
$sql.= ", ".$user->id;
$sql.= ", ".($this->date_start!=''?"'".$this->db->idate($this->date_start)."'":'null');
$sql.= ", ".($this->date_end!=''?"'".$this->db->idate($this->date_end)."'":'null');
+ $sql.= ", ".($this->duration_planned!=''?$this->duration_planned:0);
$sql.= ", ".($this->progress!=''?$this->progress:0);
$sql.= ")";
@@ -183,6 +186,7 @@ class Task extends CommonObject
$sql.= " t.label,";
$sql.= " t.description,";
$sql.= " t.duration_effective,";
+ $sql.= " t.duration_planned,";
$sql.= " t.datec,";
$sql.= " t.dateo,";
$sql.= " t.datee,";
@@ -211,6 +215,7 @@ class Task extends CommonObject
$this->label = $obj->label;
$this->description = $obj->description;
$this->duration_effective = $obj->duration_effective;
+ $this->duration_planned = $obj->duration_planned;
$this->date_c = $this->db->jdate($obj->datec);
$this->date_start = $this->db->jdate($obj->dateo);
$this->date_end = $this->db->jdate($obj->datee);
@@ -254,6 +259,7 @@ class Task extends CommonObject
if (isset($this->label)) $this->label=trim($this->label);
if (isset($this->description)) $this->description=trim($this->description);
if (isset($this->duration_effective)) $this->duration_effective=trim($this->duration_effective);
+ if (isset($this->duration_planned)) $this->duration_planned=trim($this->duration_planned);
// Check parameters
// Put here code to add control on parameters values
@@ -265,6 +271,7 @@ class Task extends CommonObject
$sql.= " label=".(isset($this->label)?"'".$this->db->escape($this->label)."'":"null").",";
$sql.= " description=".(isset($this->description)?"'".$this->db->escape($this->description)."'":"null").",";
$sql.= " duration_effective=".(isset($this->duration_effective)?$this->duration_effective:"null").",";
+ $sql.= " duration_planned=".(isset($this->duration_planned)?$this->duration_planned:"0").",";
$sql.= " dateo=".($this->date_start!=''?$this->db->idate($this->date_start):'null').",";
$sql.= " datee=".($this->date_end!=''?$this->db->idate($this->date_end):'null').",";
$sql.= " progress=".$this->progress;
@@ -524,7 +531,7 @@ class Task extends CommonObject
// List of tasks (does not care about permissions. Filtering will be done later)
$sql = "SELECT p.rowid as projectid, p.ref, p.title as plabel, p.public,";
$sql.= " t.rowid as taskid, t.label, t.description, t.fk_task_parent, t.duration_effective, t.progress,";
- $sql.= " t.dateo as date_start, t.datee as date_end";
+ $sql.= " t.dateo as date_start, t.datee as date_end, t.duration_planned";
if ($mode == 0)
{
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
@@ -586,6 +593,7 @@ class Task extends CommonObject
$tasks[$i]->description = $obj->description;
$tasks[$i]->fk_parent = $obj->fk_task_parent;
$tasks[$i]->duration = $obj->duration_effective;
+ $tasks[$i]->duration_planned= $obj->duration_planned;
$tasks[$i]->progress = $obj->progress;
$tasks[$i]->public = $obj->public;
$tasks[$i]->date_start = $this->db->jdate($obj->date_start);
@@ -997,6 +1005,7 @@ class Task extends CommonObject
$clone_task->fk_project = $project_id;
$clone_task->fk_task_parent = $parent_task_id;
$clone_task->date_c = $datec;
+ $clone_task->duration_planned = $clone_task->duration_planned;
//Manage Task Date
if ($clone_change_dt)
diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php
index 0cd8fd9ca64..fc17df207d5 100644
--- a/htdocs/projet/index.php
+++ b/htdocs/projet/index.php
@@ -1,21 +1,21 @@
* Copyright (C) 2004-2010 Laurent Destailleur
- * Copyright (C) 2005-2010 Regis Houssin
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
+* Copyright (C) 2005-2010 Regis Houssin
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see .
+*/
/**
* \file htdocs/projet/index.php
@@ -44,7 +44,7 @@ $sortorder = GETPOST("sortorder",'alpha');
/*
* View
- */
+*/
$socstatic=new Societe($db);
$projectstatic=new Project($db);
@@ -132,10 +132,82 @@ else
}
print "";
+print '
';
print '';
+print '
';
+print ' ';
+print '
';
+print '
';
+print '
'.$langs->trans('TaskRessourceLinks').'
';
+print '
'.$langs->trans('Projects').'
';
+print '
'.$langs->trans('Task').'
';
+print '
'.$langs->trans('DateStart').'
';
+print '
'.$langs->trans('DateEnd').'
';
+print '
'.$langs->trans('TaskRessourceLinks').' %
';
+print '
';
+
+
+$sql = "SELECT p.title, p.rowid as projectid, t.label, t.rowid as taskid, u.rowid as userid, t.duration_planned, t.dateo, t.datee, (tasktime.task_duration/3600) as totaltime";
+$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
+$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
+$sql.= " INNER JOIN ".MAIN_DB_PREFIX."projet_task as t on t.fk_projet = p.rowid";
+$sql.= " INNER JOIN ".MAIN_DB_PREFIX."projet_task_time as tasktime on tasktime.fk_task = t.rowid";
+$sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u on tasktime.fk_user = u.rowid";
+$sql.= " WHERE p.entity = ".$conf->entity;
+if ($mine || ! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")";
+if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")";
+$sql.= " ORDER BY u.rowid, t.dateo, t.datee";
+
+$userstatic=new User($db);
+
+$resql = $db->query($sql);
+if ( $resql )
+{
+ $num = $db->num_rows($resql);
+ $i = 0;
+
+ while ($i < $num)
+ {
+ $obj = $db->fetch_object($resql);
+ $var=!$var;
+
+ $username='';
+ $userstatic->fetch($obj->userid);
+ if (!empty($userstatic->id)) {
+ $username = $userstatic->getNomUrl(0,0);
+ }
+
+ print "