diff --git a/module/build/control.php b/module/build/control.php index 6fe1f9d488..21a79b3d9d 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -174,7 +174,7 @@ class build extends control * @access public * @return void */ - public function view($buildID, $type = 'story', $link = 'false', $param = '') + public function view($buildID, $type = 'story', $link = 'false', $param = '', $orderBy = 'id_desc') { if($type == 'story')$this->session->set('storyList', $this->app->getURI(true)); if($type == 'bug') $this->session->set('bugList', $this->app->getURI(true)); @@ -189,7 +189,9 @@ class build extends control $product = $this->loadModel('product')->getById($build->product); if($product->type != 'normal') $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]); - $bugs = $this->dao->select('*')->from(TABLE_BUG)->where('id')->in($build->bugs)->andWhere('deleted')->eq(0)->fetchAll(); + $bugs = $this->dao->select('*')->from(TABLE_BUG)->where('id')->in($build->bugs)->andWhere('deleted')->eq(0) + ->beginIF($type == 'bug')->orderBy($orderBy)->fi() + ->fetchAll(); if($this->config->global->flow == 'onlyTest') { @@ -203,7 +205,9 @@ class build extends control } else { - $stories = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($build->stories)->andWhere('deleted')->eq(0)->fetchAll('id'); + $stories = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($build->stories)->andWhere('deleted')->eq(0) + ->beginIF($type == 'story')->orderBy($orderBy)->fi() + ->fetchAll('id'); $stages = $this->dao->select('*')->from(TABLE_STORYSTAGE)->where('story')->in($build->stories)->andWhere('branch')->eq($build->branch)->fetchPairs('story', 'stage'); foreach($stages as $storyID => $stage)$stories[$storyID]->stage = $stage; @@ -214,7 +218,7 @@ class build extends control $this->view->position[] = html::a($this->createLink('project', 'task', "projectID=$build->project"), $projects[$build->project]); $this->view->position[] = $this->lang->build->view; $this->view->stories = $stories; - $this->view->generatedBugs = $this->bug->getProjectBugs($build->project, $build->id, '', 0, 'status_desc,id_desc', null); + $this->view->generatedBugs = $this->bug->getProjectBugs($build->project, $build->id, '', 0, $type == 'newbug' ? $orderBy : 'status_desc,id_desc', null); $this->view->bugs = $bugs; $this->view->type = $type; } @@ -225,6 +229,7 @@ class build extends control $this->view->actions = $this->loadModel('action')->getList('build', $buildID); $this->view->link = $link; $this->view->param = $param; + $this->view->orderBy = $orderBy; $this->view->branchName = $build->productType == 'normal' ? '' : $this->loadModel('branch')->getById($build->branch); $this->display(); } diff --git a/module/build/css/view.css b/module/build/css/view.css index 95edbdd747..7d36be4c67 100644 --- a/module/build/css/view.css +++ b/module/build/css/view.css @@ -10,5 +10,8 @@ .table-actions {padding-left: 5px;} +#buildInfo {border-top: 1px solid #ddd;} +#buildInfo > div {padding-top: 15px;} + #querybox form {margin: 0px !important;} #moreOrLite {right: 0px !important;} diff --git a/module/build/view/linkbug.html.php b/module/build/view/linkbug.html.php index a4ebfc4e74..299881388e 100644 --- a/module/build/view/linkbug.html.php +++ b/module/build/view/linkbug.html.php @@ -10,6 +10,10 @@ * @link http://www.zentao.net */ ?> +app->getWebRoot() . "js/"; +include '../../common/view/tablesorter.html.php'; +?>