</tr>'; $table_rows = ''; foreach ($user_list as $user_id => $user_data) { $tmpuser = "******" . $user_data["contact_first_name"] . ' ' . $user_data['contact_last_name'] . '</b></font></td>'; for ($w = 0, $w_cmp = 1 + ($project_id == 0 ? 1 : 0) + weekCells_r($display_week_hours, $sss, $sse); $w <= $w_cmp; $w++) { $tmpuser .= '<td bgcolor="#D0D0D0"> </td>'; } $tmpuser .= '</tr>'; $tmptasks = ''; $actual_date = $start_date; foreach ($task_list as $task) { if (!isChildTask($task)) { if (isMemberOfTask_r($task_list, $task_assigned_users, $Ntasks, $user_id, $task)) { $tmptasks .= displayTask_r($task_list, $task, 0, $display_week_hours, $sss, $sse, !$project_id, $user_id); // Get children $tmptasks .= doChildren_r($task_list, $task_assigned_users, $Ntasks, $task->task_id, $user_id, 1, $max_levels, $display_week_hours, $sss, $sse, !$project_id); } } } if ($tmptasks != '') { $table_rows .= $tmpuser; $table_rows .= $tmptasks; } } } echo ' <table class="std"> ' . $table_header . $table_rows . ' </table> '; echo '</td>
function doChildren_r($list, $Lusers, $N, $id, $uid, $level, $maxlevels, $display_week_hours, $ss, $se, $log_all_projects = false) { $tmp = ""; if ($maxlevels == -1 || $level < $maxlevels) { for ($c = 0; $c < $N; $c++) { $task = $list[$c]; if ($task->task_parent == $id and isChildTask($task)) { // we have a child, do we have the user as a member? if (isMemberOfTask_r($list, $Lusers, $N, $uid, $task)) { $tmp .= displayTask_r($list, $task, $level, $display_week_hours, $ss, $se, $log_all_projects, $uid); $tmp .= doChildren_r($list, $Lusers, $N, $task->task_id, $uid, $level + 1, $maxlevels, $display_week_hours, $ss, $se, $log_all_projects); } } } } return $tmp; }