diff --git a/module/bug/model.php b/module/bug/model.php index 6eecd56864..6a0114f9ed 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1467,7 +1467,7 @@ class bugModel extends model $i++; } } - + return array('title' => $title, 'steps' => $bugSteps, 'storyID' => $run->case->story, 'moduleID' => $run->case->module, 'version' => $run->case->version); } @@ -1538,7 +1538,7 @@ class bugModel extends model { $datas = $this->dao->select('module as name, count(module) as value')->from(TABLE_BUG)->where($this->reportCondition())->groupBy('module')->orderBy('value DESC')->fetchAll('name'); if(!$datas) return array(); - $modules = $this->loadModel('tree')->getModulesName(array_keys($datas)); + $modules = $this->loadModel('tree')->getModulesName(array_keys($datas),true,true); foreach($datas as $moduleID => $data) $data->name = isset($modules[$moduleID]) ? $modules[$moduleID] : '/'; return $datas; } diff --git a/module/story/control.php b/module/story/control.php index c0c6c0c174..9865defb61 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1268,11 +1268,11 @@ class story extends control /** * The report page. - * - * @param int $productID - * @param string $browseType + * + * @param int $productID + * @param string $browseType * @param int $branchID - * @param int $moduleID + * @param int $moduleID * @access public * @return void */ @@ -1307,12 +1307,12 @@ class story extends control $this->view->checkedCharts = $this->post->charts ? join(',', $this->post->charts) : ''; $this->display(); } - + /** * get data to export - * - * @param int $productID - * @param string $orderBy + * + * @param int $productID + * @param string $orderBy * @access public * @return void */ diff --git a/module/story/model.php b/module/story/model.php index 1a23663c6e..43e514243a 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -193,7 +193,7 @@ class storyModel extends model ->set('version')->eq(1) ->exec(); } - + if($bugID > 0) { $bug = new stdclass(); @@ -1959,7 +1959,7 @@ class storyModel extends model /** * Get report data of storys per product - * + * * @access public * @return array */ @@ -1975,25 +1975,46 @@ class storyModel extends model } /** - * Get report data of storys per module - * + * Get report data of storys per module + * * @access public * @return array */ public function getDataOfStorysPerModule() { - $datas = $this->dao->select('module as name, count(module) as value')->from(TABLE_STORY) + $datas = $this->dao->select('module as name, count(module) as value, product, branch')->from(TABLE_STORY) ->where($this->reportCondition()) ->groupBy('module')->orderBy('value DESC')->fetchAll('name'); if(!$datas) return array(); + + $branchIDList = array(); + foreach($datas as $key => $project) + { + if(!$project->branch) continue; + $branchIDList[] = $project->branch; + } + + $branchIDList = array_unique($branchIDList); + $branchs = $this->dao->select('id, name')->from(TABLE_BRANCH)->where('id')->in($branchIDList)->andWhere('deleted')->eq(0)->fetchALL('id'); $modules = $this->loadModel('tree')->getModulesName(array_keys($datas)); - foreach($datas as $moduleID => $data) $data->name = isset($modules[$moduleID]) ? $modules[$moduleID] : '/'; + + foreach($datas as $moduleID => $data) + { + $branch = ''; + if(isset($branchs[$data->branch]->name)) + { + $branch = '/' . $branchs[$data->branch]->name; + } + + $data->name = $branch . (isset($modules[$moduleID]) ? $modules[$moduleID] : '/'); + } + return $datas; } /** * Get report data of storys per source - * + * * @access public * @return array */ diff --git a/module/task/control.php b/module/task/control.php index 0fc6c9e2f2..65385c923b 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -1087,7 +1087,7 @@ class task extends control */ public function report($projectID, $browseType = 'all') { - + $this->loadModel('report'); $this->view->charts = array(); diff --git a/module/task/model.php b/module/task/model.php index 8e2b667348..0ab27e780b 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1356,7 +1356,8 @@ class taskModel extends model ->orderBy('value DESC') ->fetchAll('name'); if(!$datas) return array(); - $modules = $this->loadModel('tree')->getModulesName(array_keys($datas)); + + $modules = $this->loadModel('tree')->getModulesName(array_keys($datas),true,true); foreach($datas as $moduleID => $data) $data->name = isset($modules[$moduleID]) ? $modules[$moduleID] : '/'; return $datas; } @@ -1422,7 +1423,7 @@ class taskModel extends model return $priList; } - + /** * Get report data of tasks per deadline * diff --git a/module/task/view/edit.html.php b/module/task/view/edit.html.php index 59a1159c6e..124a0a7386 100644 --- a/module/task/view/edit.html.php +++ b/module/task/view/edit.html.php @@ -62,11 +62,11 @@