diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d89800227ab..b683bcb0f6c 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1376,7 +1376,7 @@ class Form $out.= '>'; } - $out.= $userstatic->getFullName($langs, 0, 0, $maxlength); + $out.= $userstatic->getFullName($langs, 0, -1, $maxlength); // Complete name with more info $moreinfo=0; if (! empty($conf->global->MAIN_SHOW_LOGIN)) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 004ad3a619f..0569e90d903 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -878,16 +878,18 @@ function searchTaskInChild(&$inc, $parent, &$lines, &$taskrole) * @param int $mytasks Limited to task i am contact to * @param int $statut -1=No filter on statut, 0 or 1 = Filter on status * @param array $listofoppstatus List of opportunity status + * @param array $hiddenfields List of fields to not show * @return void */ -function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks=0, $statut=-1, $listofoppstatus=array()) +function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks=0, $statut=-1, $listofoppstatus=array(),$hiddenfields=array()) { global $langs,$conf,$user,$bc; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $projectstatic=new Project($db); - + $thirdpartystatic=new Societe($db); + $sortfield=''; $sortorder=''; $project_year_filter=0; @@ -895,9 +897,10 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks= $title=$langs->trans("Projects"); if (strcmp($statut, '') && $statut >= 0) $title=$langs->trans("Projects").' '.$langs->trans($projectstatic->statuts_long[$statut]); + $arrayidtypeofcontact=array(); + print '
| '; $projectstatic->ref=$objp->ref; print $projectstatic->getNomUrl(1); - print ' - '.dol_trunc($objp->title,24).' | '; + print ' - '.dol_trunc($objp->title,24); + print ''; + print ''; + if ($objp->fk_soc > 0) + { + $thirdpartystatic->id=$objp->fk_soc; + $thirdpartystatic->ref=$objp->socname; + $thirdpartystatic->name=$objp->socname; + print $thirdpartystatic->getNomUrl(1); + } + print ' | '; if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { print ''; @@ -992,7 +1038,25 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks= print ' | '; } $projectstatic->statut = $objp->status; - if (empty($conf->global->PROJECT_HIDE_TASKS)) print ''.$objp->nb.' | '; + if (empty($conf->global->PROJECT_HIDE_TASKS)) + { + print ''.$objp->nb.' | '; + + $plannedworkload=$objp->planned_workload; + $total_plannedworkload+=$plannedworkload; + print ''.($plannedworkload?convertSecondToTime($plannedworkload):'').' | '; + + if (! in_array('declaredprogress', $hiddenfields)) + { + $declaredprogressworkload=$objp->declared_progess_workload; + $total_declaredprogressworkload+=$declaredprogressworkload; + print '';
+ //print $objp->planned_workload.'-'.$objp->declared_progess_workload." "; + print ($plannedworkload?round(100*$declaredprogressworkload/$plannedworkload,0).'%':''); + print ' | ';
+ }
+ }
+
print ''.$projectstatic->getLibStatut(3).' | '; print "\n"; @@ -1004,14 +1068,22 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks= $i++; } - print '|||
| '.$langs->trans("Total")." | "; + print '||||||||||
| '.$langs->trans("Total")." | "; if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print ''.price($total_opp_amount, 0, '', 1, -1, -1, $conf->currency).' | '; - print ''.$form->textwithpicto(price($ponderated_opp_amount, 0, '', 1, -1, -1, $conf->currency), $langs->trans("OpportunityPonderatedAmount"), 1).' | '; + print ''.price($total_opp_amount, 0, '', 1, -1, -1, $conf->currency).' | '; + print ''.$form->textwithpicto(price($ponderated_opp_amount, 0, '', 1, -1, -1, $conf->currency), $langs->trans("OpportunityPonderatedAmount"), 1).' | '; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) print ''.$total_task.' | '; - + if (empty($conf->global->PROJECT_HIDE_TASKS)) + { + print ''.$total_task.' | '; + print ''.($total_plannedworkload?convertSecondToTime($total_plannedworkload):'').' | '; + if (! in_array('declaredprogress', $hiddenfields)) print ''.($total_plannedworkload?round(100*$total_declaredprogressworkload/$total_plannedworkload,0).'%':'').' | '; + } + print ''; + print ' | |
| '.$tmpyear.' | '; + $var=!$var; + print '||||||||||
| '.$tmpyear.' | '; print ''.price($trim1).' | '; print ''.price($trim2).' | '; print ''.price($trim3).' | '; @@ -455,7 +459,8 @@ function activitytrim($product_type) } if ($trim1+$trim2+$trim3+$trim4 > 0) { - print '|||||||
| '.$tmpyear.' | '; + $var=!$var; + print '||||||||||
| '.$tmpyear.' | '; print ''.price($trim1).' | '; print ''.price($trim2).' | '; print ''.price($trim3).' | '; diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 2f45dce9906..11ae9e78906 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -216,7 +216,7 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) // List of draft projects -print_projecttasks_array($db,$form,$socid,$projectsListId,0,0,$listofoppstatus); +print_projecttasks_array($db,$form,$socid,$projectsListId,0,0,$listofoppstatus,array('declaredprogress')); print '|||||||