当前位置: 首页>>代码示例>>PHP>>正文


PHP CTask::getDeepChildren方法代码示例

本文整理汇总了PHP中CTask::getDeepChildren方法的典型用法代码示例。如果您正苦于以下问题:PHP CTask::getDeepChildren方法的具体用法?PHP CTask::getDeepChildren怎么用?PHP CTask::getDeepChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CTask的用法示例。


在下文中一共展示了CTask::getDeepChildren方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: date

     //$q->addTable('user_tasks');
     $q->addTable('user_tasks');
     $q->addWhere('user_tasks.user_id = ' . (int) $user_id);
     $q->addWhere('user_tasks.task_id = tasks.task_id');
     $q->addWhere('task_percent_complete = 100');
     //TODO: use date class to construct date.
     $q->addWhere('task_end_date >= \'' . date('Y-m-d 00:00:00', mktime(0, 0, 0, date('m'), date('d') - 7, date('Y'))) . '\'');
     break;
 case 'children':
     $q->addWhere('task_parent = ' . (int) $task_id);
     $q->addWhere('tasks.task_id <> ' . $task_id);
     break;
 case 'deepchildren':
     $taskobj = new CTask();
     $taskobj->load((int) $task_id);
     $deepchildren = $taskobj->getDeepChildren();
     $q->addWhere('tasks.task_id IN (' . implode(',', $deepchildren) . ')');
     $q->addWhere('tasks.task_id <> ' . $task_id);
     break;
 case 'myproj':
     $q->addWhere('project_owner = ' . (int) $user_id);
     break;
 case 'mycomp':
     if (!$AppUI->user_company) {
         $AppUI->user_company = 0;
     }
     $q->addWhere('project_company = ' . (int) $AppUI->user_company);
     break;
 case 'myunfinished':
     $q->addTable('user_tasks');
     $q->addWhere('user_tasks.user_id = ' . (int) $user_id);
开发者ID:eureka2,项目名称:web2project,代码行数:31,代码来源:tasks.php

示例2: getDeepChildren

 public function getDeepChildren()
 {
     $children = $this->getChildren();
     if ($children) {
         $deep_children = array();
         $tempTask = new CTask();
         foreach ($children as $child) {
             $tempTask->load($child);
             $deep_children = array_merge($deep_children, $tempTask->getDeepChildren());
         }
         return array_merge($children, $deep_children);
     }
     return array();
 }
开发者ID:eureka2,项目名称:web2project,代码行数:14,代码来源:tasks.class.php

示例3: getDeepChildren

 function getDeepChildren()
 {
     $q = new DBQuery();
     $q->addTable('tasks');
     $q->addQuery('task_id');
     $q->addWhere("task_id <> '" . $this->task_id . "' AND task_parent = '" . $this->task_id . "'");
     $sql = $q->prepare();
     $q->clear();
     $children = db_loadColumn($sql);
     if ($children) {
         $deep_children = array();
         $tempTask = new CTask();
         foreach ($children as $child) {
             $tempTask->peek($child);
             $deep_children = array_merge($deep_children, $tempTask->getDeepChildren());
         }
         return array_merge($children, $deep_children);
     }
     return array();
 }
开发者ID:hoodoogurus,项目名称:dotprojecteap,代码行数:20,代码来源:tasks.class.php

示例4: dPgetParam

        //$user_id = $AppUI->getState('user_id');
    }
}
// check permissions
$canEdit = $perms->checkModule($m, 'edit');
// if task priority set and items selected, do some work
$action = dPgetParam($_POST, 'action', 99);
$selected = dPgetParam($_POST, 'selected', 0);
if ($selected && count($selected)) {
    $new_task = dPgetParam($_POST, 'new_task', -1);
    $new_project = dPgetParam($_POST, 'new_project', $project_id);
    foreach ($selected as $key => $val) {
        $t = new CTask();
        $t->load($val);
        if (isset($_POST['include_children']) && $_POST['include_children']) {
            $children = $t->getDeepChildren();
        }
        if ($action == 'f') {
            //mark task as completed
            if ($perms->checkModuleItem('tasks', 'edit', $t->task_id)) {
                $t->task_percent_complete = 100;
                $t->store();
            }
            if (isset($children)) {
                foreach ($children as $child_id) {
                    if ($perms->checkModuleItem('tasks', 'edit', $child_t->task_id)) {
                        $child_t = new CTask();
                        $child_t->load($child_id);
                        $child_t->task_percent_complete = 100;
                        $child_t->store();
                    }
开发者ID:kaz190,项目名称:dotproject,代码行数:31,代码来源:organize.php

示例5: defVal

$q->addGroup('project_id');
$q->addOrder('project_name');
$project->setAllowedSQL($AppUI->user_id, $q);
$projects = $q->loadHashList('project_id');
$q->clear();
$caller = defVal(@$_REQUEST['caller'], null);
/**
 * if task filtering has been requested create the list of task_ids
 * which will be used to filter the query
 */
if ($ganttTaskFilter > 0) {
    $task_child_search = new CTask();
    $task_child_search->peek($ganttTaskFilter);
    //$childrenlist[] = $ganttTaskFilter;
    //print_r($childrenlist);
    $childrenlist = $task_child_search->getDeepChildren();
    //print_r($childrenlist);
    $where .= ' t.task_id IN (' . $ganttTaskFilter . ', ' . implode(', ', $childrenlist) . ')';
}
//else {
//	$where = '';
//}
//echo '<pre> $where = ' . $where . '</pre>';
//die;
// gantt is called now by the todo page, too. There is a different filter approach in todo
// so we have to tweak a little bit, also we do not have a special project available
if ($caller == 'todo') {
    $user_id = defVal(@$_REQUEST['user_id'], 0);
    $projects[$project_id]['project_name'] = $AppUI->_('Todo for') . ' ' . dPgetUsernameFromID($user_id);
    $projects[$project_id]['project_color_identifier'] = 'ff6000';
    $q->addTable('tasks', 't');
开发者ID:hightechcompany,项目名称:dotproject,代码行数:31,代码来源:gantt.php

示例6: __extract_from_tasks3

/**
 * @param $f
 * @param $q
 * @param $user_id
 * @param $task_id
 * @param $AppUI
 * @return string
 */
function __extract_from_tasks3($f, $q, $user_id, $task_id, $AppUI)
{
    $f = $f ? $f : '';
    if ($task_id) {
        //if we are on a task context make sure we show ALL the children tasks
        $f = 'deepchildren';
    }
    switch ($f) {
        case 'myfinished7days':
            $q->addWhere('ut.user_id = ' . (int) $user_id);
        case 'allfinished7days':
            $q->addTable('user_tasks');
            $q->addWhere('user_tasks.user_id = ' . (int) $user_id);
            $q->addWhere('user_tasks.task_id = tasks.task_id');
            $q->addWhere('task_percent_complete = 100');
            //TODO: use date class to construct date.
            $q->addWhere('task_end_date >= \'' . date('Y-m-d 00:00:00', mktime(0, 0, 0, date('m'), date('d') - 7, date('Y'))) . '\'');
            break;
        case 'children':
            $q->addWhere('task_parent = ' . (int) $task_id);
            $q->addWhere('tasks.task_id <> ' . $task_id);
            break;
        case 'deepchildren':
            $taskobj = new CTask();
            $taskobj->load((int) $task_id);
            $deepchildren = $taskobj->getDeepChildren();
            $q->addWhere('tasks.task_id IN (' . implode(',', $deepchildren) . ')');
            $q->addWhere('tasks.task_id <> ' . $task_id);
            break;
        case 'myproj':
            $q->addWhere('project_owner = ' . (int) $user_id);
            break;
        case 'mycomp':
            if (!$AppUI->user_company) {
                $AppUI->user_company = 0;
            }
            $q->addWhere('project_company = ' . (int) $AppUI->user_company);
            break;
        case 'myunfinished':
            $q->addTable('user_tasks');
            $q->addWhere('user_tasks.user_id = ' . (int) $user_id);
            $q->addWhere('user_tasks.task_id = tasks.task_id');
            $q->addWhere('(task_percent_complete < 100 OR task_end_date = \'\')');
            break;
        case 'allunfinished':
            $q->addWhere('(task_percent_complete < 100 OR task_end_date = \'\')');
            break;
        case 'unassigned':
            $q->leftJoin('user_tasks', 'ut_empty', 'tasks.task_id = ut_empty.task_id');
            $q->addWhere('ut_empty.task_id IS NULL');
            break;
        case 'taskcreated':
            $q->addWhere('task_creator = ' . (int) $user_id);
            break;
        case 'taskowned':
            $q->addWhere('task_owner = ' . (int) $user_id);
            break;
        case 'all':
            //break;
        //break;
        default:
            if ($user_id) {
                $q->addTable('user_tasks');
                $q->addWhere('user_tasks.user_id = ' . (int) $user_id);
                $q->addWhere('user_tasks.task_id = tasks.task_id');
            }
            break;
    }
    return $q;
}
开发者ID:illuminate3,项目名称:web2project,代码行数:78,代码来源:cleanup_functions.php


注:本文中的CTask::getDeepChildren方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。