From 02e2d720d7a26e021b882d7fad1474fa191d10e4 Mon Sep 17 00:00:00 2001 From: daitingting Date: Thu, 27 Apr 2017 09:37:23 +0800 Subject: [PATCH] * Fix edit testcase which type is lib. --- module/testcase/js/common.js | 19 +++++++++++++++++++ module/testcase/view/edit.html.php | 20 +++++++++++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/module/testcase/js/common.js b/module/testcase/js/common.js index 4781b66d24..38cec1f3af 100644 --- a/module/testcase/js/common.js +++ b/module/testcase/js/common.js @@ -78,6 +78,25 @@ function loadProductModules(productID, branch) setStories(); } +/** + * Load module. + * + * @param int $libID + * @access public + * @return void + */ +function loadLibModules(libID, branch) +{ + if(typeof(branch) == 'undefined') branch = 0; + if(!branch) branch = 0; + link = createLink('tree', 'ajaxGetOptionMenu', 'rootID=' + libID + '&viewtype=caselib&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=&needManage=true'); + $('#moduleIdBox').load(link, function() + { + $(this).find('select').chosen(defaultChosenOptions) + if(typeof(caseModule) == 'string') $('#moduleIdBox').prepend("" + caseModule + "") + }); +} + /** * Set story field. * diff --git a/module/testcase/view/edit.html.php b/module/testcase/view/edit.html.php index 0d476a5ae9..f51f03b73e 100644 --- a/module/testcase/view/edit.html.php +++ b/module/testcase/view/edit.html.php @@ -145,6 +145,24 @@ + + testcase->module;?> + +
+ "; + echo html::a($this->createLink('tree', 'browse', "rootID=$libID&view=caselib¤tModuleID=0&branch=$case->branch"), $lang->tree->manage, '_blank'); + echo '  '; + echo html::a("javascript:loadLibModules($libID)", $lang->refresh); + echo ''; + } + ?> +
+ + testcase->product;?> @@ -155,7 +173,6 @@ - testcase->module;?> @@ -174,6 +191,7 @@ + testcase->story;?>