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 -L packagename List content of installed package
# 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-buildpackage -us -uc Build a source and binary package
@ -108,7 +109,7 @@ Puis pour se connecter
Pour tester un package
> cp *.deb /srv/chroot/unstable/tmp
> schroot -c name_of_chroot
> sudo schroot -c name_of_chroot
> dpkg -i dolibarr*.deb
> 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: Package is built into directory ../build-area
* Test package (see dedicated chapter to test it with debian unstable env)
* 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
> git-buildpackage --git-tag-only --git-retag

View File

@ -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 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
*/
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 '<input type="text" size="3" name="'.$prefix.'hour" class="flat" value="'.$fullhours.'">';
print '<input type="text" size="3" name="'.$prefix.'hour" class="flat" value="'.((int) $hourSelected).'">';
}
print $langs->trans('Hours'). "&nbsp;";
print '<select class="flat" name="'.$prefix.'min"'.($disabled?' disabled="disabled"':'').'>';

View File

@ -202,25 +202,25 @@ function convertTime2Seconds($iHours=0,$iMinutes=0,$iSeconds=0)
/** Return, in clear text, value of a number of seconds in days, hours and minutes
*
* @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 $lengthOfWeek Length of week (default 7)
* @return sTime Formated text of duration
* 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;
if (empty($lengthOfDay)) $lengthOfDay = 86400; // 1 day = 24 hours
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
$sTime='';
$sDay=0;
$sDay=0;
$sWeek='';
if ($iSecond >= $lengthOfDay)
@ -246,13 +246,6 @@ function convertSecondToTime($iSecond,$format='all',$lengthOfDay=86400,$lengthOf
if ($sWeek >= 2) $weekTranslate = $langs->trans("DurationWeeks");
$sTime.=$sWeek.' '.$weekTranslate.' ';
}
/* if ($sDay>0)
{
$dayTranslate = $langs->trans("Day");
if ($sDay > 1) $dayTranslate = $langs->trans("Days");
$sTime.=$sDay.' '.$dayTranslate.' ';
}
*/
}
}
if ($sDay>0)
@ -262,13 +255,23 @@ function convertSecondToTime($iSecond,$format='all',$lengthOfDay=86400,$lengthOf
$sTime.=$sDay.' '.$dayTranslate.' ';
}
// if ($sDay) $sTime.=$sDay.' '.$dayTranslate.' ';
if ($iSecond || empty($sDay))
if ($format == 'all')
{
$sTime.= dol_print_date($iSecond,'hourduration',true);
if ($iSecond || empty($sDay))
{
$sTime.= dol_print_date($iSecond,'hourduration',true);
}
}
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')
else if ($format == 'hour') // only hour part
{
$sTime=dol_print_date($iSecond,'%H',true);
}
@ -282,19 +285,19 @@ function convertSecondToTime($iSecond,$format='all',$lengthOfDay=86400,$lengthOf
}
$sTime=$iSecond;
}
else if ($format == 'min')
else if ($format == 'min') // only min part
{
$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);
}
else if ($format == 'month')
else if ($format == 'month') // only month part
{
$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);
}
@ -340,7 +343,7 @@ function dol_stringtotime($string, $gm=1)
else if (
preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})Z$/i',$string,$reg) // Convert date with format RFC3339
|| preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})$/i',$string,$reg) // Convert date with format YYYY-MM-DD HH:MM:SS
|| preg_match('/^([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2})([0-9]{2})([0-9]{2})Z$/i',$string,$reg) // Convert date with format YYYYMMDDTHHMMSSZ
|| preg_match('/^([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2})([0-9]{2})([0-9]{2})Z$/i',$string,$reg) // Convert date with format YYYYMMDDTHHMMSSZ
)
{
$syear = $reg[1];

View File

@ -75,7 +75,7 @@ function project_prepare_head($object)
$head[$h][2] = 'notes';
$h++;
}
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$upload_dir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir,'files'));
@ -84,7 +84,7 @@ function project_prepare_head($object)
if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')';
$head[$h][2] = 'document';
$h++;
// Then tab for sub level of projet, i mean tasks
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id;
$head[$h][1] = $langs->trans("Tasks");
@ -322,13 +322,20 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
print dol_print_date($lines[$i]->date_end,'day');
print '</td>';
// Planned Workload
// Planned Workload (in working hours)
print '<td align="center">';
if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload,'all');
else print '--:--';
$fullhour=convertSecondToTime($lines[$i]->planned_workload,'allhourmin');
$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>';
// Progress
// Progress declared
print '<td align="right">';
print $lines[$i]->progress.' %';
print '</td>';
@ -337,12 +344,18 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
print '<td align="right">';
if ($showlineingray) print '<i>';
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 '--:--';
if ($showlineingray) print '</i>';
else print '</a>';
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
if ($addordertick)
{
@ -376,7 +389,8 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
print '<td></td>';
print '<td></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>';
}
@ -494,7 +508,7 @@ function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksr
print '<td class="nowrap">';
$s =$form->select_date('',$lines[$i]->id,'','','',"addtime",1,0,1,$disabledtask);
$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").'">';
print $s;
print '</td>';

View File

@ -117,6 +117,10 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
*/
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
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;
if (! empty($conf->global->MAIN_SYSLOG_DISABLE_FILE)) return; // Global option to disable output of this handler
$logfile = $this->getFilename($suffixinfilename);
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)
{
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
if (count($this->checkConfiguration())) return false;

View File

@ -108,6 +108,10 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface
*/
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 (constant(constant('SYSLOG_FACILITY')))

View File

@ -45,6 +45,8 @@ MyActivities=My tasks/activities
MyProjects=My projects
DurationEffective=Effective duration
Progress=Progress
ProgressDeclared=Declared progress
ProgressCalculated=Calculated progress
Time=Time
ListProposalsAssociatedProject=List of the commercial proposals 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
DurationEffective=Durée effective
Progress=Progression
ProgressDeclared=Progression déclarée
ProgressCalculated=Progression calculée
Time=Temps
ListProposalsAssociatedProject=Liste des propositions commerciales associées au projet
ListOrdersAssociatedProject=Liste des commandes clients associées au projet

View File

@ -1,21 +1,21 @@
<?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
/**
* \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 '<tr><td>'.$langs->trans("DateEnd").'</td><td>';
print dol_print_date($object->date_end,'day');
print '</td></tr>';
// 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 '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="createtask">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
if (! empty($object->id)) print '<input type="hidden" name="id" value="'.$object->id.'">';
if (! empty($mode)) print '<input type="hidden" name="mode" value="'.$mode.'">';
@ -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 '<input type="hidden" name="ref" value="'.($_POST["ref"]?$_POST["ref"]:$defaultref).'">';
print '<tr><td><span class="fieldrequired">'.$langs->trans("Ref").'</span></td><td>'.($_POST["ref"]?$_POST["ref"]:$defaultref).'</td></tr>';
@ -417,8 +417,9 @@ else
print '<td align="center">'.$langs->trans("DateStart").'</td>';
print '<td align="center">'.$langs->trans("DateEnd").'</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("ProgressCalculated").'</td>';
print '<td>&nbsp;</td>';
print "</tr>\n";
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 align="center">'.$langs->trans("DateStart").'</td>';
print '<td align="center">'.$langs->trans("DateEnd").'</td>';
print '<td align="center">'.$langs->trans("PlannedWorkload").'</td>';
print '<td align="right">'.$langs->trans("Progress").'</td>';
print '<td align="center">'.$langs->trans("PlannedWorkload");
// 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("ProgressCalculated").'</td>';
print "</tr>\n";
print '<tr class="liste_titre">';
print '<td class="liste_titre">';
print '<input type="text" class="flat" name="search_project" value="'.$search_project.'" size="8">';
print '</td>';
print '<td class="liste_titre" colspan="6">';
print '<td class="liste_titre" colspan="7">';
print '&nbsp;';
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>';

View File

@ -1,21 +1,21 @@
<?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
/**
* \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 '</td></tr>';
// workload planned
// Planned workload
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>';
print $form->select_duration('planned_workload',$object->planned_workload,0,'text');
print '</td></tr>';
@ -423,9 +423,9 @@ if ($id > 0 || ! empty($ref))
print dol_print_date($object->date_end,'day');
print '</td></tr>';
// planned Workload
// Planned workload
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>';
// Progress
@ -445,7 +445,7 @@ if ($id > 0 || ! empty($ref))
{
print $object->showOptionals($extrafields);
}
print '</table>';
}
@ -481,10 +481,10 @@ if ($id > 0 || ! empty($ref))
}
print '</div>';
print '<table width="100%"><tr><td width="50%" valign="top">';
print '<a name="builddoc"></a>'; // 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 '</td></tr></table>';
}
}

View File

@ -1,28 +1,28 @@
<?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
* 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 <http://www.gnu.org/licenses/>.
*/
* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
* 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 <http://www.gnu.org/licenses/>.
*/
/**
* \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 '</td></tr>';
// Label
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$projectstatic->title.'</td></tr>';
// Thirdparty
print '<tr><td>'.$langs->trans("Company").'</td><td>';
if (! empty($projectstatic->societe->id)) print $projectstatic->societe->getNomUrl(1);
else print '&nbsp;';
@ -265,8 +267,8 @@ if ($id > 0 || ! empty($ref))
// Label
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$object->label.'</td></tr>';
// planned workload
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td colspan="3">'.convertSecondToTime($object->planned_workload,'all').'</td></tr>';
// Planned workload
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td colspan="3">'.convertSecondToTime($object->planned_workload,'allhourmin').'</td></tr>';
// 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 '</td>';
@ -474,7 +476,7 @@ if ($id > 0 || ! empty($ref))
$total += $task_time->task_duration;
}
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 "</table>";