diff --git a/module/story/control.php b/module/story/control.php index 221a174dbd..bb873f337b 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -1502,8 +1502,7 @@ class story extends control return $this->send($storyList); } - $items = array(); - foreach($stories as $storyID => $storyName) $items[] = array('text' => $storyName, 'value' => $storyID, 'keys' => $storyName); + $items = $this->story->addGradeLabel($stories); return print(json_encode($items)); } diff --git a/module/testcase/control.php b/module/testcase/control.php index dcf1e2d2e7..5030e5863e 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -564,9 +564,12 @@ class testcase extends control $showSuhosinInfo = common::judgeSuhosinSetting($countInputVars); if($showSuhosinInfo) $this->view->suhosinInfo = extension_loaded('suhosin') ? sprintf($this->lang->suhosinInfo, $countInputVars) : sprintf($this->lang->maxVarsInfo, $countInputVars); + $stories = $this->loadModel('story')->getProductStoryPairs($productID, $branch); + $stories = $this->story->addGradeLabel($stories); + /* 展示变量. */ /* Show the variables. */ - $this->view->stories = $this->loadModel('story')->getProductStoryPairs($productID, $branch); + $this->view->stories = $stories; $this->view->caseIdList = $caseIdList; $this->view->productID = $productID; $this->view->cases = $cases; diff --git a/module/testcase/zen.php b/module/testcase/zen.php index 5297101cdf..29d1b36e0e 100755 --- a/module/testcase/zen.php +++ b/module/testcase/zen.php @@ -402,10 +402,12 @@ class testcaseZen extends testcase if($this->app->tab != 'qa' && $this->app->tab != 'product' && $this->app->tab != 'my') { $projectID = $this->app->tab == 'project' ? $this->session->project : $this->session->execution; - if($projectID) $stories = $this->story->getExecutionStoryPairs($projectID, $productID, $branch, $modules); + if($projectID) $stories = $this->story->getExecutionStoryPairs($projectID, $productID, $branch, $modules, 'full', 'all', 'story', false); } if($storyID && !isset($stories[$storyID])) $stories = $this->story->formatStories(array($storyID => $story)) + $stories; + $stories = $this->story->addGradeLabel($stories); + $this->view->stories = $stories; $this->view->currentModuleID = $currentModuleID; $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, 'case', 0, $branch === 'all' || !isset($branches[$branch]) ? '0' : $branch); @@ -872,7 +874,7 @@ class testcaseZen extends testcase $storyStatus = $this->loadModel('story')->getStatusList('noclosed'); if($this->app->tab == 'execution') { - $stories = $this->loadModel('story')->getExecutionStoryPairs($case->execution, $case->product, $case->branch, $moduleIdList); + $stories = $this->loadModel('story')->getExecutionStoryPairs($case->execution, $case->product, $case->branch, $moduleIdList, 'full', 'all', 'story', false); } else { @@ -881,6 +883,8 @@ class testcaseZen extends testcase if(!in_array($this->app->tab, array('execution', 'project')) && empty($stories)) $stories = $this->story->getProductStoryPairs($case->product, $case->branch, 0, $storyStatus, 'id_desc', 0, 'full', 'story', false); + $stories = $this->story->addGradeLabel($stories); + $this->view->stories = $stories; } @@ -1314,6 +1318,8 @@ class testcaseZen extends testcase $storyPairs += $storyID ? array($storyID => $story->id . ':' . $story->title) : array(); if($storyID && empty($moduleID)) $moduleID = $story->module; + $storyPairs = $this->story->addGradeLabel($storyPairs); + $this->view->product = $product; $this->view->branches = $branches; $this->view->customFields = $customFields;