* finish task #3449.

This commit is contained in:
wangyidong
2017-12-15 10:09:42 +08:00
parent 73fd2f0575
commit f35ef39f89
5 changed files with 103 additions and 80 deletions
+9 -4
View File
@@ -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();
}
+3
View File
@@ -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;}
+4
View File
@@ -10,6 +10,10 @@
* @link http://www.zentao.net
*/
?>
<?php
$jsRoot = $this->app->getWebRoot() . "js/";
include '../../common/view/tablesorter.html.php';
?>
<div id='querybox' class='show'></div>
<div id='unlinkBugList'>
<form method='post' id='unlinkedBugsForm' target='hiddenwin' action='<?php echo $this->createLink('build', 'linkBug', "buildID={$build->id}&browseType=$browseType&param=$param");?>'>
+4
View File
@@ -10,6 +10,10 @@
* @link http://www.zentao.net
*/
?>
<?php
$jsRoot = $this->app->getWebRoot() . "js/";
include '../../common/view/tablesorter.html.php';
?>
<div id='querybox' class='show'></div>
<div id='unlinkStoryList'>
<form method='post' id='unlinkedStoriesForm' target='hiddenwin' action='<?php echo $this->createLink('build', 'linkStory', "buildID={$build->id}&browseType=$browseType&param=$param");?>'>
+83 -76
View File
@@ -79,9 +79,10 @@ tfoot tr td .table-actions .btn{display:none;}
<div class='tabs'>
<?php $countStories = count($stories); $countBugs = count($bugs); $countNewBugs = count($generatedBugs);?>
<ul class='nav nav-tabs'>
<li <?php if($type == 'story') echo "class='active'"?>><a href='#stories' data-toggle='tab'><?php echo html::icon($lang->icons['story'], 'green') . ' ' . $lang->build->stories;?></a></li>
<li <?php if($type == 'bug') echo "class='active'"?>><a href='#bugs' data-toggle='tab'><?php echo html::icon($lang->icons['bug'], 'green') . ' ' . $lang->build->bugs;?></a></li>
<li <?php if($type == 'newbug') echo "class='active'"?>><a href='#newBugs' data-toggle='tab'><?php echo html::icon($lang->icons['bug'], 'red') . ' ' . $lang->build->generatedBugs;?></a></li>
<li <?php if($type == 'story') echo "class='active'"?>><a href='#stories' data-toggle='tab'><?php echo html::icon($lang->icons['story'], 'green') . ' ' . $lang->build->stories;?></a></li>
<li <?php if($type == 'bug') echo "class='active'"?>><a href='#bugs' data-toggle='tab'><?php echo html::icon($lang->icons['bug'], 'green') . ' ' . $lang->build->bugs;?></a></li>
<li <?php if($type == 'newbug') echo "class='active'"?>><a href='#newBugs' data-toggle='tab'><?php echo html::icon($lang->icons['bug'], 'red') . ' ' . $lang->build->generatedBugs;?></a></li>
<li <?php if($type == 'buildInfo') echo "class='active'"?>><a href='#buildInfo' data-toggle='tab'><?php echo html::icon($lang->icons['plan'], 'blue') . ' ' . $lang->build->view;?></a></li>
</ul>
<div class='tab-content'>
<div class='tab-pane <?php if($type == 'story') echo 'active'?>' id='stories'>
@@ -91,16 +92,17 @@ tfoot tr td .table-actions .btn{display:none;}
<?php endif;?>
<form method='post' target='hiddenwin' action='<?php echo inlink('batchUnlinkStory', "buildID={$build->id}")?>' id='linkedStoriesForm'>
<table class='table table-hover table-condensed table-striped tablesorter table-fixed table-selectable' id='storyList'>
<?php $vars = "buildID={$build->id}&type=story&link=$link&param=$param&orderBy=%s";?>
<thead>
<tr>
<th class='w-id'><?php echo $lang->idAB;?></th>
<th class='w-pri'><?php echo $lang->priAB;?></th>
<th><?php echo $lang->story->title;?></th>
<th class='w-user'><?php echo $lang->openedByAB;?></th>
<th class='w-hour'><?php echo $lang->story->estimateAB;?></th>
<th class='w-hour'><?php echo $lang->statusAB;?></th>
<th class='w-100px'><?php echo $lang->story->stageAB;?></th>
<th class='w-50px'><?php echo $lang->actions;?></th>
<th class='w-id'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
<th class='w-pri'> <?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
<th> <?php common::printOrderLink('title', $orderBy, $vars, $lang->story->title);?></th>
<th class='w-user'> <?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->openedByAB);?></th>
<th class='w-hour'> <?php common::printOrderLink('estimate', $orderBy, $vars, $lang->story->estimateAB);?></th>
<th class='w-hour'> <?php common::printOrderLink('status', $orderBy, $vars, $lang->statusAB);?></th>
<th class='w-100px'><?php common::printOrderLink('stage', $orderBy, $vars, $lang->story->stageAB);?></th>
<th class='w-50px {sorter:false}'> <?php echo $lang->actions?></th>
</tr>
</thead>
<?php $canBatchUnlink = common::hasPriv('build', 'batchUnlinkStory');?>
@@ -150,16 +152,17 @@ tfoot tr td .table-actions .btn{display:none;}
<?php endif;?>
<form method='post' target='hiddenwin' action="<?php echo inLink('batchUnlinkBug', "build=$build->id");?>" id='linkedBugsForm'>
<table class='table table-hover table-condensed table-striped tablesorter table-fixed table-selectable' id='bugList'>
<?php $vars = "buildID={$build->id}&type=bug&link=$link&param=$param&orderBy=%s";?>
<thead>
<tr>
<th class='w-id'><?php echo $lang->idAB;?></th>
<th><?php echo $lang->bug->title;?></th>
<th class='w-100px'><?php echo $lang->bug->status;?></th>
<th class='w-user'><?php echo $lang->openedByAB;?></th>
<th class='w-date'><?php echo $lang->bug->openedDateAB;?></th>
<th class='w-user'><?php echo $lang->bug->resolvedByAB;?></th>
<th class='w-100px'><?php echo $lang->bug->resolvedDateAB;?></th>
<th class='w-50px'><?php echo $lang->actions;?></th>
<th class='w-id'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
<th> <?php common::printOrderLink('title', $orderBy, $vars, $lang->bug->title);?></th>
<th class='w-100px'><?php common::printOrderLink('status', $orderBy, $vars, $lang->bug->status);?></th>
<th class='w-user'> <?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->openedByAB);?></th>
<th class='w-date'> <?php common::printOrderLink('openedDate', $orderBy, $vars, $lang->bug->openedDateAB);?></th>
<th class='w-user'> <?php common::printOrderLink('resolvedBy', $orderBy, $vars, $lang->bug->resolvedByAB);?></th>
<th class='w-100px'><?php common::printOrderLink('resolvedDate', $orderBy, $vars, $lang->bug->resolvedDateAB);?></th>
<th class='w-50px {sorter:false}'> <?php echo $lang->actions?></th>
</tr>
</thead>
<?php $canBatchUnlink = common::hasPriv('build', 'batchUnlinkBug');?>
@@ -203,16 +206,18 @@ tfoot tr td .table-actions .btn{display:none;}
</div>
<div class='tab-pane <?php if($type == 'newbug') echo 'active'?>' id='newBugs'>
<table class='table table-hover table-condensed table-striped tablesorter table-fixed'>
<?php $vars = "buildID={$build->id}&type=newbug&link=$link&param=$param&orderBy=%s";?>
<thead>
<tr>
<th class='w-id'><?php echo $lang->idAB;?></th>
<th class='w-severity'><?php echo $lang->bug->severityAB;?></th>
<th><?php echo $lang->bug->title;?></th>
<th class='w-100px'><?php echo $lang->bug->status;?></th>
<th class='w-user'><?php echo $lang->openedByAB;?></th>
<th class='w-date'><?php echo $lang->bug->openedDateAB;?></th>
<th class='w-user'><?php echo $lang->bug->resolvedByAB;?></th>
<th class='w-100px'><?php echo $lang->bug->resolvedDateAB;?></th>
<th class='w-id'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
<th class='w-severity'><?php common::printOrderLink('severity', $orderBy, $vars, $lang->bug->severityAB);?></th>
<th> <?php common::printOrderLink('title', $orderBy, $vars, $lang->bug->title);?></th>
<th class='w-100px'> <?php common::printOrderLink('status', $orderBy, $vars, $lang->bug->status);?></th>
<th class='w-user'> <?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->openedByAB);?></th>
<th class='w-date'> <?php common::printOrderLink('openedDate', $orderBy, $vars, $lang->bug->openedDateAB);?></th>
<th class='w-user'> <?php common::printOrderLink('resolvedBy', $orderBy, $vars, $lang->bug->resolvedByAB);?></th>
<th class='w-100px'> <?php common::printOrderLink('resolvedDate', $orderBy, $vars, $lang->bug->resolvedDateAB);?></th>
<th class='w-50px {sorter:false}'><?php echo $lang->actions?></th>
</tr>
</thead>
<?php foreach($generatedBugs as $bug):?>
@@ -239,60 +244,62 @@ tfoot tr td .table-actions .btn{display:none;}
</tfoot>
</table>
</div>
<div class='tab-pane <?php if($type == 'buildInfo') echo 'active'?>' id='buildInfo'>
<div class="row-table">
<div class='col-main'>
<fieldset>
<legend><?php echo $lang->build->basicInfo?></legend>
<table class='table table-data table-condensed table-borderless table-fixed'>
<tr>
<th class='w-80px'><?php echo $lang->build->product;?></th>
<td><?php echo $build->productName;?></td>
</tr>
<?php if($build->productType != 'normal'):?>
<tr>
<th><?php echo $lang->product->branch;?></th>
<td><?php echo $branchName;?></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->build->name;?></th>
<td><?php echo $build->name;?></td>
</tr>
<tr>
<th><?php echo $lang->build->builder;?></th>
<td><?php echo $users[$build->builder];?></td>
</tr>
<tr>
<th><?php echo $lang->build->date;?></th>
<td><?php echo $build->date;?></td>
</tr>
<tr>
<th><?php echo $lang->build->scmPath;?></th>
<td style='word-break:break-all;'><?php echo html::a($build->scmPath, $build->scmPath, '_blank')?></td>
</tr>
<tr>
<th><?php echo $lang->build->filePath;?></th>
<td style='word-break:break-all;'><?php echo html::a($build->filePath, $build->filePath, '_blank');?></td>
</tr>
<?php if($this->config->global->flow != 'onlyTest'):?>
<tr>
<th><?php echo $lang->build->desc;?></th>
<td><div class='article-content'><?php echo $build->desc;?></div></td>
</tr>
<?php endif;?>
</table>
</fieldset>
<?php if($this->config->global->flow != 'onlyTest'):?>
<?php echo $this->fetch('file', 'printFiles', array('files' => $build->files, 'fieldset' => 'true'));?>
<?php endif;?>
</div>
<div class="col-side"><?php include '../../common/view/action.html.php';?></div>
</div>
</div>
</div>
</div>
<?php endif;?>
</div>
</div>
<div class='col-side'>
<div class='main-side main'>
<?php if($this->config->global->flow != 'onlyTest'):?>
<fieldset>
<legend><?php echo $lang->build->desc;?></legend>
<div class='article-content'><?php echo $build->desc;?></div>
</fieldset>
<?php endif;?>
<fieldset>
<legend><?php echo $lang->build->basicInfo?></legend>
<table class='table table-data table-condensed table-borderless table-fixed'>
<tr>
<th class='w-80px'><?php echo $lang->build->product;?></th>
<td><?php echo $build->productName;?></td>
</tr>
<?php if($build->productType != 'normal'):?>
<tr>
<th><?php echo $lang->product->branch;?></th>
<td><?php echo $branchName;?></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->build->name;?></th>
<td><?php echo $build->name;?></td>
</tr>
<tr>
<th><?php echo $lang->build->builder;?></th>
<td><?php echo $users[$build->builder];?></td>
</tr>
<tr>
<th><?php echo $lang->build->date;?></th>
<td><?php echo $build->date;?></td>
</tr>
<tr>
<th><?php echo $lang->build->scmPath;?></th>
<td style='word-break:break-all;'><?php echo html::a($build->scmPath, $build->scmPath, '_blank')?></td>
</tr>
<tr>
<th><?php echo $lang->build->filePath;?></th>
<td style='word-break:break-all;'><?php echo html::a($build->filePath, $build->filePath, '_blank');?></td>
</tr>
</table>
</fieldset>
<?php if($this->config->global->flow != 'onlyTest'):?>
<?php echo $this->fetch('file', 'printFiles', array('files' => $build->files, 'fieldset' => 'true'));?>
<?php include '../../common/view/action.html.php';?>
<?php endif;?>
</div>
</div>
</div>
<?php if($this->config->global->flow != 'onlyTest'):?>
<?php js::set('param', helper::safe64Decode($param))?>