diff --git a/module/execution/model.php b/module/execution/model.php index 630af57e6e..603907f466 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -2320,6 +2320,15 @@ class executionModel extends model } /* Build search form. */ + $gradePairs = array(); + $gradeList = $this->loadModel('story')->getGradeList(''); + foreach($gradeList as $grade) + { + $key = (string)$grade->type . (string)$grade->grade; + $gradePairs[$key] = $grade->name; + } + asort($gradePairs); + if($type == 'executionStory') $this->config->product->search['module'] = 'executionStory'; $this->config->product->search['actionURL'] = $actionURL; $this->config->product->search['queryID'] = $queryID; @@ -2328,6 +2337,7 @@ class executionModel extends model $this->config->product->search['params']['product']['values'] = $productPairs + array('all' => $this->lang->product->allProductsOfProject); $this->config->product->search['params']['plan']['values'] = $planPairs; $this->config->product->search['params']['module']['values'] = $modules; + $this->config->product->search['params']['grade']['values'] = $gradePairs; $this->config->product->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $this->lang->story->statusList); $this->config->product->search['params']['stage']['values'] = array('' => '') + $this->lang->story->stageList; if($productType == 'normal') diff --git a/module/product/model.php b/module/product/model.php index 0bd07f1a57..e81a9e1eeb 100755 --- a/module/product/model.php +++ b/module/product/model.php @@ -720,7 +720,7 @@ class productModel extends model $gradePairs = $this->loadModel('story')->getGradePairs($storyType, 'all'); - if($storyType == 'all') + if($projectID) { $gradePairs = array(); $gradeList = $this->loadModel('story')->getGradeList(''); diff --git a/module/story/tao.php b/module/story/tao.php index cef620b6a0..fe5c126f12 100644 --- a/module/story/tao.php +++ b/module/story/tao.php @@ -454,6 +454,7 @@ class storyTao extends storyModel $storyQuery = $this->replaceAllProductQuery($this->session->executionStoryQuery); $storyQuery = $this->replaceRevertQuery($storyQuery, $productID); $storyQuery = preg_replace('/`(\w+)`/', 't2.`$1`', $storyQuery); + $storyQuery = preg_replace_callback("/t2.`grade` (=|!=) '(\w+)(\d+)'/", function($matches){return "t2.`grade` {$matches[1]} '" . $matches[3] . "' AND t2.`type` = '" . $matches[2] . "'";}, $storyQuery); if(strpos($storyQuery, 'result') !== false) $storyQuery = str_replace('t2.`result`', 't4.`result`', $storyQuery); return $this->dao->select("distinct t1.*, t2.*, IF(t2.`pri` = 0, {$this->config->maxPriValue}, t2.`pri`) as priOrder, t3.type as productType, t2.version as version")->from(TABLE_PROJECTSTORY)->alias('t1')