* Modify get stories by moduleID when create or edit a testcase in project/execution/qa.

This commit is contained in:
songchenxuan
2023-05-24 15:00:36 +08:00
parent 824613e890
commit 92fe49f313
5 changed files with 10 additions and 10 deletions
+4 -4
View File
@@ -2656,12 +2656,12 @@ class story extends control
* @param int $limit
* @param string $type
* @param bool $hasParent
* @param int $executionID
* @param int $objectID projectID || executionID
* @param int $number
* @access public
* @return void
*/
public function ajaxGetProductStories($productID, $branch = 0, $moduleID = 0, $storyID = 0, $onlyOption = 'false', $status = '', $limit = 0, $type = 'full', $hasParent = 1, $executionID = 0, $number = '')
public function ajaxGetProductStories($productID, $branch = 0, $moduleID = 0, $storyID = 0, $onlyOption = 'false', $status = '', $limit = 0, $type = 'full', $hasParent = 1, $objectID = 0, $number = '')
{
if($moduleID)
{
@@ -2671,9 +2671,9 @@ class story extends control
$storyStatus = $this->story->getStatusList($status);
if($executionID)
if($objectID)
{
$stories = $this->story->getExecutionStoryPairs($executionID, $productID, $branch, $moduleID, $type);
$stories = $this->story->getExecutionStoryPairs($objectID, $productID, $branch, $moduleID, $type);
}
else
{
+2 -2
View File
@@ -101,7 +101,7 @@ $(function()
var moduleID = $('#modules' + num).val();
var branchID = typeof($('#branches' + num).val()) == 'undefined' ? 0 : $('#branches' + num).val();
var storyID = $("#story" + num).val();
var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=' + storyID +'&onlyOption=false&status=noclosed&limit=0&type=full&hasParent=1&executionID=0&number=' + num);
var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=' + storyID +'&onlyOption=false&status=noclosed&limit=0&type=full&hasParent=1&objectID=0&number=' + num);
$.get(storyLink, function(stories)
{
if(!stories) stories = '<select id="story' + num + '" name="story[' + num + ']" class="form-control"></select>';
@@ -164,7 +164,7 @@ function loadStories2(productID, moduleID, num)
{
var branchIDName = (config.currentMethod == 'batchcreate' || config.currentMethod == 'showimport') ? '#branch' : '#branches';
var branchID = $(branchIDName + num).val();
var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=50&type=full&hasParent=1&executionID=0&number=' + num);
var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=50&type=full&hasParent=1&objectID=0&number=' + num);
$.get(storyLink, function(stories)
{
if(!stories) stories = '<select id="story' + num + '" name="story[' + num + ']" class="form-control"></select>';
+2 -2
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&executionID=' + executionID);
link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branch + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=0&type=full&hasParent=1&objectID=' + objectID);
$.get(link, function(stories)
{
@@ -365,7 +365,7 @@ function loadStories(productID, moduleID, num)
{
var branchIDName = (config.currentMethod == 'batchcreate' || config.currentMethod == 'showimport') ? '#branch' : '#branches';
var branchID = $(branchIDName + num).val();
var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=0&type=full&hasParent=1&executionID=0&number=' + num);
var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=0&type=full&hasParent=1&objectID=0&number=' + num);
$.get(storyLink, function(stories)
{
if(!stories) stories = '<select id="story' + num + '" name="story[' + num + ']" class="form-control"></select>';
+1 -1
View File
@@ -17,10 +17,10 @@
<?php js::set('lblBefore', $lang->testcase->insertBefore);?>
<?php js::set('lblAfter', $lang->testcase->insertAfter);?>
<?php js::set('isonlybody', isonlybody());?>
<?php js::set('executionID', $executionID);?>
<?php js::set('tab', $this->app->tab);?>
<?php if($this->app->tab == 'execution') js::set('objectID', $executionID);?>
<?php if($this->app->tab == 'project') js::set('objectID', $projectID);?>
<?php if($this->app->tab == 'qa') js::set('objectID', 0);?>
<?php
foreach(explode(',', $config->testcase->create->requiredFields) as $field)
{
+1 -1
View File
@@ -17,7 +17,6 @@
<?php js::set('lblBefore', $lang->testcase->insertBefore);?>
<?php js::set('lblAfter', $lang->testcase->insertAfter);?>
<?php js::set('caseID', $case->id);?>
<?php js::set('executionID', $case->execution);?>
<?php js::set('tab', $this->app->tab);?>
<?php js::set('isLibCase', $isLibCase);?>
<?php js::set('testtasks', $testtasks);?>
@@ -25,6 +24,7 @@
<?php js::set('confirmUnlinkTesttask', $lang->testcase->confirmUnlinkTesttask);?>
<?php if($this->app->tab == 'execution') js::set('objectID', $case->execution);?>
<?php if($this->app->tab == 'project') js::set('objectID', $case->project);?>
<?php if($this->app->tab == 'qa') js::set('objectID', 0);?>
<div id='mainContent' class='main-content'>
<div class='main-header'>
<h2>