* Filter parent stories when create or edit a testcase.

This commit is contained in:
songchenxuan
2023-05-24 17:31:29 +08:00
parent cf63525071
commit fcae546aa8
3 changed files with 4 additions and 3 deletions
+1
View File
@@ -2663,6 +2663,7 @@ class story extends control
*/
public function ajaxGetProductStories($productID, $branch = 0, $moduleID = 0, $storyID = 0, $onlyOption = 'false', $status = '', $limit = 0, $type = 'full', $hasParent = 1, $objectID = 0, $number = '')
{
$hasParent = (bool)$hasParent;
if($moduleID)
{
$moduleID = $this->loadModel('tree')->getStoryModule($moduleID);
+2 -2
View File
@@ -608,7 +608,7 @@ class testcase extends control
/* Logic of task 44139. */
if(!in_array($this->app->tab, array('execution', 'project')) and empty($stories))
{
$stories = $this->story->getProductStoryPairs($productID, $branch, 0, $storyStatus, 'id_desc', 0, 'full', 'story', 1);
$stories = $this->story->getProductStoryPairs($productID, $branch, 0, $storyStatus, 'id_desc', 0, 'full', 'story', false);
}
if($storyID and !isset($stories[$storyID])) $stories = $this->story->formatStories(array($storyID => $story)) + $stories;//Fix bug #2406.
@@ -1072,7 +1072,7 @@ class testcase extends control
/* Logic of task 44139. */
if(!in_array($this->app->tab, array('execution', 'project')) and empty($stories))
{
$stories = $this->story->getProductStoryPairs($case->product, $case->branch, 0, $storyStatus, 'id_desc', 0, 'full', 'story', 1);
$stories = $this->story->getProductStoryPairs($case->product, $case->branch, 0, $storyStatus, 'id_desc', 0, 'full', 'story', false);
}
$this->view->productID = $productID;
+1 -1
View File
@@ -132,7 +132,7 @@ function setStories()
productID = $('#product').val();
branch = $('#branch').val();
if(typeof(branch) == 'undefined') branch = 0;
link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branch + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=0&type=full&hasParent=1&objectID=' + objectID);
link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branch + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=0&type=full&hasParent=0&objectID=' + objectID);
$.get(link, function(stories)
{