From d9ddbd045019e11a42d2e3bfe7f3bdcdfa6ce6df Mon Sep 17 00:00:00 2001 From: chenfeiCF Date: Fri, 19 Feb 2016 13:49:25 +0800 Subject: [PATCH] * finish task #2458. --- module/project/control.php | 38 ++++++++++++++++-------------- module/project/model.php | 2 +- module/project/view/story.html.php | 2 +- module/project/view/task.html.php | 1 + module/task/model.php | 4 ++-- 5 files changed, 25 insertions(+), 22 deletions(-) diff --git a/module/project/control.php b/module/project/control.php index 0572c2ab96..a82fec2a43 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -135,6 +135,7 @@ class project extends control $productID = ($browseType == 'byproduct') ? (int)$param : 0; $project = $this->commonAction($projectID, $status); $projectID = $project->id; + $products = $this->loadModel('product')->getProductsByProject($projectID); /* Save to session. */ $uri = $this->app->getURI(true); @@ -225,24 +226,25 @@ class project extends control foreach($this->view->teamMembers as $key => $member) $memberPairs[$key] = $member->realname; /* Assign. */ - $this->view->tasks = $tasks; - $this->view->summary = $this->project->summary($tasks); - $this->view->tabID = 'task'; - $this->view->pager = $pager; - $this->view->recTotal = $pager->recTotal; - $this->view->recPerPage = $pager->recPerPage; - $this->view->orderBy = $orderBy; - $this->view->browseType = $browseType; - $this->view->status = $status; - $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->param = $param; - $this->view->projectID = $projectID; - $this->view->project = $project; - $this->view->productID = $productID; - $this->view->moduleID = $moduleID; - $this->view->moduleTree = $this->tree->getTaskTreeMenu($projectID, $productID = 0, $startModuleID = 0, array('treeModel', 'createTaskLink')); - $this->view->projectTree = $this->project->tree(); - $this->view->memberPairs = $memberPairs; + $this->view->tasks = $tasks; + $this->view->summary = $this->project->summary($tasks); + $this->view->tabID = 'task'; + $this->view->pager = $pager; + $this->view->recTotal = $pager->recTotal; + $this->view->recPerPage = $pager->recPerPage; + $this->view->orderBy = $orderBy; + $this->view->browseType = $browseType; + $this->view->status = $status; + $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->view->param = $param; + $this->view->projectID = $projectID; + $this->view->project = $project; + $this->view->productID = $productID; + $this->view->moduleID = $moduleID; + $this->view->moduleTree = $this->tree->getTaskTreeMenu($projectID, $productID = 0, $startModuleID = 0, array('treeModel', 'createTaskLink')); + $this->view->projectTree = $this->project->tree(); + $this->view->memberPairs = $memberPairs; + $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), 'noempty'); $this->display(); } diff --git a/module/project/model.php b/module/project/model.php index 6d130d5bde..2e7adbbb12 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1455,7 +1455,7 @@ class projectModel extends model ->page($pager) ->fetchAll('id'); - $tasks = $this->dao->select('t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.version AS latestStoryVersion, t2.status AS storyStatus, t3.realname AS assignedToRealName') + $tasks = $this->dao->select('t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.product AS storyProduct, t2.branch AS storyBranch, 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') diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php index c140b89116..829e775ed0 100644 --- a/module/project/view/story.html.php +++ b/module/project/view/story.html.php @@ -79,7 +79,7 @@ story->priList, $story->pri, $story->pri)?>'>story->priList, $story->pri, $story->pri);?> - product][$story->branch])) echo "" . $branchGroups[$story->product][$story->branch] . '';?> + product][$story->branch])) echo "" . $branchGroups[$story->product][$story->branch] . '';?> title);?> openedBy];?> diff --git a/module/project/view/task.html.php b/module/project/view/task.html.php index 8e43f3a94e..a15f42150e 100644 --- a/module/project/view/task.html.php +++ b/module/project/view/task.html.php @@ -76,6 +76,7 @@ task->priList, $task->pri, $task->pri)?>'>task->priList, $task->pri, $task->pri);?> + storyProduct][$task->storyBranch])) echo "" . $branchGroups[$task->storyProduct][$task->storyBranch] . '';?> id", $task->name)) echo $task->name; if($task->fromBug) echo html::a($this->createLink('bug', 'view', "id=$task->fromBug"), "[BUG#$task->fromBug]", '_blank', "class='bug'"); diff --git a/module/task/model.php b/module/task/model.php index a303510a9e..32871919f2 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -773,7 +773,7 @@ class taskModel extends model */ public function getTasksByModule($projectID = 0, $moduleIds = 0, $orderBy = 'id_desc', $pager = null) { - $tasks = $this->dao->select('t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.version AS latestStoryVersion, t2.status AS storyStatus, t3.realname AS assignedToRealName') + $tasks = $this->dao->select('t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.product AS storyProduct, t2.branch AS storyBranch, 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') @@ -803,7 +803,7 @@ class taskModel extends model public function getProjectTasks($projectID, $type = 'all', $orderBy = 'status_asc, id_desc', $pager = null) { if(is_string($type)) $type = strtolower($type); - $tasks = $this->dao->select('t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.version AS latestStoryVersion, t2.status AS storyStatus, t3.realname AS assignedToRealName') + $tasks = $this->dao->select('t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.product AS storyProduct, t2.branch AS storyBranch, 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')