* Finish task #113260.
This commit is contained in:
@@ -372,13 +372,14 @@ class release extends control
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
$excludeStoryIdList = $this->releaseZen->getExcludeStoryIdList($release);
|
||||
if($browseType == 'bySearch')
|
||||
{
|
||||
$allStories = $this->story->getBySearch($release->product, $release->branch, $queryID, 'id', $executionIdList, 'story', $release->stories, 'draft,reviewing,changing', $pager);
|
||||
$allStories = $this->story->getBySearch($release->product, $release->branch, $queryID, 'id', $executionIdList, 'story', $excludeStoryIdList, 'draft,reviewing,changing', $pager);
|
||||
}
|
||||
else
|
||||
{
|
||||
$allStories = $this->story->batchGetExecutionStories(implode(',', $executionIdList), $release->product, 't1.`order`_desc', 'byBranch', $release->branch, 'story', $release->stories, $pager);
|
||||
$allStories = $this->story->batchGetExecutionStories(implode(',', $executionIdList), $release->product, 't1.`order`_desc', 'byBranch', $release->branch, 'story', $excludeStoryIdList, $pager);
|
||||
}
|
||||
|
||||
$this->view->allStories = $allStories;
|
||||
|
||||
@@ -155,6 +155,32 @@ class releaseZen extends release
|
||||
return $releaseQuery;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取发布不可关联的需求ID列表。
|
||||
* Get the story id list that can not be linked to the release.
|
||||
*
|
||||
* @param object $release
|
||||
* @access protected
|
||||
* @return array
|
||||
*/
|
||||
public function getExcludeStoryIdList(object $release): array
|
||||
{
|
||||
$parentIdList = $this->dao->select('id')->from(TABLE_STORY)
|
||||
->where('product')->eq($release->product)
|
||||
->andWhere('type')->eq('story')
|
||||
->andWhere('isParent')->eq('1')
|
||||
->andWhere('status')->notIN('draft,reviewing,changing')
|
||||
->fetchPairs();
|
||||
|
||||
foreach(explode(',', $release->stories) as $storyID)
|
||||
{
|
||||
if(!$storyID) continue;
|
||||
if(!isset($parentIdList[$storyID])) $parentIdList[$storyID] = $storyID;
|
||||
}
|
||||
|
||||
return $parentIdList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成的发布详情页面的需求数据。
|
||||
* Generate the story data for the release view page.
|
||||
|
||||
Reference in New Issue
Block a user