Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into develop-dolibarr

This commit is contained in:
Peter Fontaine 2013-10-31 08:32:15 +01:00
commit d7ab92c2a7
14 changed files with 159 additions and 114 deletions

View File

@ -65,6 +65,7 @@ END
# dpkg-reconfigure -plow package Reconfigure package # dpkg-reconfigure -plow package Reconfigure package
# dpkg -L packagename List content of installed package # dpkg -L packagename List content of installed package
# dpkg -r packagename Remove config files and interactive saved answers # dpkg -r packagename Remove config files and interactive saved answers
# dpkg -s packagename Give status of installed package
# dpkg --purge Remove config files and interactive saved answers # dpkg --purge Remove config files and interactive saved answers
# #
# dpkg-buildpackage -us -uc Build a source and binary package # dpkg-buildpackage -us -uc Build a source and binary package
@ -108,7 +109,7 @@ Puis pour se connecter
Pour tester un package Pour tester un package
> cp *.deb /srv/chroot/unstable/tmp > cp *.deb /srv/chroot/unstable/tmp
> schroot -c name_of_chroot > sudo schroot -c name_of_chroot
> dpkg -i dolibarr*.deb > dpkg -i dolibarr*.deb
> sudo apt-get install -f > sudo apt-get install -f
@ -212,6 +213,8 @@ Warning: Name and email must match value into debian/control file (Entry added h
Note: You can use git-buildpackage -us -uc --git-ignore-new if you want to test build with uncommited file Note: You can use git-buildpackage -us -uc --git-ignore-new if you want to test build with uncommited file
Note: Package is built into directory ../build-area Note: Package is built into directory ../build-area
* Test package (see dedicated chapter to test it with debian unstable env)
* If package .deb is ok: * If package .deb is ok:
Note: If there was errors managed manually, you may need to make a git commit but do not use option "amend" previous commit Note: If there was errors managed manually, you may need to make a git commit but do not use option "amend" previous commit
> git-buildpackage --git-tag-only --git-retag > git-buildpackage --git-tag-only --git-retag

View File

@ -3659,18 +3659,19 @@ class Form
* @param string $prefix prefix * @param string $prefix prefix
* @param int $iSecond Default preselected duration (number of seconds) * @param int $iSecond Default preselected duration (number of seconds)
* @param int $disabled Disable the combo box * @param int $disabled Disable the combo box
* @param string $typehour if select then hour in select if text input 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 * @return void
*/ */
function select_duration($prefix,$iSecond='',$disabled=0,$typehour='select') function select_duration($prefix,$iSecond='',$disabled=0,$typehour='select')
{ {
global $langs; global $langs;
$hourSelected=0; $minSelected=0;
if ($iSecond) if ($iSecond)
{ {
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$hourSelected = convertSecondToTime($iSecond,'hour'); $hourSelected = convertSecondToTime($iSecond,'allhour');
$minSelected = convertSecondToTime($iSecond,'min'); $minSelected = convertSecondToTime($iSecond,'min');
} }
@ -3690,8 +3691,7 @@ class Form
} }
elseif ($typehour=='text') elseif ($typehour=='text')
{ {
$fullhours=convertSecondToTime($iSecond,'fullhour'); print '<input type="text" size="3" name="'.$prefix.'hour" class="flat" value="'.((int) $hourSelected).'">';
print '<input type="text" size="3" name="'.$prefix.'hour" class="flat" value="'.$fullhours.'">';
} }
print $langs->trans('Hours'). "&nbsp;"; print $langs->trans('Hours'). "&nbsp;";
print '<select class="flat" name="'.$prefix.'min"'.($disabled?' disabled="disabled"':'').'>'; print '<select class="flat" name="'.$prefix.'min"'.($disabled?' disabled="disabled"':'').'>';

View File

@ -202,20 +202,20 @@ function convertTime2Seconds($iHours=0,$iMinutes=0,$iSeconds=0)
/** Return, in clear text, value of a number of seconds in days, hours and minutes /** Return, in clear text, value of a number of seconds in days, hours and minutes
* *
* @param int $iSecond Number of seconds * @param int $iSecond Number of seconds
* @param string $format Output format (all: complete display, hour: displays only hours, min: displays only minutes, sec: displays only seconds, month: display month only, year: displays only year); * @param string $format Output format (all: total delay days hour:min like "2 days 12:30"", allhourmin: total delay hours:min like "60:30", allhour: total delay hours without min/sec like "60:30", fullhour: total delay hour decimal like "60.5" for 60:30, hour: only hours part "12", min: only minutes part "30", sec: only seconds part, month: only month part, year: only year part);
* @param int $lengthOfDay Length of day (default 86400 seconds for 1 day, 28800 for 8 hour) * @param int $lengthOfDay Length of day (default 86400 seconds for 1 day, 28800 for 8 hour)
* @param int $lengthOfWeek Length of week (default 7) * @param int $lengthOfWeek Length of week (default 7)
* @return sTime Formated text of duration * @return sTime Formated text of duration
* Example: 0 return 00:00, 3600 return 1:00, 86400 return 1d, 90000 return 1 Day 01:00 * Example: 0 return 00:00, 3600 return 1:00, 86400 return 1d, 90000 return 1 Day 01:00
*/ */
function convertSecondToTime($iSecond,$format='all',$lengthOfDay=86400,$lengthOfWeek=7) function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengthOfWeek=7)
{ {
global $langs; global $langs;
if (empty($lengthOfDay)) $lengthOfDay = 86400; // 1 day = 24 hours if (empty($lengthOfDay)) $lengthOfDay = 86400; // 1 day = 24 hours
if (empty($lengthOfWeek)) $lengthOfWeek = 7; // 1 week = 7 days if (empty($lengthOfWeek)) $lengthOfWeek = 7; // 1 week = 7 days
if ($format == 'all') if ($format == 'all' || $format == 'allhour' || $format == 'allhourmin')
{ {
if ($iSecond === 0) return '0'; // This is to avoid having 0 return a 12:00 AM for en_US if ($iSecond === 0) return '0'; // This is to avoid having 0 return a 12:00 AM for en_US
@ -246,13 +246,6 @@ function convertSecondToTime($iSecond,$format='all',$lengthOfDay=86400,$lengthOf
if ($sWeek >= 2) $weekTranslate = $langs->trans("DurationWeeks"); if ($sWeek >= 2) $weekTranslate = $langs->trans("DurationWeeks");
$sTime.=$sWeek.' '.$weekTranslate.' '; $sTime.=$sWeek.' '.$weekTranslate.' ';
} }
/* if ($sDay>0)
{
$dayTranslate = $langs->trans("Day");
if ($sDay > 1) $dayTranslate = $langs->trans("Days");
$sTime.=$sDay.' '.$dayTranslate.' ';
}
*/
} }
} }
if ($sDay>0) if ($sDay>0)
@ -262,13 +255,23 @@ function convertSecondToTime($iSecond,$format='all',$lengthOfDay=86400,$lengthOf
$sTime.=$sDay.' '.$dayTranslate.' '; $sTime.=$sDay.' '.$dayTranslate.' ';
} }
// if ($sDay) $sTime.=$sDay.' '.$dayTranslate.' '; if ($format == 'all')
{
if ($iSecond || empty($sDay)) if ($iSecond || empty($sDay))
{ {
$sTime.= dol_print_date($iSecond,'hourduration',true); $sTime.= dol_print_date($iSecond,'hourduration',true);
} }
} }
else if ($format == 'hour') if ($format == 'allhourmin')
{
return sprintf("%02d",($sWeek*$lengthOfWeek*24 + $sDay*24 + (int) floor($iSecond/3600))).':'.sprintf("%02d",((int) floor(($iSecond % 3600)/60)));
}
if ($format == 'allhour')
{
return sprintf("%02d",($sWeek*$lengthOfWeek*24 + $sDay*24 + (int) floor($iSecond/3600)));
}
}
else if ($format == 'hour') // only hour part
{ {
$sTime=dol_print_date($iSecond,'%H',true); $sTime=dol_print_date($iSecond,'%H',true);
} }
@ -282,19 +285,19 @@ function convertSecondToTime($iSecond,$format='all',$lengthOfDay=86400,$lengthOf
} }
$sTime=$iSecond; $sTime=$iSecond;
} }
else if ($format == 'min') else if ($format == 'min') // only min part
{ {
$sTime=dol_print_date($iSecond,'%M',true); $sTime=dol_print_date($iSecond,'%M',true);
} }
else if ($format == 'sec') else if ($format == 'sec') // only sec part
{ {
$sTime=dol_print_date($iSecond,'%S',true); $sTime=dol_print_date($iSecond,'%S',true);
} }
else if ($format == 'month') else if ($format == 'month') // only month part
{ {
$sTime=dol_print_date($iSecond,'%m',true); $sTime=dol_print_date($iSecond,'%m',true);
} }
else if ($format == 'year') else if ($format == 'year') // only year part
{ {
$sTime=dol_print_date($iSecond,'%Y',true); $sTime=dol_print_date($iSecond,'%Y',true);
} }

View File

@ -322,13 +322,20 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
print dol_print_date($lines[$i]->date_end,'day'); print dol_print_date($lines[$i]->date_end,'day');
print '</td>'; print '</td>';
// Planned Workload // Planned Workload (in working hours)
print '<td align="center">'; print '<td align="center">';
if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload,'all'); $fullhour=convertSecondToTime($lines[$i]->planned_workload,'allhourmin');
else print '--:--'; $workingdelay=convertSecondToTime($lines[$i]->planned_workload,'all',86400,7); // TODO Replace 86400 and 7 to take account working hours per day and working day per weeks
if ($lines[$i]->planned_workload)
{
print $fullhour;
// TODO Add delay taking account of working hours per day and working day per week
//if ($workingdelay != $fullhour) print '<br>('.$workingdelay.')';
}
//else print '--:--';
print '</td>'; print '</td>';
// Progress // Progress declared
print '<td align="right">'; print '<td align="right">';
print $lines[$i]->progress.' %'; print $lines[$i]->progress.' %';
print '</td>'; print '</td>';
@ -337,12 +344,18 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
print '<td align="right">'; print '<td align="right">';
if ($showlineingray) print '<i>'; if ($showlineingray) print '<i>';
else print '<a href="'.DOL_URL_ROOT.'/projet/tasks/time.php?id='.$lines[$i]->id.($showproject?'':'&withproject=1').'">'; else print '<a href="'.DOL_URL_ROOT.'/projet/tasks/time.php?id='.$lines[$i]->id.($showproject?'':'&withproject=1').'">';
if ($lines[$i]->duration) print convertSecondToTime($lines[$i]->duration,'all'); if ($lines[$i]->duration) print convertSecondToTime($lines[$i]->duration,'allhourmin');
else print '--:--'; else print '--:--';
if ($showlineingray) print '</i>'; if ($showlineingray) print '</i>';
else print '</a>'; else print '</a>';
print '</td>'; print '</td>';
// Progress calculated
// Note: ->duration is in fact time spent i think
print '<td align="right">';
if ($lines[$i]->planned_workload) print round(100 * $lines[$i]->duration / $lines[$i]->planned_workload,2).' %';
print '</td>';
// Tick to drag and drop // Tick to drag and drop
if ($addordertick) if ($addordertick)
{ {
@ -376,7 +389,8 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
print '<td></td>'; print '<td></td>';
print '<td></td>'; print '<td></td>';
if ($addordertick) print '<td class="hideonsmartphone"></td>'; if ($addordertick) print '<td class="hideonsmartphone"></td>';
print '<td align="right" class="nowrap liste_total">'.convertSecondToTime($total).'</td>'; print '<td align="right" class="nowrap liste_total">'.convertSecondToTime($total, 'allhourmin').'</td>';
print '<td></td>';
print '</tr>'; print '</tr>';
} }
@ -494,7 +508,7 @@ function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksr
print '<td class="nowrap">'; print '<td class="nowrap">';
$s =$form->select_date('',$lines[$i]->id,'','','',"addtime",1,0,1,$disabledtask); $s =$form->select_date('',$lines[$i]->id,'','','',"addtime",1,0,1,$disabledtask);
$s.='&nbsp;&nbsp;&nbsp;'; $s.='&nbsp;&nbsp;&nbsp;';
$s.=$form->select_duration($lines[$i]->id,'',$disabledtask); $s.=$form->select_duration($lines[$i]->id,'',$disabledtask,'text');
$s.='&nbsp;<input type="submit" class="button"'.($disabledtask?' disabled="disabled"':'').' value="'.$langs->trans("Add").'">'; $s.='&nbsp;<input type="submit" class="button"'.($disabledtask?' disabled="disabled"':'').' value="'.$langs->trans("Add").'">';
print $s; print $s;
print '</td>'; print '</td>';

View File

@ -117,6 +117,10 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
*/ */
public function export($content) public function export($content)
{ {
global $conf;
if (! empty($conf->global->MAIN_SYSLOG_DISABLE_CHROMEPHP)) return; // Global option to disable output of this handler
//We check the configuration to avoid showing PHP warnings //We check the configuration to avoid showing PHP warnings
if (count($this->checkConfiguration())) return false; if (count($this->checkConfiguration())) return false;

View File

@ -116,6 +116,8 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface
{ {
global $conf, $dolibarr_main_prod; global $conf, $dolibarr_main_prod;
if (! empty($conf->global->MAIN_SYSLOG_DISABLE_FILE)) return; // Global option to disable output of this handler
$logfile = $this->getFilename($suffixinfilename); $logfile = $this->getFilename($suffixinfilename);
if (defined("SYSLOG_FILE_NO_ERROR")) $filefd = @fopen($logfile, 'a+'); if (defined("SYSLOG_FILE_NO_ERROR")) $filefd = @fopen($logfile, 'a+');

View File

@ -115,6 +115,10 @@ class mod_syslog_firephp extends LogHandler implements LogHandlerInterface
*/ */
public function export($content) public function export($content)
{ {
global $conf;
if (! empty($conf->global->MAIN_SYSLOG_DISABLE_FIREPHP)) return; // Global option to disable output of this handler
//We check the configuration to avoid showing PHP warnings //We check the configuration to avoid showing PHP warnings
if (count($this->checkConfiguration())) return false; if (count($this->checkConfiguration())) return false;

View File

@ -108,6 +108,10 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface
*/ */
public function export($content) public function export($content)
{ {
global $conf;
if (! empty($conf->global->MAIN_SYSLOG_DISABLE_SYSLOG)) return; // Global option to disable output of this handler
if (defined("SYSLOG_FACILITY") && constant("SYSLOG_FACILITY")) if (defined("SYSLOG_FACILITY") && constant("SYSLOG_FACILITY"))
{ {
if (constant(constant('SYSLOG_FACILITY'))) if (constant(constant('SYSLOG_FACILITY')))

View File

@ -45,6 +45,8 @@ MyActivities=My tasks/activities
MyProjects=My projects MyProjects=My projects
DurationEffective=Effective duration DurationEffective=Effective duration
Progress=Progress Progress=Progress
ProgressDeclared=Declared progress
ProgressCalculated=Calculated progress
Time=Time Time=Time
ListProposalsAssociatedProject=List of the commercial proposals associated with the project ListProposalsAssociatedProject=List of the commercial proposals associated with the project
ListOrdersAssociatedProject=List of customer's orders associated with the project ListOrdersAssociatedProject=List of customer's orders associated with the project

View File

@ -45,6 +45,8 @@ MyActivities=Mes tâches/activités
MyProjects=Mes projets MyProjects=Mes projets
DurationEffective=Durée effective DurationEffective=Durée effective
Progress=Progression Progress=Progression
ProgressDeclared=Progression déclarée
ProgressCalculated=Progression calculée
Time=Temps Time=Temps
ListProposalsAssociatedProject=Liste des propositions commerciales associées au projet ListProposalsAssociatedProject=Liste des propositions commerciales associées au projet
ListOrdersAssociatedProject=Liste des commandes clients associées au projet ListOrdersAssociatedProject=Liste des commandes clients associées au projet

View File

@ -1,21 +1,21 @@
<?php <?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* *
* 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.php * \file htdocs/projet/tasks.php
@ -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');
$planned_workload=GETPOST('planned_workloadhour'); $planned_workload=GETPOST('planned_workloadhour')*3600+GETPOST('planned_workloadmin')*60;
$userAccess=0; $userAccess=0;
@ -117,7 +117,7 @@ if ($action == 'createtask' && $user->rights->projet->creer)
$task->ref = GETPOST('ref','alpha'); $task->ref = GETPOST('ref','alpha');
$task->label = $label; $task->label = $label;
$task->description = $description; $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->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;
@ -417,8 +417,9 @@ else
print '<td align="center">'.$langs->trans("DateStart").'</td>'; print '<td align="center">'.$langs->trans("DateStart").'</td>';
print '<td align="center">'.$langs->trans("DateEnd").'</td>'; print '<td align="center">'.$langs->trans("DateEnd").'</td>';
print '<td align="center">'.$langs->trans("PlannedWorkload").'</td>'; print '<td align="center">'.$langs->trans("PlannedWorkload").'</td>';
print '<td align="right">'.$langs->trans("Progress").'</td>'; print '<td align="right">'.$langs->trans("ProgressDeclared").'</td>';
print '<td align="right">'.$langs->trans("TimeSpent").'</td>'; print '<td align="right">'.$langs->trans("TimeSpent").'</td>';
print '<td align="right">'.$langs->trans("ProgressCalculated").'</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
if (count($tasksarray) > 0) if (count($tasksarray) > 0)

View File

@ -100,16 +100,20 @@ print '<td width="80">'.$langs->trans("RefTask").'</td>';
print '<td>'.$langs->trans("LabelTask").'</td>'; print '<td>'.$langs->trans("LabelTask").'</td>';
print '<td align="center">'.$langs->trans("DateStart").'</td>'; print '<td align="center">'.$langs->trans("DateStart").'</td>';
print '<td align="center">'.$langs->trans("DateEnd").'</td>'; print '<td align="center">'.$langs->trans("DateEnd").'</td>';
print '<td align="center">'.$langs->trans("PlannedWorkload").'</td>'; print '<td align="center">'.$langs->trans("PlannedWorkload");
print '<td align="right">'.$langs->trans("Progress").'</td>'; // TODO Replace 86400 and 7 to take account working hours per day and working day per weeks
//print '<br>('.$langs->trans("DelayWorkHour").')';
print '</td>';
print '<td align="right">'.$langs->trans("ProgressDeclared").'</td>';
print '<td align="right">'.$langs->trans("TimeSpent").'</td>'; print '<td align="right">'.$langs->trans("TimeSpent").'</td>';
print '<td align="right">'.$langs->trans("ProgressCalculated").'</td>';
print "</tr>\n"; print "</tr>\n";
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input type="text" class="flat" name="search_project" value="'.$search_project.'" size="8">'; print '<input type="text" class="flat" name="search_project" value="'.$search_project.'" size="8">';
print '</td>'; print '</td>';
print '<td class="liste_titre" colspan="6">'; print '<td class="liste_titre" colspan="7">';
print '&nbsp;'; print '&nbsp;';
print '</td>'; print '</td>';
print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>'; print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>';

View File

@ -1,21 +1,21 @@
<?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-2013 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>
* *
* 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/task.php * \file htdocs/projet/tasks/task.php
@ -46,7 +46,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');
$planned_workload=GETPOST('planned_workloadhour'); $planned_workload=GETPOST('planned_workloadhour')*3600+GETPOST('planned_workloadmin')*60;
// Security check // Security check
$socid=0; $socid=0;
@ -86,7 +86,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->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_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'];
@ -334,7 +334,7 @@ if ($id > 0 || ! empty($ref))
print $form->select_date($object->date_end?$object->date_end:-1,'datee'); print $form->select_date($object->date_end?$object->date_end:-1,'datee');
print '</td></tr>'; print '</td></tr>';
// workload planned // Planned workload
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>'; print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>';
print $form->select_duration('planned_workload',$object->planned_workload,0,'text'); print $form->select_duration('planned_workload',$object->planned_workload,0,'text');
print '</td></tr>'; print '</td></tr>';
@ -423,9 +423,9 @@ if ($id > 0 || ! empty($ref))
print dol_print_date($object->date_end,'day'); print dol_print_date($object->date_end,'day');
print '</td></tr>'; print '</td></tr>';
// planned Workload // Planned workload
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td colspan="3">';
print convertSecondToTime($object->planned_workload,'all'); print convertSecondToTime($object->planned_workload,'allhourmin');
print '</td></tr>'; print '</td></tr>';
// Progress // Progress

View File

@ -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-2013 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';
@ -210,8 +210,10 @@ if ($id > 0 || ! empty($ref))
print $form->showrefnav($projectstatic,'project_ref','',1,'ref','ref','',$param.'&withproject=1'); print $form->showrefnav($projectstatic,'project_ref','',1,'ref','ref','',$param.'&withproject=1');
print '</td></tr>'; print '</td></tr>';
// Label
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$projectstatic->title.'</td></tr>'; print '<tr><td>'.$langs->trans("Label").'</td><td>'.$projectstatic->title.'</td></tr>';
// Thirdparty
print '<tr><td>'.$langs->trans("Company").'</td><td>'; print '<tr><td>'.$langs->trans("Company").'</td><td>';
if (! empty($projectstatic->societe->id)) print $projectstatic->societe->getNomUrl(1); if (! empty($projectstatic->societe->id)) print $projectstatic->societe->getNomUrl(1);
else print '&nbsp;'; else print '&nbsp;';
@ -265,8 +267,8 @@ if ($id > 0 || ! empty($ref))
// Label // Label
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>';
// planned workload // Planned workload
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td colspan="3">'.convertSecondToTime($object->planned_workload,'all').'</td></tr>'; print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td colspan="3">'.convertSecondToTime($object->planned_workload,'allhourmin').'</td></tr>';
// Project // Project
if (empty($withproject)) if (empty($withproject))
@ -443,7 +445,7 @@ if ($id > 0 || ! empty($ref))
} }
else else
{ {
print convertSecondToTime($task_time->task_duration,'all'); print convertSecondToTime($task_time->task_duration,'allhourmin');
} }
print '</td>'; print '</td>';
@ -474,7 +476,7 @@ if ($id > 0 || ! empty($ref))
$total += $task_time->task_duration; $total += $task_time->task_duration;
} }
print '<tr class="liste_total"><td colspan="3" class="liste_total">'.$langs->trans("Total").'</td>'; print '<tr class="liste_total"><td colspan="3" class="liste_total">'.$langs->trans("Total").'</td>';
print '<td align="right" class="nowrap liste_total">'.convertSecondToTime($total).'</td><td>&nbsp;</td>'; print '<td align="right" class="nowrap liste_total">'.convertSecondToTime($total,'allhourmin').'</td><td>&nbsp;</td>';
print '</tr>'; print '</tr>';
print "</table>"; print "</table>";