From 52aab1864337adf5eba3b202cae3e89cd13affcd Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Mon, 29 Mar 2021 10:57:12 +0800 Subject: [PATCH] * Fix bug #11504. --- module/build/control.php | 5 +++++ module/testtask/control.php | 5 ++++- module/testtask/js/create.js | 26 +++++++++++++++++++++++++- module/testtask/view/create.html.php | 2 +- 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index bd64606a2e..e1ed16505b 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -56,6 +56,11 @@ class build extends control $this->execution->setMenu($executionID); $this->session->set('project', $execution->project); } + elseif($this->app->openApp == 'qa') + { + $execution = $this->execution->getByID($executionID); + $executions = $this->execution->getPairs($execution->project); + } $productGroups = $this->execution->getProducts($executionID); $productID = $productID ? $productID : key($productGroups); diff --git a/module/testtask/control.php b/module/testtask/control.php index 268ba933e6..8eb5a60ec9 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -211,6 +211,10 @@ class testtask extends control { $this->loadModel('execution')->setMenu($executionID); } + elseif($this->app->openApp == 'qa') + { + $this->loadModel('qa')->setMenu($this->products, $productID); + } /* Create testtask from testtask of test.*/ $productID = $productID ? $productID : key($this->products); @@ -219,7 +223,6 @@ class testtask extends control /* Set menu. */ $productID = $this->product->saveState($productID, $this->products); - $this->loadModel('qa')->setMenu($this->products, $productID); $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->create; $this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]); diff --git a/module/testtask/js/create.js b/module/testtask/js/create.js index f3b17a474d..ac64d00a46 100755 --- a/module/testtask/js/create.js +++ b/module/testtask/js/create.js @@ -6,7 +6,31 @@ */ function loadProductRelated() { - loadExecutionBuilds(parseInt($('#execution').val())); + loadExecutions($('#product').val()); + data = ''; + $('#build').replaceWith(data); + $('#build_chosen').remove(); + $("#build").chosen(); + $('#build').trigger("chosen:updated"); +} + +/** + * Load executions. + * + * @param int productID + * @access public + * @return void + */ +function loadExecutions(productID) +{ + link = createLink('product', 'ajaxGetExecutions', 'productID=' + productID + '&projectID=' + projectID); + $.get(link, function(data) + { + if(!data) data = ''; + $('#execution').replaceWith(data); + $('#execution_chosen').remove(); + $("#execution").chosen(); + }); } /* If the mouse hover over the manage contacts button, give tip. */ diff --git a/module/testtask/view/create.html.php b/module/testtask/view/create.html.php index 31e8a28d1c..fd35e0498b 100644 --- a/module/testtask/view/create.html.php +++ b/module/testtask/view/create.html.php @@ -14,7 +14,7 @@ -session->project);?> +