From e6797bdddef3b2edbf3d6547295c01a021fb9ebe Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 25 Jul 2014 02:44:47 +0000 Subject: [PATCH] * finish task #1945. --- module/testcase/view/caseheader.html.php | 6 ++++-- module/tree/model.php | 11 +++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/module/testcase/view/caseheader.html.php b/module/testcase/view/caseheader.html.php index ce644b851a..f9ced8b071 100644 --- a/module/testcase/view/caseheader.html.php +++ b/module/testcase/view/caseheader.html.php @@ -44,8 +44,10 @@ diff --git a/module/tree/model.php b/module/tree/model.php index 64c154a8c2..bc6e1c340b 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -246,8 +246,19 @@ class treeModel extends model { $treeMenu = array(); $stmt = $this->dbh->query($this->buildMenuQuery($rootID, $type, $startModule)); + + /* Add for task #1945. check the module has case or no. */ + if($type == 'case' and !empty($extra)) $this->loadModel('testtask'); while($module = $stmt->fetch()) { + /* Add for task #1945. check the module has case or no. */ + if($type == 'case' and !empty($extra)) + { + $modules = $this->getAllChildID($module->id); + $runs = $this->testtask->getRuns($extra, $modules, 'id'); + if(empty($runs)) continue; + } + $linkHtml = call_user_func($userFunc, $type, $module, $extra); if(isset($treeMenu[$module->id]) and !empty($treeMenu[$module->id]))