+ *
+ * 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/tasks.php
@@ -57,7 +57,7 @@ if ($ref)
if (!empty($id)) {
$extralabels_projet=$extrafields_project->fetch_name_optionals_label($object->table_element);
$extralabels_task=$extrafields_task->fetch_name_optionals_label($taskstatic->table_element);
-
+
}
// Security check
@@ -71,7 +71,7 @@ $hookmanager->initHooks(array('projecttaskcard'));
$progress=GETPOST('progress', 'int');
$label=GETPOST('label', 'alpha');
$description=GETPOST('description');
-$planned_workload=GETPOST('planned_workloadhour');
+$planned_workload=GETPOST('planned_workloadhour')*3600+GETPOST('planned_workloadmin')*60;
$userAccess=0;
@@ -117,13 +117,13 @@ if ($action == 'createtask' && $user->rights->projet->creer)
$task->ref = GETPOST('ref','alpha');
$task->label = $label;
$task->description = $description;
- $task->planned_workload = $planned_workload * 3600;//We set the planned workload into seconds
+ $task->planned_workload = $planned_workload;
$task->fk_task_parent = $task_parent;
$task->date_c = dol_now();
$task->date_start = $date_start;
$task->date_end = $date_end;
$task->progress = $progress;
-
+
// Fill array 'array_options' with data from add form
$ret = $extrafields_task->setOptionalsFromPost($extralabels_task,$task);
@@ -241,7 +241,7 @@ if ($id > 0 || ! empty($ref))
print ''.$langs->trans("DateEnd").' ';
print dol_print_date($object->date_end,'day');
print ' ';
-
+
// Other options
$parameters=array();
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
@@ -268,7 +268,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->socie
print ' ';
print ' ';
print ' ';
-
+
if (! empty($object->id)) print ' ';
if (! empty($mode)) print ' ';
@@ -282,9 +282,9 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->socie
$modTask = new $obj;
$defaultref = $modTask->getNextValue($soc,$object);
}
-
+
if (is_numeric($defaultref) && $defaultref <= 0) $defaultref='';
-
+
// Ref
print ' ';
print ''.$langs->trans("Ref").' '.($_POST["ref"]?$_POST["ref"]:$defaultref).' ';
@@ -417,8 +417,9 @@ else
print ''.$langs->trans("DateStart").' ';
print ''.$langs->trans("DateEnd").' ';
print ''.$langs->trans("PlannedWorkload").' ';
- print ''.$langs->trans("Progress").' ';
+ print ''.$langs->trans("ProgressDeclared").' ';
print ''.$langs->trans("TimeSpent").' ';
+ print ''.$langs->trans("ProgressCalculated").' ';
print ' ';
print "\n";
if (count($tasksarray) > 0)
diff --git a/htdocs/projet/tasks/index.php b/htdocs/projet/tasks/index.php
index cabcea2c48c..077a56c1976 100644
--- a/htdocs/projet/tasks/index.php
+++ b/htdocs/projet/tasks/index.php
@@ -100,16 +100,20 @@ print ''.$langs->trans("RefTask").' ';
print ''.$langs->trans("LabelTask").' ';
print ''.$langs->trans("DateStart").' ';
print ''.$langs->trans("DateEnd").' ';
-print ''.$langs->trans("PlannedWorkload").' ';
-print ''.$langs->trans("Progress").' ';
+print ''.$langs->trans("PlannedWorkload");
+// TODO Replace 86400 and 7 to take account working hours per day and working day per weeks
+//print ' ('.$langs->trans("DelayWorkHour").')';
+print ' ';
+print ''.$langs->trans("ProgressDeclared").' ';
print ''.$langs->trans("TimeSpent").' ';
+print ''.$langs->trans("ProgressCalculated").' ';
print "\n";
print '';
print '';
print ' ';
print ' ';
-print '';
+print ' ';
print ' ';
print ' ';
print ' ';
diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php
index 7e46e1c169c..5e2f20729cc 100644
--- a/htdocs/projet/tasks/task.php
+++ b/htdocs/projet/tasks/task.php
@@ -1,21 +1,21 @@
- * Copyright (C) 2006-2012 Laurent Destailleur
-* Copyright (C) 2010-2012 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) 2006-2013 Laurent Destailleur
+ * Copyright (C) 2010-2012 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/tasks/task.php
@@ -46,7 +46,7 @@ $action=GETPOST('action','alpha');
$confirm=GETPOST('confirm','alpha');
$withproject=GETPOST('withproject','int');
$project_ref=GETPOST('project_ref','alpha');
-$planned_workload=GETPOST('planned_workloadhour');
+$planned_workload=GETPOST('planned_workloadhour')*3600+GETPOST('planned_workloadmin')*60;
// Security check
$socid=0;
@@ -86,7 +86,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->projet->creer)
$object->label = $_POST["label"];
$object->description = $_POST['description'];
$object->fk_task_parent = $task_parent;
- $object->planned_workload = $planned_workload*3600; //We set the planned workload into seconds
+ $object->planned_workload = $planned_workload;
$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->progress = $_POST['progress'];
@@ -147,7 +147,7 @@ if (! empty($project_ref) && ! empty($withproject))
if ($action == 'builddoc' && $user->rights->projet->creer)
{
$object->fetch($id,$ref);
-
+
// Save last template used to generate document
if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
@@ -334,7 +334,7 @@ if ($id > 0 || ! empty($ref))
print $form->select_date($object->date_end?$object->date_end:-1,'datee');
print ' ';
- // workload planned
+ // Planned workload
print ''.$langs->trans("PlannedWorkload").' ';
print $form->select_duration('planned_workload',$object->planned_workload,0,'text');
print ' ';
@@ -423,9 +423,9 @@ if ($id > 0 || ! empty($ref))
print dol_print_date($object->date_end,'day');
print '';
- // planned Workload
+ // Planned workload
print ''.$langs->trans("PlannedWorkload").' ';
- print convertSecondToTime($object->planned_workload,'all');
+ print convertSecondToTime($object->planned_workload,'allhourmin');
print ' ';
// Progress
@@ -445,7 +445,7 @@ if ($id > 0 || ! empty($ref))
{
print $object->showOptionals($extrafields);
}
-
+
print '';
}
@@ -481,10 +481,10 @@ if ($id > 0 || ! empty($ref))
}
print '';
-
+
print '';
print ' '; // ancre
-
+
/*
* Documents generes
*/
@@ -493,13 +493,13 @@ if ($id > 0 || ! empty($ref))
$urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;
$genallowed=($user->rights->projet->lire);
$delallowed=($user->rights->projet->creer);
-
+
$var=true;
-
+
$somethingshown=$formfile->show_documents('project_task',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf);
-
-
-
+
+
+
print '
';
}
}
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index 919f88135b2..f6532e09d31 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -1,28 +1,28 @@
- * Copyright (C) 2006-2012 Laurent Destailleur
-* Copyright (C) 2010-2012 Regis Houssin
-* Copyright (C) 2011 Juanjo Menent
-*
-* 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) 2006-2013 Laurent Destailleur
+ * Copyright (C) 2010-2012 Regis Houssin
+ * Copyright (C) 2011 Juanjo Menent
+ *
+ * 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/tasks/time.php
* \ingroup project
* \brief Page to add new time spent on a task
-*/
+ */
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
@@ -210,8 +210,10 @@ if ($id > 0 || ! empty($ref))
print $form->showrefnav($projectstatic,'project_ref','',1,'ref','ref','',$param.'&withproject=1');
print '';
+ // Label
print ''.$langs->trans("Label").' '.$projectstatic->title.' ';
+ // Thirdparty
print ''.$langs->trans("Company").' ';
if (! empty($projectstatic->societe->id)) print $projectstatic->societe->getNomUrl(1);
else print ' ';
@@ -265,8 +267,8 @@ if ($id > 0 || ! empty($ref))
// Label
print ' '.$langs->trans("Label").' '.$object->label.' ';
- // planned workload
- print ''.$langs->trans("PlannedWorkload").' '.convertSecondToTime($object->planned_workload,'all').' ';
+ // Planned workload
+ print ''.$langs->trans("PlannedWorkload").' '.convertSecondToTime($object->planned_workload,'allhourmin').' ';
// Project
if (empty($withproject))
@@ -443,7 +445,7 @@ if ($id > 0 || ! empty($ref))
}
else
{
- print convertSecondToTime($task_time->task_duration,'all');
+ print convertSecondToTime($task_time->task_duration,'allhourmin');
}
print '';
@@ -474,7 +476,7 @@ if ($id > 0 || ! empty($ref))
$total += $task_time->task_duration;
}
print ''.$langs->trans("Total").' ';
- print ''.convertSecondToTime($total).' ';
+ print ''.convertSecondToTime($total,'allhourmin').' ';
print ' ';
print "";