diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 3f8f0f61efc..37dd19ffe04 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3659,18 +3659,19 @@ class Form * @param string $prefix prefix * @param int $iSecond Default preselected duration (number of seconds) * @param int $disabled Disable the combo box - * @param string $typehour if 'select' then input hour is a combo select, if 'text' input is in text + * @param string $typehour if 'select' then input hour and input min is a combo, if 'text' input hour is in text and input min is a combo * @return void */ function select_duration($prefix,$iSecond='',$disabled=0,$typehour='select') { global $langs; + $hourSelected=0; $minSelected=0; if ($iSecond) { require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; - $hourSelected = convertSecondToTime($iSecond,'hour'); + $hourSelected = convertSecondToTime($iSecond,'allhour'); $minSelected = convertSecondToTime($iSecond,'min'); } @@ -3690,8 +3691,7 @@ class Form } elseif ($typehour=='text') { - $fullhours=convertSecondToTime($iSecond,'fullhour'); - print ''; + print ''; } print $langs->trans('Hours'). " "; 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 "";