From 769c65781ba39cba02a24cb339d52c42a73b2d32 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Fri, 16 Dec 2022 19:16:56 +0800 Subject: [PATCH] * Fix bug #30971. --- module/common/view/successmodal.html.php | 5 ++-- module/testcase/control.php | 4 ++- module/testcase/view/automation.html.php | 36 +++++++++++++++++++++++- module/zanode/control.php | 20 +++++++++++-- 4 files changed, 58 insertions(+), 7 deletions(-) diff --git a/module/common/view/successmodal.html.php b/module/common/view/successmodal.html.php index 418d2e92df..4933fc4dfa 100644 --- a/module/common/view/successmodal.html.php +++ b/module/common/view/successmodal.html.php @@ -16,8 +16,9 @@ diff --git a/module/testcase/control.php b/module/testcase/control.php index 53809895dc..230db9a162 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -2375,7 +2375,7 @@ class testcase extends control * @access public * @return void */ - public function automation($productID) + public function automation($productID = 0) { $this->loadModel('zanode'); $nodeList = $this->zanode->getPairs(); @@ -2397,6 +2397,8 @@ class testcase extends control $this->view->automation = $automation; $this->view->nodeList = $nodeList; $this->view->productID = $productID; + $this->view->products = $this->product->getPairs('', 0, '', 'all'); + $this->display(); } diff --git a/module/testcase/view/automation.html.php b/module/testcase/view/automation.html.php index a580d284b2..0f625b2781 100644 --- a/module/testcase/view/automation.html.php +++ b/module/testcase/view/automation.html.php @@ -20,6 +20,12 @@
+ + + + + + @@ -34,7 +40,7 @@ @@ -43,4 +49,32 @@ + diff --git a/module/zanode/control.php b/module/zanode/control.php index dbba606977..0777a637b0 100644 --- a/module/zanode/control.php +++ b/module/zanode/control.php @@ -142,8 +142,8 @@ class zanode extends control $this->view->node = $this->zanode->getNodeById($nodeID); $this->view->notice = $this->lang->zanode->init->initSuccessNoticeTitle; $this->view->buttonName = $this->lang->zanode->init->button; - $productID = $this->session->product ? $this->session->product : 0; - $this->view->modalLink = $this->createLink('testcase', 'browse', "productID={$productID}"); + $this->view->modalLink = $this->createLink('testcase', 'automation', 0, '', true); + $this->view->modalClass = 'iframe'; $this->view->closeLink = $this->createLink('zanode', 'browse'); $this->display(); @@ -381,7 +381,21 @@ class zanode extends control } /** - * ajaxRunZTFScript + * Ajax: get ZTF script. + * + * @access public + * @return void + */ + public function ajaxGetZTFScript($type = 'product', $objectID = 0) + { + $script = array(); + if($type == '') $script = $this->zanode->getAutomationByID($objectID); + if($type == 'product') $script = $this->zanode->getAutomationByProduct($objectID); + return $this->send(array('result' => 'success', 'data' => $script)); + } + + /** + * Ajax: run ZTF script. * * @param int $scriptID * @access public
testcase->product;?>
zanode->common;?> node) ? $automation->node : '', "class='form-control picker-select'");?>
- + id);?>