This commit is contained in:
wangyidong
2022-07-19 15:36:20 +08:00
16 changed files with 94 additions and 14 deletions
+16
View File
@@ -178,6 +178,22 @@ class buildModel extends model
return $this->getExecutionBuilds($executionID, 'bysearch', $buildQuery);
}
/**
* Get story builds.
*
* @param int $storyID
* @access public
* @return array
*/
public function getStoryBuilds($storyID)
{
return $this->dao->select('*')->from(TABLE_BUILD)
->where('deleted')->eq(0)
->andWhere("CONCAT(stories, ',')")->like("%,$storyID,%")
->orderBy('id_desc')
->fetchAll('id');
}
/**
* Get builds in pairs.
*
+2 -2
View File
@@ -63,7 +63,7 @@ tbody tr td:first-child input {display: none;}
</ul>
<div class='tab-content'>
<div class='tab-pane <?php if($type == 'story') echo 'active'?>' id='stories'>
<?php if($canBeChanged and common::hasPriv('build', 'linkStory')):?>
<?php if($canBeChanged and common::hasPriv('build', 'linkStory') and !isonlybody()):?>
<div class='actions'><?php echo html::a("javascript:showLink($build->id, \"story\")", '<i class="icon-link"></i> ' . $lang->build->linkStory, '', "class='btn btn-primary'");?></div>
<div class='linkBox cell hidden'></div>
<?php endif;?>
@@ -158,7 +158,7 @@ tbody tr td:first-child input {display: none;}
</form>
</div>
<div class='tab-pane <?php if($type == 'bug') echo 'active'?>' id='bugs'>
<?php if($canBeChanged and common::hasPriv('build', 'linkBug')):?>
<?php if($canBeChanged and common::hasPriv('build', 'linkBug') and !isonlybody()):?>
<div class='actions'><?php echo html::a("javascript:showLink($build->id, \"bug\")", '<i class="icon-bug"></i> ' . $lang->build->linkBug, '', "class='btn btn-primary'");?></div>
<div class='linkBox cell hidden'></div>
<?php endif;?>
+3 -3
View File
@@ -48,7 +48,7 @@
</ul>
<div class='tab-content'>
<div class='tab-pane <?php if($type == 'story') echo 'active'?>' id='stories'>
<?php if(common::hasPriv('projectrelease', 'linkStory') and $canBeChanged):?>
<?php if(common::hasPriv('projectrelease', 'linkStory') and $canBeChanged and !isonlybody()):?>
<div class='actions'><?php echo html::a("javascript:showLink({$release->id}, \"story\")", '<i class="icon-link"></i> ' . $lang->release->linkStory, '', "class='btn btn-primary'");?></div>
<div class='linkBox cell hidden'></div>
<?php endif;?>
@@ -146,7 +146,7 @@
</form>
</div>
<div class='tab-pane <?php if($type == 'bug') echo 'active'?>' id='bugs'>
<?php if(common::hasPriv('projectrelease', 'linkBug') and $canBeChanged):?>
<?php if(common::hasPriv('projectrelease', 'linkBug') and $canBeChanged and !isonlybody()):?>
<div class='actions'><?php echo html::a("javascript:showLink({$release->id}, \"bug\")", '<i class="icon-bug"></i> ' . $lang->release->linkBug, '', "class='btn btn-primary'");?></div>
<div class='linkBox cell hidden'></div>
<?php endif;?>
@@ -236,7 +236,7 @@
</form>
</div>
<div class='tab-pane <?php if($type == 'leftBug') echo 'active'?>' id='leftBugs'>
<?php if(common::hasPriv('projectrelease', 'linkBug') and $canBeChanged):?>
<?php if(common::hasPriv('projectrelease', 'linkBug') and $canBeChanged and !isonlybody()):?>
<div class='actions'><?php echo html::a("javascript:showLink({$release->id}, \"leftBug\")", '<i class="icon-bug"></i> ' . $lang->release->linkBug, '', "class='btn btn-primary'");?></div>
<div class='linkBox cell hidden'></div>
<?php endif;?>
+16
View File
@@ -103,6 +103,22 @@ class releaseModel extends model
return array_keys($releases);
}
/**
* Get story releases.
*
* @param int $storyID
* @access public
* @return array
*/
public function getStoryReleases($storyID)
{
return $this->dao->select('*')->from(TABLE_RELEASE)
->where('deleted')->eq(0)
->andWhere("CONCAT(stories, ',')")->like("%,$storyID,%")
->orderBy('id_desc')
->fetchAll('id');
}
/**
* Create a release.
*
+3 -3
View File
@@ -50,7 +50,7 @@
</ul>
<div class='tab-content'>
<div class='tab-pane <?php if($type == 'story') echo 'active'?>' id='stories'>
<?php if(common::hasPriv('release', 'linkStory') and $canBeChanged):?>
<?php if(common::hasPriv('release', 'linkStory') and $canBeChanged and !isonlybody()):?>
<div class='actions'><?php echo html::a("javascript:showLink({$release->id}, \"story\")", '<i class="icon-link"></i> ' . $lang->release->linkStory, '', "class='btn btn-primary'");?></div>
<div class='linkBox cell hidden'></div>
<?php endif;?>
@@ -148,7 +148,7 @@
</form>
</div>
<div class='tab-pane <?php if($type == 'bug') echo 'active'?>' id='bugs'>
<?php if(common::hasPriv('release', 'linkBug') and $canBeChanged):?>
<?php if(common::hasPriv('release', 'linkBug') and $canBeChanged and !isonlybody()):?>
<div class='actions'><?php echo html::a("javascript:showLink({$release->id}, \"bug\")", '<i class="icon-bug"></i> ' . $lang->release->linkBug, '', "class='btn btn-primary'");?></div>
<div class='linkBox cell hidden'></div>
<?php endif;?>
@@ -238,7 +238,7 @@
</form>
</div>
<div class='tab-pane <?php if($type == 'leftBug') echo 'active'?>' id='leftBugs'>
<?php if(common::hasPriv('release', 'linkBug') and $canBeChanged):?>
<?php if(common::hasPriv('release', 'linkBug') and $canBeChanged and !isonlybody()):?>
<div class='actions'><?php echo html::a("javascript:showLink({$release->id}, \"leftBug\")", '<i class="icon-bug"></i> ' . $lang->release->linkBug, '', "class='btn btn-primary'");?></div>
<div class='linkBox cell hidden'></div>
<?php endif;?>
+9 -2
View File
@@ -1205,8 +1205,13 @@ class story extends control
*/
public function view($storyID, $version = 0, $param = 0)
{
$uri = $this->app->getURI(true);
$this->session->set('productList', $uri . "#app={$this->app->tab}", 'product');
$uri = $this->app->getURI(true);
$tab = $this->app->tab;
$buildApp = $tab == 'product' ? 'project' : $tab;
$releaseApp = $tab == 'execution' ? 'product' : $tab;
$this->session->set('productList', $uri . "#app={$tab}", 'product');
$this->session->set('releaseList', $uri, $releaseApp);
$this->session->set('buildList', $uri, $buildApp);
$storyID = (int)$storyID;
$story = $this->story->getById($storyID, $version, true);
@@ -1282,6 +1287,8 @@ class story extends control
$this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('story', $storyID);
$this->view->from = $from;
$this->view->param = $param;
$this->view->builds = $this->loadModel('build')->getStoryBuilds($storyID);
$this->view->releases = $this->loadModel('release')->getStoryReleases($storyID);
$this->display();
}
+1
View File
@@ -3,3 +3,4 @@
#legendStories ul li {padding: 10px 0 0 12px; line-height: 20px;}
.main-actions .btn-toolbar .btn {padding-right: 6px; padding-left: 6px;}
.btn-edit-comment {z-index: 100;}
#legendRelated .table-data tbody>tr>th {width: 90px;}
+1
View File
@@ -0,0 +1 @@
#legendRelated .table-data tbody>tr>th {width: 125px;}
+1
View File
@@ -1,2 +1,3 @@
#legendLifeTime .thWidth {width: 100px !important;}
#legendRelated .thWidth {width: 110px !important;}
#legendRelated .table-data tbody>tr>th {width: 105px;}
+1
View File
@@ -0,0 +1 @@
#legendRelated .table-data tbody>tr>th {width: 95px;}
+2
View File
@@ -247,6 +247,8 @@ $lang->story->legendBugs = 'Verküpfte Bugs';
$lang->story->legendFromBug = 'Verküpfte Formular Bugs';
$lang->story->legendCases = 'Verküpfte Fälle';
$lang->story->legendLinkStories = 'Verküpfte Storys';
$lang->story->legendBuilds = 'Verkü pfte Builds';
$lang->story->legendReleases = 'Verkü pfte Releases';
$lang->story->legendChildStories = 'Story auteien';
$lang->story->legendSpec = 'Beschreibung';
$lang->story->legendVerify = 'Akzeptanz';
+2
View File
@@ -247,6 +247,8 @@ $lang->story->legendBugs = 'Linked Bugs';
$lang->story->legendFromBug = 'From Bug';
$lang->story->legendCases = 'Linked Cases';
$lang->story->legendLinkStories = 'Linked Stories';
$lang->story->legendBuilds = 'Linked Builds';
$lang->story->legendReleases = 'Linked Releases';
$lang->story->legendChildStories = 'Child Stories';
$lang->story->legendSpec = 'Description';
$lang->story->legendVerify = 'Acceptance';
+2
View File
@@ -246,6 +246,8 @@ $lang->story->legendProjectAndTask = $lang->executionCommon . ' et Tâches';
$lang->story->legendBugs = 'Bugs Liés';
$lang->story->legendFromBug = 'du Bug';
$lang->story->legendCases = 'CasTests Liés';
$lang->story->legendBuilds = 'Builds Lié s';
$lang->story->legendReleases = 'Releases Lié s';
$lang->story->legendLinkStories = 'Stories Liées';
$lang->story->legendChildStories = 'Sous-Stories';
$lang->story->legendSpec = 'Description';
+2
View File
@@ -246,6 +246,8 @@ $lang->story->legendProjectAndTask = $lang->executionCommon . '任务';
$lang->story->legendBugs = '相关Bug';
$lang->story->legendFromBug = '来源Bug';
$lang->story->legendCases = '相关用例';
$lang->story->legendBuilds = '相关版本';
$lang->story->legendReleases = '相关发布';
$lang->story->legendLinkStories = "相关{$lang->SRCommon}";
$lang->story->legendChildStories = "细分{$lang->SRCommon}";
$lang->story->legendSpec = "需求描述";
+31 -2
View File
@@ -456,7 +456,7 @@
<tbody>
<?php if(!empty($fromBug)):?>
<tr>
<th class='w-90px'><?php echo $lang->story->legendFromBug;?></th>
<th><?php echo $lang->story->legendFromBug;?></th>
<td class='pd-0'>
<ul class='list-unstyled'>
<?php echo "<li title='#$fromBug->id $fromBug->title'>" . html::a($this->createLink('bug', 'view', "bugID=$fromBug->id", '', true), "#$fromBug->id $fromBug->title", '', "class='iframe' data-width='80%'") . '</li>';?>
@@ -465,7 +465,7 @@
</tr>
<?php endif;?>
<tr>
<th class='w-90px'><?php echo $lang->story->legendBugs;?></th>
<th><?php echo $lang->story->legendBugs;?></th>
<td class='pd-0'>
<ul class='list-unstyled'>
<?php
@@ -492,6 +492,35 @@
</ul>
</td>
</tr>
<tr>
<th><?php echo $lang->story->legendBuilds;?></th>
<td class='pd-0'>
<ul class='list-unstyled'>
<?php
$tab = $app->tab == 'product' ? 'project' : $app->tab;
foreach($builds as $build)
{
echo "<li title='$build->id $build->name'>" . html::a($this->createLink('build', 'view', "buildID=$build->id"), "#$build->id $build->name", '', "data-app='{$tab}'") . '</li>';
}
?>
</ul>
</td>
</tr>
<tr>
<th><?php echo $lang->story->legendReleases;?></th>
<td class='pd-0'>
<ul class='list-unstyled'>
<?php
$releaseModule = $app->tab == 'project' ? 'projectrelease' : 'release';
$tab = $app->tab == 'execution' ? 'product' : $app->tab;
foreach($releases as $release)
{
echo "<li title='$release->id $release->name'>" . html::a($this->createLink($releaseModule, 'view', "release=$release->id"), "#$release->id $release->name", '', "data-app='{$tab}'") . '</li>';
}
?>
</ul>
</td>
</tr>
<tr>
<th><?php echo $lang->story->linkMR;?></th>
<td class='pd-0'>
File diff suppressed because one or more lines are too long