예제 #1
0
    $parents = array();
    $tnums = count($p['tasks']);
    for ($i = 0; $i < $tnums; $i++) {
        $t = $p['tasks'][$i];
        if (!isset($parents[$t['task_parent']])) {
            $parents[$t['task_parent']] = false;
        }
        if ($t['task_parent'] == $t['task_id']) {
            showfiltertask($t);
            findfiltertaskchild($p['tasks'], $t['task_id']);
        }
    }
    // Check for ophans.
    foreach ($parents as $id => $ok) {
        if (!$ok) {
            findfiltertaskchild($p['tasks'], $id);
        }
    }
}
/**
 * the results of the above bits are stored in $filter_task_list (array)
 * 
 */
// months to scroll
$scroll_date = 1;
$display_option = w2PgetParam($_POST, 'display_option', 'this_month');
// format dates
$df = $AppUI->getPref('SHDATEFORMAT');
if ($display_option == 'custom') {
    // custom dates
    $start_date = intval($sdate) ? new w2p_Utilities_Date($sdate) : new w2p_Utilities_Date();
예제 #2
0
function findfiltertaskchild(&$tarr, $parent, $level = 0)
{
    global $projects, $filter_task_list;
    $level = $level + 1;
    $n = count($tarr);
    for ($x = 0; $x < $n; $x++) {
        if ($tarr[$x]['task_parent'] == $parent && $tarr[$x]['task_parent'] != $tarr[$x]['task_id']) {
            showfiltertask($tarr[$x], $level);
            findfiltertaskchild($tarr, $tarr[$x]['task_id'], $level);
        }
    }
}
예제 #3
0
function findfiltertaskchild(&$tarr, $parent, $level = 0)
{
    $level++;
    $n = count($tarr);
    for ($x = 0; $x < $n; $x++) {
        if ($tarr[$x]['task_parent'] == $parent && $tarr[$x]['task_parent'] != $tarr[$x]['task_id']) {
            showfiltertask($tarr[$x], $level);
            findfiltertaskchild($tarr, $tarr[$x]['task_id'], $level);
        }
    }
}