<font color="black"><b>' . $AppUI->_('Task') . '</b></font> </td>' . ($project_id == 0 ? '<td nowrap="nowrap" bgcolor="#A0A0A0"><font color="black"><b>' . $AppUI->_('Project') . '</b></font></td>' : '') . ' <td nowrap="nowrap" bgcolor="#A0A0A0"><font color="black"><b>' . $AppUI->_('Start Date') . '</b></font></td> <td nowrap="nowrap" bgcolor="#A0A0A0"><font color="black"><b>' . $AppUI->_('End Date') . '</b></font></td>' . weekDates_r($display_week_hours, $sss, $sse) . ' </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 . '
function isMemberOfTask_r($list, $Lusers, $N, $user_id, $task) { for ($i = 0; $i < $N && $list[$i]->task_id != $task->task_id; $i++) { } $users = $Lusers[$i]; foreach ($users as $task_user_id => $user_data) { if ($task_user_id == $user_id) { return true; } } // check child tasks if any for ($c = 0; $c < $N; $c++) { $ntask = $list[$c]; if ($ntask->task_parent == $task->task_id and isChildTask($ntask)) { // we have a child task if (isMemberOfTask_r($list, $Lusers, $N, $user_id, $ntask)) { return true; } } } return false; }