diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 96bcbaa00c4..38f78dd8333 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -479,7 +479,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t if ($lines[$i]->planned_workload || $lines[$i]->duration) { if ($lines[$i]->planned_workload) print round(100 * $lines[$i]->duration / $lines[$i]->planned_workload,2).' %'; - else print $langs->trans('WorkloadNotDefined'); + else print ''.$langs->trans('WorkloadNotDefined').''; } print ''; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 1ee81f7b917..47d0f1c3148 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -711,7 +711,7 @@ elseif ($object->id > 0) print ''; $head=project_prepare_head($object); - dol_fiche_head($head, 'project', $langs->trans("Project"),0,($object->public?'projectpub':'project')); + dol_fiche_head($head, 'project', $langs->trans("Project"), -1, ($object->public?'projectpub':'project')); if ($action == 'edit' && $userWrite > 0) { diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index dad46c96989..e1025241115 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -127,7 +127,7 @@ class Task extends CommonObject $sql.= ", ".$user->id; $sql.= ", ".($this->date_start!=''?"'".$this->db->idate($this->date_start)."'":'null'); $sql.= ", ".($this->date_end!=''?"'".$this->db->idate($this->date_end)."'":'null'); - $sql.= ", ".($this->planned_workload!=''?$this->planned_workload:0); + $sql.= ", ".(($this->planned_workload!='' && $this->planned_workload >= 0)?$this->planned_workload:'null'); $sql.= ", ".(($this->progress!='' && $this->progress >= 0)?$this->progress:'null'); $sql.= ")"; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 02bf6c5a9ba..8aebe756d70 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -123,7 +123,7 @@ $userstatic=new User($db); $userAccess = $object->restrictedProjectArea($user); $head=project_prepare_head($object); -dol_fiche_head($head, 'element', $langs->trans("Project"),0,($object->public?'projectpub':'project')); +dol_fiche_head($head, 'element', $langs->trans("Project"), -1, ($object->public?'projectpub':'project')); // Project card @@ -231,6 +231,7 @@ print '
'; dol_fiche_end(); +print '
'; /* * Referers types diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 06bd2c9c730..fdeebd0ca69 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -92,9 +92,12 @@ if ($action == 'createtask' && $user->rights->projet->creer) { $error=0; - $date_start = dol_mktime($_POST['dateohour'],$_POST['dateomin'],0,$_POST['dateomonth'],$_POST['dateoday'],$_POST['dateoyear'],'user'); - $date_end = dol_mktime($_POST['dateehour'],$_POST['dateemin'],0,$_POST['dateemonth'],$_POST['dateeday'],$_POST['dateeyear'],'user'); - + // If we use user timezone, we must change also view/list to use user timezone everywhere + //$date_start = dol_mktime($_POST['dateohour'],$_POST['dateomin'],0,$_POST['dateomonth'],$_POST['dateoday'],$_POST['dateoyear'],'user'); + //$date_end = dol_mktime($_POST['dateehour'],$_POST['dateemin'],0,$_POST['dateemonth'],$_POST['dateeday'],$_POST['dateeyear'],'user'); + $date_start = dol_mktime($_POST['dateohour'],$_POST['dateomin'],0,$_POST['dateomonth'],$_POST['dateoday'],$_POST['dateoyear']); + $date_end = dol_mktime($_POST['dateehour'],$_POST['dateemin'],0,$_POST['dateemonth'],$_POST['dateeday'],$_POST['dateeyear']); + if (! $cancel) { if (empty($taskref)) @@ -215,7 +218,7 @@ if ($id > 0 || ! empty($ref)) $tab=GETPOST('tab')?GETPOST('tab'):'tasks'; $head=project_prepare_head($object); - dol_fiche_head($head, $tab, $langs->trans("Project"), 0, ($object->public?'projectpub':'project')); + dol_fiche_head($head, $tab, $langs->trans("Project"), -1, ($object->public?'projectpub':'project')); $param=''; if ($search_user_id > 0) $param.='&search_user_id='.dol_escape_htmltag($search_user_id); diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index e2f94406558..9160f2b3795 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -293,33 +293,23 @@ if ($id > 0 || ! empty($ref)) else $object->next_prev_filter=" fk_projet = ".$projectstatic->id; $morehtmlref=''; - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param, 0, '', '', 1); - if (empty($withproject)) + // Project + if (empty($withproject)) { - print '
'; + $morehtmlref.='
'; + $morehtmlref.=$langs->trans("Project").': '; + $morehtmlref.=$projectstatic->getNomUrl(1); + $morehtmlref.='
'; - print '
'; - print ''; - - // Project - print ''; - - // Customer - print ""; - print ''; - - print "
'.$langs->trans("Project").''; - print $projectstatic->getNomUrl(1); - print '
".$langs->trans("ThirdParty")."'; - if ($projectstatic->thirdparty->id > 0) print $projectstatic->thirdparty->getNomUrl(1); - else print ' '; - print '
"; - - print '
'; + // Third party + $morehtmlref.=$langs->trans("ThirdParty").': '; + $morehtmlref.=$projectstatic->thirdparty->getNomUrl(1); + $morehtmlref.='
'; } - + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param, 0, '', '', 1); + dol_fiche_end(); /* diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 684b7648ab8..241ba0162e5 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -239,6 +239,21 @@ if ($object->id > 0) else $object->next_prev_filter=" fk_projet = ".$projectstatic->id; $morehtmlref=''; + + // Project + if (empty($withproject)) + { + $morehtmlref.='
'; + $morehtmlref.=$langs->trans("Project").': '; + $morehtmlref.=$projectstatic->getNomUrl(1); + $morehtmlref.='
'; + + // Third party + $morehtmlref.=$langs->trans("ThirdParty").': '; + $morehtmlref.=$projectstatic->thirdparty->getNomUrl(1); + $morehtmlref.='
'; + } + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param); print '
'; @@ -246,39 +261,6 @@ if ($object->id > 0) print '
'; print ''; - // Ref - /* - print ''; - print ''; - - // Label - print ''; - */ - - // Project - if (empty($withproject)) - { - print ''; - - // Third party - print ''; - } - // Files infos print ''; print ''; diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index ebdd3d0c5a3..0d6df7d85fd 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -211,43 +211,26 @@ if ($object->id > 0) else $object->next_prev_filter=" fk_projet = ".$projectstatic->id; $morehtmlref=''; + + // Project + if (empty($withproject)) + { + $morehtmlref.='
'; + $morehtmlref.=$langs->trans("Project").': '; + $morehtmlref.=$projectstatic->getNomUrl(1); + $morehtmlref.='
'; + + // Third party + $morehtmlref.=$langs->trans("ThirdParty").': '; + $morehtmlref.=$projectstatic->thirdparty->getNomUrl(1); + $morehtmlref.='
'; + } + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param); print '
'; print '
'; - print '
'; - print $langs->trans("Ref"); - print ''; - if (empty($withproject) || empty($projectstatic->id)) - { - $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1); - $object->next_prev_filter=" fk_projet in (".$projectsListId.")"; - } - else $object->next_prev_filter=" fk_projet = ".$projectstatic->id; - print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','',$param); - print '
'.$langs->trans("Label").''.$object->label.'
'.$langs->trans("Project").''; - print $projectstatic->getNomUrl(1); - print '
'.$langs->trans("ThirdParty").''; - if ($projectstatic->thirdparty->id) print $projectstatic->thirdparty->getNomUrl(1); - else print ' '; - print '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'; - /* - // Ref - print ''; - - // Label - print ''; - */ - - // Project - if (empty($withproject)) - { - print ''; - - // Third party - print ''; - } - - print "
'.$langs->trans("Ref").''; - if (empty($withproject) || empty($projectstatic->id)) - { - $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1); - $object->next_prev_filter=" fk_projet in (".$projectsListId.")"; - } - else $object->next_prev_filter=" fk_projet = ".$projectstatic->id; - print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','',$param); - print '
'.$langs->trans("Label").''.$object->label.'
'.$langs->trans("Project").''; - print $projectstatic->getNomUrl(1); - print '
'.$langs->trans("ThirdParty").''; - if ($projectstatic->thirdparty->id > 0) print $projectstatic->thirdparty->getNomUrl(1); - else print' '; - print '
"; $cssclass='titlefield'; $moreparam=$param; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 603a69a07b0..5f493167fd8 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -447,6 +447,21 @@ if ($id > 0 || ! empty($ref)) else $object->next_prev_filter=" fk_projet = ".$projectstatic->id; $morehtmlref=''; + + // Project + if (empty($withproject)) + { + $morehtmlref.='
'; + $morehtmlref.=$langs->trans("Project").': '; + $morehtmlref.=$projectstatic->getNomUrl(1); + $morehtmlref.='
'; + + // Third party + $morehtmlref.=$langs->trans("ThirdParty").': '; + $morehtmlref.=$projectstatic->thirdparty->getNomUrl(1); + $morehtmlref.='
'; + } + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param); print '
'; @@ -454,39 +469,6 @@ if ($id > 0 || ! empty($ref)) print '
'; print ''; - /* - // Ref - print ''; - print ''; - - // Label - print ''; - */ - - // Project - if (empty($withproject)) - { - print ''; - - // Third party - print ''; - } - // Date start - Date end print '
'; - print $langs->trans("Ref"); - print ''; - if (! GETPOST('withproject') || empty($projectstatic->id)) - { - $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1); - $object->next_prev_filter=" fk_projet in (".$projectsListId.")"; - } - else $object->next_prev_filter=" fk_projet = ".$projectstatic->id; - print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','',$param); - print '
'.$langs->trans("Label").''.$object->label.'
'.$langs->trans("Project").''; - print $projectstatic->getNomUrl(1); - print '
'.$langs->trans("ThirdParty").''; - if ($projectstatic->societe->id) print $projectstatic->societe->getNomUrl(1); - else print ' '; - print '
'.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; $start = dol_print_date($object->date_start,'dayhour'); diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index eed7bae2734..0cbe660dd9e 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1,6 +1,6 @@ - * Copyright (C) 2006-2016 Laurent Destailleur + * Copyright (C) 2006-2017 Laurent Destailleur * Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2011 Juanjo Menent * @@ -442,27 +442,31 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) else $object->next_prev_filter=" fk_projet = ".$projectstatic->id; $morehtmlref=''; + + // Project + if (empty($withproject)) + { + $morehtmlref.='
'; + $morehtmlref.=$langs->trans("Project").': '; + $morehtmlref.=$projectstatic->getNomUrl(1); + $morehtmlref.='
'; + + // Third party + $morehtmlref.=$langs->trans("ThirdParty").': '; + $morehtmlref.=$projectstatic->thirdparty->getNomUrl(1); + $morehtmlref.='
'; + } + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param); print '
'; + print '
'; print '
'; print ''; - // Ref - /* - print ''; - - // Label - print ''; - */ - // Date start - Date end - print ''; // Planned workload - print ''; + print '
'; - print $langs->trans("Ref"); - print ''; - print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','',$param); - print '
'.$langs->trans("Label").''.$object->label.'
'.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + print '
'.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; $start = dol_print_date($object->date_start,'dayhour'); print ($start?$start:'?'); $end = dol_print_date($object->date_end,'dayhour'); @@ -472,17 +476,25 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) print '
'.$langs->trans("PlannedWorkload").''; + print '
'.$langs->trans("PlannedWorkload").''; print convertSecondToTime($object->planned_workload,'allhourmin'); print '
'; + print '
'; + + print '
'; + + print '
'; + print ''; + // Progress declared - print ''; // Progress calculated - print ''; - // Project - if (empty($withproject)) - { - print ''; - - // Third party - print ''; - } - print '
'.$langs->trans("ProgressDeclared").''; + print '
'.$langs->trans("ProgressDeclared").''; print $object->progress.' %'; print '
'.$langs->trans("ProgressCalculated").''; + print '
'.$langs->trans("ProgressCalculated").''; if ($object->planned_workload) { $tmparray=$object->getSummaryOfTimeSpent(); @@ -492,23 +504,14 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) else print ''; print '
'.$langs->trans("Project").''; - print $projectstatic->getNomUrl(1); - print '
'.$langs->trans("ThirdParty").''; - if ($projectstatic->thirdparty->id) print $projectstatic->thirdparty->getNomUrl(1); - else print ' '; - print '
'; - print '
'; + + print '
'; + print '
'; + print ''; + print '
'; + dol_fiche_end();