diff --git a/db/update17.8.sql b/db/update17.8.sql index ad4553a677..a5668b246c 100644 --- a/db/update17.8.sql +++ b/db/update17.8.sql @@ -102,8 +102,8 @@ CREATE TABLE `zt_image` ( CREATE TABLE `zt_automation` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `node` int(11) unsigned NOT NULL DEFAULT 0, - `product` int(11) unsigned NOT NULL DEFAULT 0, - `path` varchar(255) NOT NULL DEFAULT '', + `product` int(11) unsigned NOT NULL DEFAULT 0, + `scriptPath` varchar(255) NOT NULL DEFAULT '', `shell` mediumtext NOT NULL, `createdBy` varchar(30) NOT NULL, `createdDate` datetime NOT NULL, diff --git a/db/zentao.sql b/db/zentao.sql index aec9eba3ea..6e075fe9d0 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -7321,7 +7321,7 @@ CREATE TABLE `zt_automation` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `node` int(11) unsigned NOT NULL DEFAULT 0, `product` int(11) unsigned NOT NULL DEFAULT 0, - `path` varchar(255) NOT NULL DEFAULT '', + `scriptPath` varchar(255) NOT NULL DEFAULT '', `shell` mediumtext NOT NULL, `createdBy` varchar(30) NOT NULL, `createdDate` datetime NOT NULL, diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index ac4b0996d2..d4f6c8db68 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -1074,6 +1074,7 @@ $lang->resource->testcase->confirmLibcaseChange = 'confirmLibcaseChange'; $lang->resource->testcase->ignoreLibcaseChange = 'ignoreLibcaseChange'; $lang->resource->testcase->batchConfirmStoryChange = 'batchConfirmStoryChange'; $lang->resource->testcase->importToLib = 'importToLib'; +$lang->resource->testcase->automation = 'automation'; $lang->testcase->methodOrder[0] = 'index'; $lang->testcase->methodOrder[5] = 'browse'; @@ -1104,6 +1105,7 @@ $lang->testcase->methodOrder[125] = 'confirmLibcaseChange'; $lang->testcase->methodOrder[130] = 'ignoreLibcaseChange'; $lang->testcase->methodOrder[135] = 'batchConfirmStoryChange'; $lang->testcase->methodOrder[140] = 'importToLib'; +$lang->testcase->methodOrder[145] = 'automation'; /* Test task. */ $lang->resource->testtask = new stdclass(); diff --git a/module/testcase/control.php b/module/testcase/control.php index 3dbec9c773..6f374f38ba 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -89,6 +89,7 @@ class testcase extends control public function browse($productID = 0, $branch = '', $browseType = 'all', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1, $projectID = 0) { $this->loadModel('datatable'); + $this->app->loadLang('zanode'); /* Set browse type. */ $browseType = strtolower($browseType); @@ -2349,6 +2350,38 @@ class testcase extends control $this->display(); } + /** + * Automation test setting. + * + * @param int $productID + * @access public + * @return void + */ + public function automation($productID) + { + $this->loadModel('zanode'); + $nodeList = $this->zanode->getPairs(); + $automation = $this->dao->select('*')->from(TABLE_AUTOMATION)->where('product')->eq($productID)->fetch(); + + if($_POST) + { + $this->zanode->setAutomationSetting(); + + if(dao::isError()) return print(js::error(dao::getError())); + + $nodeID = $_POST['node']; + $node = $this->zanode->getNodeByID($_POST['node']); + + return print(js::closeModal('parent.parent', 'this', "function(){parent.parent.location.reload();}")); + } + + $this->view->title = $this->lang->zanode->automation; + $this->view->automation = $automation; + $this->view->nodeList = $nodeList; + $this->view->productID = $productID; + $this->display(); + } + /** * Export case getModuleByStory * diff --git a/module/testcase/view/automation.html.php b/module/testcase/view/automation.html.php new file mode 100644 index 0000000000..a580d284b2 --- /dev/null +++ b/module/testcase/view/automation.html.php @@ -0,0 +1,46 @@ + + * @package task + * @version $Id: cancel.html.php 935 2010-07-06 07:49:24Z jajacn@126.com $ + * @link http://www.zentao.net + */ +?> + +