diff --git a/module/bug/lang/en.php b/module/bug/lang/en.php index 5d969c580a..4db584e6cd 100644 --- a/module/bug/lang/en.php +++ b/module/bug/lang/en.php @@ -230,7 +230,7 @@ $lang->bug->typeList['others'] = 'Other'; $lang->bug->statusList[''] = ''; $lang->bug->statusList['active'] = 'Active'; -$lang->bug->statusList['resolved'] = 'Reolved'; +$lang->bug->statusList['resolved'] = 'Resolved'; $lang->bug->statusList['closed'] = 'Closed'; $lang->bug->confirmedList[1] = 'Confirmed'; diff --git a/module/project/control.php b/module/project/control.php index 21593c53b4..cdfa144487 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -137,7 +137,6 @@ class project extends control $products = $this->config->global->flow == 'onlyTask' ? array() : $this->loadModel('product')->getProductsByProject($projectID); setcookie('preProjectID', $projectID, $this->config->cookieLife, $this->config->webRoot); - if($this->cookie->preProjectID != $projectID) { $_COOKIE['moduleBrowseParam'] = $_COOKIE['productBrowseParam'] = 0; diff --git a/module/task/control.php b/module/task/control.php index 88e7440f4c..84a865803b 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -1191,9 +1191,6 @@ class task extends control ->beginIF($this->post->exportType == 'selected')->andWhere('t1.id')->in($this->cookie->checkedItem)->fi() ->orderBy($orderBy)->fetchAll('id'); - $taskList = array_keys($tasks); - if(!empty($taskList)) $children = $this->dao->select('*')->from(TABLE_TASK)->where('parent')->in($taskList)->fetchGroup('parent'); - foreach($tasks as $key => $task) { /* Compute task progress. */ @@ -1212,16 +1209,7 @@ class task extends control $task->progress .= '%'; - $tasks[$key] = $task; - - if(isset($children[$task->id])) - { - foreach($children[$task->id] as $child) - { - $child->name = '[' . $taskLang->childrenAB . '] ' . $child->name; - $tasks[$child->id] = $child; - } - } + if($task->parent) $task->name = '[' . $taskLang->childrenAB . '] ' . $task->name; } } else diff --git a/module/task/model.php b/module/task/model.php index 98cfe25d6b..626855d76f 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1216,7 +1216,6 @@ class taskModel extends model ->leftJoin(TABLE_USER)->alias('t3')->on('t1.assignedTo = t3.account') ->where('t1.project')->eq((int)$projectID) ->andWhere('t1.deleted')->eq(0) - ->andWhere('t1.parent')->eq(0) ->beginIF($productID)->andWhere('t2.product')->eq((int)$productID)->fi() ->beginIF($type == 'undone')->andWhere("(t1.status = 'wait' or t1.status ='doing')")->fi() ->beginIF($type == 'needconfirm')->andWhere('t2.version > t1.storyVersion')->andWhere("t2.status = 'active'")->fi() @@ -1225,26 +1224,22 @@ class taskModel extends model ->beginIF($type == 'delayed')->andWhere('t1.deadline')->gt('1970-1-1')->andWhere('t1.deadline')->lt(date(DT_DATE1))->andWhere('t1.status')->in('wait,doing')->fi() ->beginIF(is_array($type) or strpos(',all,undone,needconfirm,assignedtome,delayed,finishedbyme,', ",$type,") === false)->andWhere('t1.status')->in($type)->fi() ->beginIF($modules)->andWhere('t1.module')->in($modules)->fi() - ->orderBy($orderBy) + ->orderBy('t1.`parent`,' . $orderBy) ->page($pager) ->fetchAll('id'); $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'task', ($productID or $type == 'needconfirm') ? false : true); $taskList = array_keys($tasks); - if(!empty($taskList)) + $taskTeam = $this->dao->select('*')->from(TABLE_TEAM)->where('task')->in($taskList)->fetchGroup('task'); + foreach($taskTeam as $taskID => $team) $tasks[$taskID]->team = $team; + foreach($tasks as $taskID => $task) { - $children = $this->dao->select('t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.product, t2.branch, t2.version AS latestStoryVersion, t2.status AS storyStatus, t3.realname AS assignedToRealName') - ->from(TABLE_TASK)->alias('t1') - ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') - ->leftJoin(TABLE_USER)->alias('t3')->on('t1.assignedTo = t3.account') - ->where('t1.parent')->in($taskList) - ->andWhere('t1.deleted')->eq(0) - ->orderBy('id_desc') - ->fetchGroup('parent'); - foreach($children as $key => $child) $tasks[$key]->children = $child; - $taskTeam = $this->dao->select('*')->from(TABLE_TEAM)->where('task')->in($taskList)->fetchGroup('task'); - foreach($taskTeam as $taskID => $team) $tasks[$taskID]->team = $team; + if($task->parent and isset($tasks[$task->parent])) + { + $tasks[$task->parent]->children[] = $task; + unset($tasks[$taskID]); + } } if($tasks) return $this->processTasks($tasks); diff --git a/module/task/view/view.html.php b/module/task/view/view.html.php index b063ee50e1..36f4a8577c 100644 --- a/module/task/view/view.html.php +++ b/module/task/view/view.html.php @@ -76,6 +76,7 @@ task->legendDesc;?>
desc;?>
+ type != 'ops'):?> fromBug != 0):?>
bug->steps;?> @@ -102,7 +103,8 @@
- children)):?> + + children)):?>
lang->task->children;?> @@ -147,7 +149,7 @@
- + fetch('file', 'printFiles', array('files' => $task->files, 'fieldset' => 'true'));?>
deleted) echo $actionLinks;?>