From f35ef39f896dbe5de8341735c6c8d9242f80c25f Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 15 Dec 2017 10:09:42 +0800 Subject: [PATCH] * finish task #3449. --- module/build/control.php | 13 ++- module/build/css/view.css | 3 + module/build/view/linkbug.html.php | 4 + module/build/view/linkstory.html.php | 4 + module/build/view/view.html.php | 159 ++++++++++++++------------- 5 files changed, 103 insertions(+), 80 deletions(-) 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'; +?>
id}&browseType=$browseType¶m=$param");?>'> diff --git a/module/build/view/linkstory.html.php b/module/build/view/linkstory.html.php index c32cbc64c6..e62a058945 100644 --- a/module/build/view/linkstory.html.php +++ b/module/build/view/linkstory.html.php @@ -10,6 +10,10 @@ * @link http://www.zentao.net */ ?> +app->getWebRoot() . "js/"; +include '../../common/view/tablesorter.html.php'; +?>
id}&browseType=$browseType¶m=$param");?>'> diff --git a/module/build/view/view.html.php b/module/build/view/view.html.php index 469bec757f..43488d4f67 100644 --- a/module/build/view/view.html.php +++ b/module/build/view/view.html.php @@ -79,9 +79,10 @@ tfoot tr td .table-actions .btn{display:none;}
' id='stories'> @@ -91,16 +92,17 @@ tfoot tr td .table-actions .btn{display:none;} id}")?>' id='linkedStoriesForm'> + id}&type=story&link=$link¶m=$param&orderBy=%s";?> - - - - - - - - + + + + + + + + @@ -150,16 +152,17 @@ tfoot tr td .table-actions .btn{display:none;} id");?>" id='linkedBugsForm'>
idAB;?>priAB;?>story->title;?>openedByAB;?>story->estimateAB;?>statusAB;?>story->stageAB;?>actions;?> idAB);?> priAB);?> story->title);?> openedByAB);?> story->estimateAB);?> statusAB);?>story->stageAB);?> actions?>
+ id}&type=bug&link=$link¶m=$param&orderBy=%s";?> - - - - - - - - + + + + + + + + @@ -203,16 +206,18 @@ tfoot tr td .table-actions .btn{display:none;}
' id='newBugs'>
idAB;?>bug->title;?>bug->status;?>openedByAB;?>bug->openedDateAB;?>bug->resolvedByAB;?>bug->resolvedDateAB;?>actions;?> idAB);?> bug->title);?>bug->status);?> openedByAB);?> bug->openedDateAB);?> bug->resolvedByAB);?>bug->resolvedDateAB);?> actions?>
+ id}&type=newbug&link=$link¶m=$param&orderBy=%s";?> - - - - - - - - + + + + + + + + + @@ -239,60 +244,62 @@ tfoot tr td .table-actions .btn{display:none;}
idAB;?>bug->severityAB;?>bug->title;?>bug->status;?>openedByAB;?>bug->openedDateAB;?>bug->resolvedByAB;?>bug->resolvedDateAB;?> idAB);?>bug->severityAB);?> bug->title);?> bug->status);?> openedByAB);?> bug->openedDateAB);?> bug->resolvedByAB);?> bug->resolvedDateAB);?>actions?>
+
' id='buildInfo'> +
+
+
+ build->basicInfo?> + + + + + + productType != 'normal'):?> + + + + + + + + + + + + + + + + + + + + + + + + + + config->global->flow != 'onlyTest'):?> + + + + + +
build->product;?>productName;?>
product->branch;?>
build->name;?>name;?>
build->builder;?>builder];?>
build->date;?>date;?>
build->scmPath;?>scmPath, $build->scmPath, '_blank')?>
build->filePath;?>filePath, $build->filePath, '_blank');?>
build->desc;?>
desc;?>
+
+ config->global->flow != 'onlyTest'):?> + fetch('file', 'printFiles', array('files' => $build->files, 'fieldset' => 'true'));?> + +
+
+
+
-
-
- config->global->flow != 'onlyTest'):?> -
- build->desc;?> -
desc;?>
-
- -
- build->basicInfo?> - - - - - - productType != 'normal'):?> - - - - - - - - - - - - - - - - - - - - - - - - - -
build->product;?>productName;?>
product->branch;?>
build->name;?>name;?>
build->builder;?>builder];?>
build->date;?>date;?>
build->scmPath;?>scmPath, $build->scmPath, '_blank')?>
build->filePath;?>filePath, $build->filePath, '_blank');?>
-
- config->global->flow != 'onlyTest'):?> - fetch('file', 'printFiles', array('files' => $build->files, 'fieldset' => 'true'));?> - - -
-
config->global->flow != 'onlyTest'):?>