Change duration _planned by planned_workload
This commit is contained in:
parent
f98442d700
commit
d0b4cef7a4
@ -422,7 +422,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
|||||||
|
|
||||||
// Duration
|
// Duration
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print $lines[$i]->duration_planned.' '.$langs->trans('Hours');
|
print $lines[$i]->planned_workload.' '.$langs->trans('Hours');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Progress
|
// Progress
|
||||||
@ -557,7 +557,7 @@ function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksr
|
|||||||
|
|
||||||
// Duration
|
// Duration
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print $lines[$i]->duration_planned.' '.$langs->trans('Hours');
|
print $lines[$i]->planned_workload.' '.$langs->trans('Hours');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Progress
|
// Progress
|
||||||
|
|||||||
@ -157,18 +157,18 @@ class modProjet extends DolibarrModules
|
|||||||
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country',
|
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country',
|
||||||
's.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode',
|
's.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode',
|
||||||
'p.rowid'=>"ProjectId",'p.ref'=>"ProjectRef",'p.datec'=>"DateCreation",'p.dateo'=>"DateDebutProjet",'p.datee'=>"DateFinProjet",'p.fk_statut'=>'ProjectStatus','p.description'=>"projectNote",
|
'p.rowid'=>"ProjectId",'p.ref'=>"ProjectRef",'p.datec'=>"DateCreation",'p.dateo'=>"DateDebutProjet",'p.datee'=>"DateFinProjet",'p.fk_statut'=>'ProjectStatus','p.description'=>"projectNote",
|
||||||
'pt.rowid'=>'RefTask','pt.dateo'=>"TaskDateo",'pt.datee'=>"TaskDatee",'pt.duration_effective'=>"DurationEffective",'pt.duration_planned'=>"DurationPlanned",'pt.progress'=>"Progress",'pt.description'=>"TaskDesc");
|
'pt.rowid'=>'RefTask','pt.dateo'=>"TaskDateo",'pt.datee'=>"TaskDatee",'pt.duration_effective'=>"DurationEffective",'pt.planned_workload'=>"DurationPlanned",'pt.progress'=>"Progress",'pt.description'=>"TaskDesc");
|
||||||
|
|
||||||
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle',
|
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle',
|
||||||
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle',
|
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle',
|
||||||
's.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text',
|
's.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text',
|
||||||
'p.rowid'=>"List:projet:ref",'p.ref'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','p.description'=>"Text",
|
'p.rowid'=>"List:projet:ref",'p.ref'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','p.description'=>"Text",
|
||||||
'pt.dateo'=>"Date",'pt.datee'=>"Date",'pt.duration_effective'=>"Duree",'pt.duration_planned'=>"Duree",'pt.progress'=>"Number",'pt.description'=>"Text");
|
'pt.dateo'=>"Date",'pt.datee'=>"Date",'pt.duration_effective'=>"Duree",'pt.planned_workload'=>"Duree",'pt.progress'=>"Number",'pt.description'=>"Text");
|
||||||
|
|
||||||
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company',
|
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company',
|
||||||
's.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company',
|
's.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company',
|
||||||
'f.rowid'=>"project",'f.ref'=>"project",'f.datec'=>"project",'f.duree'=>"project",'f.fk_statut'=>"project",'f.description'=>"project",
|
'f.rowid'=>"project",'f.ref'=>"project",'f.datec'=>"project",'f.duree'=>"project",'f.fk_statut'=>"project",'f.description'=>"project",
|
||||||
'pt.rowid'=>'task','pt.dateo'=>"task",'pt.datee'=>"task",'pt.duration_effective'=>"task",'pt.duration_planned'=>"task",'pt.progress'=>"task",'pt.description'=>"task");
|
'pt.rowid'=>'task','pt.dateo'=>"task",'pt.datee'=>"task",'pt.duration_effective'=>"task",'pt.planned_workload'=>"task",'pt.progress'=>"task",'pt.description'=>"task");
|
||||||
|
|
||||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||||
$this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'projet as p, '.MAIN_DB_PREFIX.'projet_task as pt, '.MAIN_DB_PREFIX.'societe as s)';
|
$this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'projet as p, '.MAIN_DB_PREFIX.'projet_task as pt, '.MAIN_DB_PREFIX.'societe as s)';
|
||||||
|
|||||||
@ -20,6 +20,6 @@
|
|||||||
|
|
||||||
DELETE FROM llx_menu where module='holiday';
|
DELETE FROM llx_menu where module='holiday';
|
||||||
|
|
||||||
ALTER TABLE llx_projet_task ADD COLUMN duration_planned real DEFAULT 0 NOT NULL AFTER duration_effective;
|
ALTER TABLE llx_projet_task ADD COLUMN planned_workload real DEFAULT 0 NOT NULL AFTER duration_effective;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ create table llx_projet_task
|
|||||||
label varchar(255) NOT NULL,
|
label varchar(255) NOT NULL,
|
||||||
description text,
|
description text,
|
||||||
duration_effective real DEFAULT 0 NOT NULL,
|
duration_effective real DEFAULT 0 NOT NULL,
|
||||||
duration_planned real DEFAULT 0 NOT NULL,
|
planned_workload real DEFAULT 0 NOT NULL,
|
||||||
progress integer DEFAULT 0, -- percentage increase
|
progress integer DEFAULT 0, -- percentage increase
|
||||||
priority integer DEFAULT 0, -- priority
|
priority integer DEFAULT 0, -- priority
|
||||||
fk_user_creat integer, -- user who created the task
|
fk_user_creat integer, -- user who created the task
|
||||||
|
|||||||
@ -105,3 +105,5 @@ TypeContact_project_task_internal_CONTRIBUTOR=Contributor
|
|||||||
TypeContact_project_task_external_CONTRIBUTOR=Contributor
|
TypeContact_project_task_external_CONTRIBUTOR=Contributor
|
||||||
# Documents models
|
# Documents models
|
||||||
DocumentModelBaleine=A complete project's report model (logo...)
|
DocumentModelBaleine=A complete project's report model (logo...)
|
||||||
|
PlannedWorkload = Planned workload
|
||||||
|
WorkloadOccupation= Workload affectation
|
||||||
@ -107,3 +107,5 @@ TypeContact_project_task_external_CONTRIBUTOR=Intervenant
|
|||||||
DocumentModelBaleine=Modèle de rapport de projet complet (logo...)
|
DocumentModelBaleine=Modèle de rapport de projet complet (logo...)
|
||||||
SelectElement=Eléments associable au projet :
|
SelectElement=Eléments associable au projet :
|
||||||
AddElement=Associer
|
AddElement=Associer
|
||||||
|
PlannedWorkload = Charge de travail prévue
|
||||||
|
WorkloadOccupation= Pourcentage affectation
|
||||||
@ -41,7 +41,7 @@ class Task extends CommonObject
|
|||||||
var $label;
|
var $label;
|
||||||
var $description;
|
var $description;
|
||||||
var $duration_effective;
|
var $duration_effective;
|
||||||
var $duration_planned;
|
var $planned_workload;
|
||||||
var $date_c;
|
var $date_c;
|
||||||
var $date_start;
|
var $date_start;
|
||||||
var $date_end;
|
var $date_end;
|
||||||
@ -102,7 +102,7 @@ class Task extends CommonObject
|
|||||||
$sql.= ", fk_user_creat";
|
$sql.= ", fk_user_creat";
|
||||||
$sql.= ", dateo";
|
$sql.= ", dateo";
|
||||||
$sql.= ", datee";
|
$sql.= ", datee";
|
||||||
$sql.= ", duration_planned";
|
$sql.= ", planned_workload";
|
||||||
$sql.= ", progress";
|
$sql.= ", progress";
|
||||||
$sql.= ") VALUES (";
|
$sql.= ") VALUES (";
|
||||||
$sql.= $this->fk_project;
|
$sql.= $this->fk_project;
|
||||||
@ -113,7 +113,7 @@ class Task extends CommonObject
|
|||||||
$sql.= ", ".$user->id;
|
$sql.= ", ".$user->id;
|
||||||
$sql.= ", ".($this->date_start!=''?"'".$this->db->idate($this->date_start)."'":'null');
|
$sql.= ", ".($this->date_start!=''?"'".$this->db->idate($this->date_start)."'":'null');
|
||||||
$sql.= ", ".($this->date_end!=''?"'".$this->db->idate($this->date_end)."'":'null');
|
$sql.= ", ".($this->date_end!=''?"'".$this->db->idate($this->date_end)."'":'null');
|
||||||
$sql.= ", ".($this->duration_planned!=''?$this->duration_planned:0);
|
$sql.= ", ".($this->planned_workload!=''?$this->planned_workload:0);
|
||||||
$sql.= ", ".($this->progress!=''?$this->progress:0);
|
$sql.= ", ".($this->progress!=''?$this->progress:0);
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ class Task extends CommonObject
|
|||||||
$sql.= " t.label,";
|
$sql.= " t.label,";
|
||||||
$sql.= " t.description,";
|
$sql.= " t.description,";
|
||||||
$sql.= " t.duration_effective,";
|
$sql.= " t.duration_effective,";
|
||||||
$sql.= " t.duration_planned,";
|
$sql.= " t.planned_workload,";
|
||||||
$sql.= " t.datec,";
|
$sql.= " t.datec,";
|
||||||
$sql.= " t.dateo,";
|
$sql.= " t.dateo,";
|
||||||
$sql.= " t.datee,";
|
$sql.= " t.datee,";
|
||||||
@ -215,7 +215,7 @@ class Task extends CommonObject
|
|||||||
$this->label = $obj->label;
|
$this->label = $obj->label;
|
||||||
$this->description = $obj->description;
|
$this->description = $obj->description;
|
||||||
$this->duration_effective = $obj->duration_effective;
|
$this->duration_effective = $obj->duration_effective;
|
||||||
$this->duration_planned = $obj->duration_planned;
|
$this->planned_workload = $obj->planned_workload;
|
||||||
$this->date_c = $this->db->jdate($obj->datec);
|
$this->date_c = $this->db->jdate($obj->datec);
|
||||||
$this->date_start = $this->db->jdate($obj->dateo);
|
$this->date_start = $this->db->jdate($obj->dateo);
|
||||||
$this->date_end = $this->db->jdate($obj->datee);
|
$this->date_end = $this->db->jdate($obj->datee);
|
||||||
@ -259,7 +259,7 @@ class Task extends CommonObject
|
|||||||
if (isset($this->label)) $this->label=trim($this->label);
|
if (isset($this->label)) $this->label=trim($this->label);
|
||||||
if (isset($this->description)) $this->description=trim($this->description);
|
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_effective)) $this->duration_effective=trim($this->duration_effective);
|
||||||
if (isset($this->duration_planned)) $this->duration_planned=trim($this->duration_planned);
|
if (isset($this->planned_workload)) $this->planned_workload=trim($this->planned_workload);
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
// Put here code to add control on parameters values
|
// Put here code to add control on parameters values
|
||||||
@ -271,7 +271,7 @@ class Task extends CommonObject
|
|||||||
$sql.= " label=".(isset($this->label)?"'".$this->db->escape($this->label)."'":"null").",";
|
$sql.= " label=".(isset($this->label)?"'".$this->db->escape($this->label)."'":"null").",";
|
||||||
$sql.= " description=".(isset($this->description)?"'".$this->db->escape($this->description)."'":"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_effective=".(isset($this->duration_effective)?$this->duration_effective:"null").",";
|
||||||
$sql.= " duration_planned=".(isset($this->duration_planned)?$this->duration_planned:"0").",";
|
$sql.= " planned_workload=".(isset($this->planned_workload)?$this->planned_workload:"0").",";
|
||||||
$sql.= " dateo=".($this->date_start!=''?$this->db->idate($this->date_start):'null').",";
|
$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.= " datee=".($this->date_end!=''?$this->db->idate($this->date_end):'null').",";
|
||||||
$sql.= " progress=".$this->progress;
|
$sql.= " progress=".$this->progress;
|
||||||
@ -531,7 +531,7 @@ class Task extends CommonObject
|
|||||||
// List of tasks (does not care about permissions. Filtering will be done later)
|
// 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 = "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.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, t.duration_planned";
|
$sql.= " t.dateo as date_start, t.datee as date_end, t.planned_workload";
|
||||||
if ($mode == 0)
|
if ($mode == 0)
|
||||||
{
|
{
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||||
@ -593,7 +593,7 @@ class Task extends CommonObject
|
|||||||
$tasks[$i]->description = $obj->description;
|
$tasks[$i]->description = $obj->description;
|
||||||
$tasks[$i]->fk_parent = $obj->fk_task_parent;
|
$tasks[$i]->fk_parent = $obj->fk_task_parent;
|
||||||
$tasks[$i]->duration = $obj->duration_effective;
|
$tasks[$i]->duration = $obj->duration_effective;
|
||||||
$tasks[$i]->duration_planned= $obj->duration_planned;
|
$tasks[$i]->planned_workload= $obj->planned_workload;
|
||||||
$tasks[$i]->progress = $obj->progress;
|
$tasks[$i]->progress = $obj->progress;
|
||||||
$tasks[$i]->public = $obj->public;
|
$tasks[$i]->public = $obj->public;
|
||||||
$tasks[$i]->date_start = $this->db->jdate($obj->date_start);
|
$tasks[$i]->date_start = $this->db->jdate($obj->date_start);
|
||||||
@ -1005,7 +1005,7 @@ class Task extends CommonObject
|
|||||||
$clone_task->fk_project = $project_id;
|
$clone_task->fk_project = $project_id;
|
||||||
$clone_task->fk_task_parent = $parent_task_id;
|
$clone_task->fk_task_parent = $parent_task_id;
|
||||||
$clone_task->date_c = $datec;
|
$clone_task->date_c = $datec;
|
||||||
$clone_task->duration_planned = $clone_task->duration_planned;
|
$clone_task->planned_workload = $clone_task->planned_workload;
|
||||||
|
|
||||||
//Manage Task Date
|
//Manage Task Date
|
||||||
if ($clone_change_dt)
|
if ($clone_change_dt)
|
||||||
|
|||||||
@ -146,11 +146,11 @@ print '<th>'.$langs->trans('Projects').'</th>';
|
|||||||
print '<th>'.$langs->trans('Task').'</th>';
|
print '<th>'.$langs->trans('Task').'</th>';
|
||||||
print '<th>'.$langs->trans('DateStart').'</th>';
|
print '<th>'.$langs->trans('DateStart').'</th>';
|
||||||
print '<th>'.$langs->trans('DateEnd').'</th>';
|
print '<th>'.$langs->trans('DateEnd').'</th>';
|
||||||
print '<th>'.$langs->trans('TaskRessourceLinks').' %</th>';
|
print '<th>'.$langs->trans('WorkloadOccupation').'</th>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|
||||||
$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 = "SELECT p.title, p.rowid as projectid, t.label, t.rowid as taskid, u.rowid as userid, t.planned_workload, t.dateo, t.datee, tasktime.task_duration";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
|
$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 as t on t.fk_projet = p.rowid";
|
||||||
@ -159,6 +159,7 @@ $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u on tasktime.fk_user = u.rowid";
|
|||||||
$sql.= " WHERE p.entity = ".$conf->entity;
|
$sql.= " WHERE p.entity = ".$conf->entity;
|
||||||
if ($mine || ! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")";
|
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.")";
|
if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")";
|
||||||
|
$sql.= " AND p.fk_statut=1";
|
||||||
$sql.= " ORDER BY u.rowid, t.dateo, t.datee";
|
$sql.= " ORDER BY u.rowid, t.dateo, t.datee";
|
||||||
|
|
||||||
$userstatic=new User($db);
|
$userstatic=new User($db);
|
||||||
@ -186,10 +187,10 @@ if ( $resql )
|
|||||||
print '<td><a href="'.DOL_URL_ROOT.'/projet/tasks/task.php?id='.$obj->taskid.'&withproject=1">'.$obj->label.'</a></td>';
|
print '<td><a href="'.DOL_URL_ROOT.'/projet/tasks/task.php?id='.$obj->taskid.'&withproject=1">'.$obj->label.'</a></td>';
|
||||||
print '<td>'.dol_print_date($db->jdate($obj->dateo)).'</td>';
|
print '<td>'.dol_print_date($db->jdate($obj->dateo)).'</td>';
|
||||||
print '<td>'.dol_print_date($db->jdate($obj->datee)).'</td>';
|
print '<td>'.dol_print_date($db->jdate($obj->datee)).'</td>';
|
||||||
if (empty($obj->duration_planned)) {
|
if (empty($obj->planned_workload)) {
|
||||||
$percentcompletion = '0';
|
$percentcompletion = '0';
|
||||||
} else {
|
} else {
|
||||||
$percentcompletion = intval(($obj->totaltime*100)/$obj->duration_planned);
|
$percentcompletion = intval(($obj->task_duration*100)/$obj->planned_workload);
|
||||||
}
|
}
|
||||||
print '<td>'.$percentcompletion.' %</td>';
|
print '<td>'.$percentcompletion.' %</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
@ -71,7 +71,7 @@ $hookmanager->initHooks(array('projecttaskcard'));
|
|||||||
$progress=GETPOST('progress', 'int');
|
$progress=GETPOST('progress', 'int');
|
||||||
$label=GETPOST('label', 'alpha');
|
$label=GETPOST('label', 'alpha');
|
||||||
$description=GETPOST('description');
|
$description=GETPOST('description');
|
||||||
$duration_planned=GETPOST('duration_planned');
|
$planned_workload=GETPOST('planned_workload');
|
||||||
|
|
||||||
$userAccess=0;
|
$userAccess=0;
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ if ($action == 'createtask' && $user->rights->projet->creer)
|
|||||||
$task->fk_project = $projectid;
|
$task->fk_project = $projectid;
|
||||||
$task->label = $label;
|
$task->label = $label;
|
||||||
$task->description = $description;
|
$task->description = $description;
|
||||||
$task->duration_planned = $duration_planned;
|
$task->planned_workload = $planned_workload * 3600;//We set the planned workload into minutes
|
||||||
$task->fk_task_parent = $task_parent;
|
$task->fk_task_parent = $task_parent;
|
||||||
$task->date_c = dol_now();
|
$task->date_c = dol_now();
|
||||||
$task->date_start = $date_start;
|
$task->date_start = $date_start;
|
||||||
@ -295,8 +295,13 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->socie
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Duration planned
|
// Duration planned
|
||||||
print '<tr><td>'.$langs->trans("Duration").'</td><td>';
|
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>';
|
||||||
print '<input type="text" size="7" name="duration_planned" class="flat" value="'.$duration_planned.'"> '.$langs->trans('Hours');
|
if (!empty($object->planned_workload)) {
|
||||||
|
$planned_workload_hours = intval($object->planned_workload / 3600);
|
||||||
|
}else {
|
||||||
|
$planned_workload_hours = 0;
|
||||||
|
}
|
||||||
|
print '<input type="text" size="7" name="planned_workload" class="flat" value="'.$planned_workload.'"> '.$langs->trans('Hours');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Progress
|
// Progress
|
||||||
|
|||||||
@ -36,7 +36,7 @@ $action=GETPOST('action','alpha');
|
|||||||
$confirm=GETPOST('confirm','alpha');
|
$confirm=GETPOST('confirm','alpha');
|
||||||
$withproject=GETPOST('withproject','int');
|
$withproject=GETPOST('withproject','int');
|
||||||
$project_ref=GETPOST('project_ref','alpha');
|
$project_ref=GETPOST('project_ref','alpha');
|
||||||
$duration_planned=GETPOST('duration_planned');
|
$planned_workload=GETPOST('planned_workload');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid=0;
|
$socid=0;
|
||||||
@ -76,7 +76,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->projet->creer)
|
|||||||
$object->label = $_POST["label"];
|
$object->label = $_POST["label"];
|
||||||
$object->description = $_POST['description'];
|
$object->description = $_POST['description'];
|
||||||
$object->fk_task_parent = $task_parent;
|
$object->fk_task_parent = $task_parent;
|
||||||
$object->duration_planned = $duration_planned;
|
$object->planned_workload = $planned_workload*3600; //We set the planned workload into minutes
|
||||||
$object->date_start = dol_mktime(0,0,0,$_POST['dateomonth'],$_POST['dateoday'],$_POST['dateoyear']);
|
$object->date_start = dol_mktime(0,0,0,$_POST['dateomonth'],$_POST['dateoday'],$_POST['dateoyear']);
|
||||||
$object->date_end = dol_mktime(0,0,0,$_POST['dateemonth'],$_POST['dateeday'],$_POST['dateeyear']);
|
$object->date_end = dol_mktime(0,0,0,$_POST['dateemonth'],$_POST['dateeday'],$_POST['dateeyear']);
|
||||||
$object->progress = $_POST['progress'];
|
$object->progress = $_POST['progress'];
|
||||||
@ -286,8 +286,13 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Duration planned
|
// Duration planned
|
||||||
print '<tr><td>'.$langs->trans("Duration").'</td><td>';
|
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>';
|
||||||
print '<input type="text" size="7" name="duration_planned" class="flat" value="'.$object->duration_planned.'"> '.$langs->trans('Hours');
|
if (!empty($object->planned_workload)) {
|
||||||
|
$planned_workload_hours = intval($object->planned_workload / 3600);
|
||||||
|
}else {
|
||||||
|
$planned_workload_hours = 0;
|
||||||
|
}
|
||||||
|
print '<input type="text" size="7" name="planned_workload" class="flat" value="'.$planned_workload_hours.'"> '.$langs->trans('Hours');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Progress
|
// Progress
|
||||||
@ -376,8 +381,13 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Duration planned
|
// Duration planned
|
||||||
print '<tr><td>'.$langs->trans("Duration").'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td colspan="3">';
|
||||||
print $object->duration_planned.' '.$langs->trans('Hours');
|
if (!empty($object->planned_workload)) {
|
||||||
|
$planned_workload_hours = intval($object->planned_workload / 3600);
|
||||||
|
}else {
|
||||||
|
$planned_workload_hours = 0;
|
||||||
|
}
|
||||||
|
print $planned_workload_hours.' '.$langs->trans('Hours');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Progress
|
// Progress
|
||||||
|
|||||||
@ -1,28 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/projet/tasks/time.php
|
* \file htdocs/projet/tasks/time.php
|
||||||
* \ingroup project
|
* \ingroup project
|
||||||
* \brief Page to add new time spent on a task
|
* \brief Page to add new time spent on a task
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
@ -50,7 +50,7 @@ $projectstatic = new Project($db);
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == 'addtimespent' && $user->rights->projet->creer)
|
if ($action == 'addtimespent' && $user->rights->projet->creer)
|
||||||
{
|
{
|
||||||
@ -165,7 +165,7 @@ if (! empty($project_ref) && ! empty($withproject))
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader("",$langs->trans("Task"));
|
llxHeader("",$langs->trans("Task"));
|
||||||
|
|
||||||
@ -265,7 +265,12 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$object->label.'</td></tr>';
|
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$object->label.'</td></tr>';
|
||||||
|
|
||||||
// Duration planned
|
// Duration planned
|
||||||
print '<tr><td>'.$langs->trans("Duration").'</td><td colspan="3">'.$object->duration_planned.' '.$langs->trans('Hours').'</td></tr>';
|
if (!empty($object->planned_workload)) {
|
||||||
|
$planned_workload_hours = intval($object->planned_workload / 3600);
|
||||||
|
}else {
|
||||||
|
$planned_workload_hours = 0;
|
||||||
|
}
|
||||||
|
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td colspan="3">'.$planned_workload_hours.' '.$langs->trans('Hours').'</td></tr>';
|
||||||
|
|
||||||
// Project
|
// Project
|
||||||
if (empty($withproject))
|
if (empty($withproject))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user