add ressource

This commit is contained in:
florian HENRY 2018-05-21 11:03:48 +02:00
parent f5c245cd19
commit dd946dd197
2 changed files with 24 additions and 3 deletions

View File

@ -332,7 +332,7 @@ function project_admin_prepare_head()
*/ */
function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId='', $addordertick=0, $projectidfortotallink=0, $filterprogresscalc='') function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId='', $addordertick=0, $projectidfortotallink=0, $filterprogresscalc='')
{ {
global $user, $bc, $langs, $conf; global $user, $bc, $langs, $conf, $db;
global $projectstatic, $taskstatic; global $projectstatic, $taskstatic;
$lastprojectid=0; $lastprojectid=0;
@ -531,6 +531,24 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
} }
print '</td>'; print '</td>';
// Ressources
print '<td>';
foreach(array('internal','external') as $source)
{
$tab = $lines[$i]->liste_contact(-1,$source);
$num=count($tab);
if (!empty($num)){
foreach ($tab as $contacttask){
//var_dump($contacttask);
if ($source == 'internal') $c = new User($db);
else $c = new Contact($db);
$c->fetch($contacttask['id']);
print $c->getNomUrl(1) . ' (' . $contacttask['libelle'] . ')' . '<br>';
}
}
}
print '</td>';
// Tick to drag and drop // Tick to drag and drop
if ($addordertick) if ($addordertick)
{ {
@ -579,6 +597,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
if ($total_projectlinesa_planned) print round(100 * $total_projectlinesa_spent / $total_projectlinesa_planned,2).' %'; if ($total_projectlinesa_planned) print round(100 * $total_projectlinesa_spent / $total_projectlinesa_planned,2).' %';
print '</td>'; print '</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 '</tr>'; print '</tr>';
} }

View File

@ -660,6 +660,8 @@ else if ($id > 0 || ! empty($ref))
print '<input class="flat" type="text" size="4" name="search_progressdeclare" value="'.$search_progressdeclare.'">'; print '<input class="flat" type="text" size="4" name="search_progressdeclare" value="'.$search_progressdeclare.'">';
print '</td>'; print '</td>';
print '<td></td>';
// Action column // Action column
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre" align="right">';
$searchpicto=$form->showFilterButtons(); $searchpicto=$form->showFilterButtons();
@ -677,7 +679,7 @@ else if ($id > 0 || ! empty($ref))
print_liste_field_titre("TimeSpent", $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,''); print_liste_field_titre("TimeSpent", $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'');
print_liste_field_titre("ProgressCalculated", $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,''); print_liste_field_titre("ProgressCalculated", $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'');
print_liste_field_titre("ProgressDeclared", $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,''); print_liste_field_titre("ProgressDeclared", $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'');
//print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center" width="80"',$sortfield,$sortorder,'maxwidthsearch '); print_liste_field_titre("TaskRessourceLinks",$_SERVER["PHP_SELF"],'','','',$sortfield,$sortorder,'');
print_liste_field_titre('', $_SERVER["PHP_SELF"],"",'','','align="center" width="80"',$sortfield,$sortorder,'maxwidthsearch '); print_liste_field_titre('', $_SERVER["PHP_SELF"],"",'','','align="center" width="80"',$sortfield,$sortorder,'maxwidthsearch ');
print "</tr>\n"; print "</tr>\n";
@ -689,7 +691,7 @@ else if ($id > 0 || ! empty($ref))
} }
else else
{ {
print '<tr class="oddeven"><td colspan="9" class="opacitymedium">'.$langs->trans("NoTasks").'</td></tr>'; print '<tr class="oddeven"><td colspan="10" class="opacitymedium">'.$langs->trans("NoTasks").'</td></tr>';
} }
print "</table>"; print "</table>";