From cb8d7502b7314c49867a50cd92f487839f8fb1b1 Mon Sep 17 00:00:00 2001 From: z Date: Wed, 17 Jun 2020 13:03:15 +0800 Subject: [PATCH] * finish task #7263. --- module/bug/control.php | 5 +++++ module/bug/js/common.js | 5 +++-- module/bug/view/create.html.php | 2 +- module/bug/view/view.html.php | 2 +- module/testcase/view/view.html.php | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 451d9fc624..2362b3ae81 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -350,6 +350,11 @@ class bug extends control if($runID and $resultID) extract($this->bug->getBugInfoFromResult($resultID, 0, 0, isset($stepIdList) ? $stepIdList : ''));// If set runID and resultID, get the result info by resultID as template. if(!$runID and $caseID) extract($this->bug->getBugInfoFromResult($resultID, $caseID, $version, isset($stepIdList) ? $stepIdList : ''));// If not set runID but set caseID, get the result info by resultID and case info. + if($testtask) + { + $testtask = $this->loadModel('testtask')->getById($testtask); + $buildID = $testtask->build; + } /* If bugID setted, use this bug as template. */ if(isset($bugID)) diff --git a/module/bug/js/common.js b/module/bug/js/common.js index 1a43ecf12d..09b9ecd9bd 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -378,6 +378,7 @@ function loadProjectBuilds(projectID) { if(!data) data = ''; $('#openedBuild').replaceWith(data); + $('#openedBuild').val(oldOpenedBuild); $('#openedBuild_chosen').remove(); $("#openedBuild").chosen(); notice(); @@ -386,11 +387,11 @@ function loadProjectBuilds(projectID) else { link = createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild + '&branch=' + branch); - $('#openedBuildBox').load(link, function(){$(this).find('select').chosen()}); + $('#openedBuildBox').load(link, function(){$(this).find('select').val(oldOpenedBuild).chosen()}); oldResolvedBuild = $('#resolvedBuild').val() ? $('#resolvedBuild').val() : 0; link = createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild + '&branch=' + branch); - $('#resolvedBuildBox').load(link, function(){$(this).find('select').chosen()}); + $('#resolvedBuildBox').load(link, function(){$(this).find('select').val(oldResolvedBuild).chosen()}); } } diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index a05c352b07..e1ee23291a 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -290,7 +290,7 @@ js::set('flow', $config->global->flow); - + id : 0);?> diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php index 4cc4131aca..eedf4d9871 100644 --- a/module/bug/view/view.html.php +++ b/module/bug/view/view.html.php @@ -340,7 +340,7 @@ case):?> bug->fromCase;?> - createLink('testcase', 'view', "caseID=$bug->case", '', true), "#$bug->case $bug->caseTitle", '', "class='iframe' data-width='80%'");?> + createLink('testcase', 'view', "caseID=$bug->case&caseVersion=" . ($bug->testtask ? "&from=testtask&taskID={$bug->testtask}" : ''), '', true), "#$bug->case $bug->caseTitle", '', "class='iframe' data-width='80%'");?> toCases):?> diff --git a/module/testcase/view/view.html.php b/module/testcase/view/view.html.php index 96e5deaf08..bbea9e66c2 100644 --- a/module/testcase/view/view.html.php +++ b/module/testcase/view/view.html.php @@ -97,7 +97,7 @@ - xml)):?> + xml)):?>
testcase->xml;?>
xml));?>