Example #1
0
				<td nowrap="nowrap" bgcolor="#A0A0A0">
				<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">&nbsp;</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">
function doChildren($list, $N, $id, $uid, $level, $maxlevels, $display_week_hours, $ss, $se, $canEditINA)
{
    $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($list, $N, $uid, $task)) {
                    $tmp .= displayTask($list, $task, $level, $display_week_hours, $ss, $se, $uid, $canEditINA);
                    $tmp .= doChildren($list, $N, $task->task_id, $uid, $level + 1, $maxlevels, $display_week_hours, $ss, $se, $canEditINA);
                }
            }
        }
    }
    return $tmp;
}
function displayTask_r($list, $task, $level, $display_week_hours, $fromPeriod, $toPeriod, $log_all_projects = false, $user_id = 0)
{
    global $AppUI;
    $tmp = '';
    $tmp .= '<tr><td align="left" nowrap="nowrap">&#160&#160&#160';
    for ($i = 0; $i < $level; $i++) {
        $tmp .= '&#160&#160&#160';
    }
    if ($level == 0) {
        $tmp .= '<b>';
    } elseif ($level == 1) {
        $tmp .= '<i>';
    }
    $tmp .= $task->task_name;
    if ($level == 0) {
        $tmp .= '</b>';
    } elseif ($level == 1) {
        $tmp .= '</i>';
    }
    $tmp .= '&#160&#160&#160</td>';
    if ($log_all_projects) {
        //Show project name when we are logging all projects
        $project = $task->getProject();
        $tmp .= '<td nowrap="nowrap">';
        if (!isChildTask($task)) {
            //However only show the name on parent tasks and not the children to make it a bit cleaner
            $tmp .= $project['project_name'];
        }
        $tmp .= '</td>';
    }
    $df = $AppUI->getPref('SHDATEFORMAT');
    $tmp .= '<td nowrap="nowrap">';
    $dt = new w2p_Utilities_Date($task->task_start_date);
    $tmp .= $dt->format($df);
    $tmp .= '&#160&#160&#160</td>';
    $tmp .= '<td nowrap="nowrap">';
    $dt = new w2p_Utilities_Date($task->task_end_date);
    $tmp .= $dt->format($df);
    $tmp .= '</td>';
    if ($display_week_hours) {
        $tmp .= displayWeeks_r($list, $task, $level, $fromPeriod, $toPeriod, $user_id);
    }
    $tmp .= "</tr>\n";
    return $tmp;
}
Example #4
0
function displayTask($list, $task, $level, $display_week_hours, $fromPeriod, $toPeriod, $log_all_projects = false)
{
    $tmp = "";
    $tmp .= "<tr class=second><td nowrap=\"nowrap\">&#160&#160&#160";
    for ($i = 0; $i < $level; $i++) {
        $tmp .= "&#160&#160&#160";
    }
    if ($level == 0) {
        $tmp .= "<B>";
    } elseif ($level == 1) {
        $tmp .= "<I>";
    }
    $tmp .= $task->task_name;
    if ($level == 0) {
        $tmp .= "</B>";
    } elseif ($level == 1) {
        $tmp .= "</I>";
    }
    $tmp .= "&#160&#160&#160</td>";
    if ($log_all_projects) {
        //Show project name when we are logging all projects
        $project = $task->getProject();
        $tmp .= "<td nowrap=\"nowrap\">";
        if (!isChildTask($task)) {
            //However only show the name on parent tasks and not the children to make it a bit cleaner
            $tmp .= $project["project_name"];
        }
        $tmp .= "</td>";
    }
    $tmp .= "<td nowrap=\"nowrap\">";
    $dt = new CDate($task->task_start_date);
    $tmp .= $dt->format("%d-%m-%Y");
    $tmp .= "&#160&#160&#160</td>";
    $tmp .= "<td nowrap=\"nowrap\">";
    $dt = new CDate($task->task_end_date);
    $tmp .= $dt->format("%d-%m-%Y");
    $tmp .= "</td>";
    if ($display_week_hours) {
        $tmp .= displayWeeks($list, $task, $level, $fromPeriod, $toPeriod);
    }
    $tmp .= "</tr>\n";
    return $tmp;
}