* Fix the bug of the story filter.

This commit is contained in:
hufangzhou
2021-01-18 13:25:58 +08:00
parent 92a559c37d
commit dd341daed7
3 changed files with 9 additions and 5 deletions
+3 -2
View File
@@ -98,6 +98,7 @@ class product extends control
* Browse a product.
*
* @param int $productID
* @param int $branch
* @param string $browseType
* @param int $param
* @param string $storyType requirement|story
@@ -108,7 +109,7 @@ class product extends control
* @access public
* @return void
*/
public function browse($productID = 0, $branch = '', $browseType = '', $param = 0, $storyType = 'story', $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1)
public function browse($productID = 0, $branch = 0, $browseType = '', $param = 0, $storyType = 'story', $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
/* Lower browse type. */
$browseType = strtolower($browseType);
@@ -201,7 +202,7 @@ class product extends control
}
if($projectStoryBrowseType == 'bybranch') $param = $branch;
$stories = $this->story->getProjectStories($this->session->PRJ, $sort, $projectStoryBrowseType, $param, 'story', '', $pager, $productID);
$stories = $this->story->getProjectStories($this->session->PRJ, $sort, $projectStoryBrowseType, $param, 'story', '', $pager, $productID, $branch);
}
/* Process the sql, get the conditon partion, save it to session. */
+3 -2
View File
@@ -24,7 +24,7 @@ class projectStory extends control
{
parent::__construct($moduleName, $methodName);
$this->products = $this->loadModel('product')->getProductPairsByProject($this->session->PRJ);
if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "fromModule=projectStory")));
if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "fromModule=projectstory")));
}
/**
@@ -63,6 +63,7 @@ class projectStory extends control
* Get software requirements from product.
*
* @param int $productID
* @param int $branch
* @param string $browseType
* @param int $param
* @param string $storyType
@@ -73,7 +74,7 @@ class projectStory extends control
* @access public
* @return void
*/
public function story($productID = 0, $branch = '', $browseType = '', $param = 0, $storyType = 'story', $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1)
public function story($productID = 0, $branch = 0, $browseType = '', $param = 0, $storyType = 'story', $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$this->session->set('storyList',$this->app->getURI(true));
if(empty($productID)) $productID = key($this->products);
+3 -1
View File
@@ -2299,10 +2299,11 @@ class storyModel extends model
* @param string $excludeStories
* @param object $pager
* @param int $productID
* @param int $branch
* @access public
* @return array
*/
public function getProjectStories($projectID = 0, $orderBy = 't1.`order`_desc', $type = 'byModule', $param = 0, $storyType = 'story', $excludeStories = '', $pager = null, $productID = 0)
public function getProjectStories($projectID = 0, $orderBy = 't1.`order`_desc', $type = 'byModule', $param = 0, $storyType = 'story', $excludeStories = '', $pager = null, $productID = 0, $branch = 0)
{
if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getProjectStories();
@@ -2371,6 +2372,7 @@ class storyModel extends model
->beginIF($excludeStories)->andWhere('t2.id')->notIN($excludeStories)->fi()
->beginIF($project->type == 'project')
->andWhere('t1.product')->eq($productID)
->beginIF(!empty($branch))->andWhere('t2.branch')->eq($branch)->fi()
->beginIF(isset($statusFeatureList) and in_array($type, array_keys($statusFeatureList)))->andWhere('t2.status')->eq($type)->fi()
->beginIF(isset($otherFeatureList) and in_array($type, array_keys($otherFeatureList)))->andWhere('t2.' . substr($type, 0, -2))->eq($this->app->user->account)->fi()
->beginIF($type == 'unclosed')->andWhere('t2.status')->in(array_keys($unclosedStatus))->fi()