diff --git a/module/bug/control.php b/module/bug/control.php index d683410dd2..5e890651aa 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -54,12 +54,8 @@ class bug extends control $projectID = $this->session->project; $products = $this->loadModel('project')->getProducts($projectID, false); } - if($this->app->openApp == 'qa') - { - $products = $this->product->getPairs(); - $this->app->loadConfig('qa'); - foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa'; - } + if($this->app->openApp == 'execution') $products = $this->loadModel('execution')->getProducts($this->session->execution, false); + if($this->app->openApp == 'qa' or $this->app->openApp == 'my') $products = $this->product->getPairs(); $this->view->products = $this->products = $products; if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName={$this->app->openApp}&activeMenu=bug&projectID=$projectID"))); } diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index c70b6154c7..5fc82351e9 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -306,8 +306,8 @@ $lang->execution->menu->qa['subMenu'] = new stdclass(); $lang->execution->menu->qa['subMenu']->qa = array('link' => "$lang->dashboard|execution|qa|executionID=%s"); $lang->execution->menu->qa['subMenu']->bug = array('link' => "{$lang->bug->common}|execution|bug|executionID=%s", 'subModule' => 'bug'); $lang->execution->menu->qa['subMenu']->testcase = array('link' => "{$lang->testcase->shortCommon}|execution|testcase|executionID=%s", 'alias' => 'create'); -$lang->execution->menu->qa['subMenu']->testtask = array('link' => "{$lang->testtask->common}|execution|testtask|executionID=%s", 'subModule' => 'testtask,testreport'); -// $lang->execution->menu->qa['subMenu']->testreport = array('link' => "$lang->project->report|testreport|browse|exeutionID=%s&type=execution"); +$lang->execution->menu->qa['subMenu']->testtask = array('link' => "{$lang->testtask->common}|execution|testtask|executionID=%s", 'subModule' => 'testtask'); +$lang->execution->menu->qa['subMenu']->testreport = array('link' => "{$lang->testreport->common}|execution|testreport|browse|exeutionID=%s", 'subModule' => 'testreport'); $lang->execution->menu->qa['menuOrder'][5] = 'qa'; $lang->execution->menu->qa['menuOrder'][10] = 'bug'; diff --git a/module/execution/control.php b/module/execution/control.php index 7034a22a68..f1c3950259 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -851,13 +851,13 @@ class execution extends control /* Save session. */ $this->session->set('bugList', $this->app->getURI(true), 'execution'); - $type = strtolower($type); - $queryID = ($type == 'bysearch') ? (int)$param : 0; + $type = strtolower($type); + $queryID = ($type == 'bysearch') ? (int)$param : 0; $execution = $this->commonAction($executionID); $executionID = $execution->id; - $products = $this->execution->getProducts($execution->id); - $productID = key($products); // Get the first product for creating bug. - $branchID = isset($products[$productID]) ? $products[$productID]->branch : 0; + $products = $this->execution->getProducts($execution->id); + $productID = key($products); // Get the first product for creating bug. + $branchID = isset($products[$productID]) ? $products[$productID]->branch : 0; /* Header and position. */ $title = $execution->name . $this->lang->colon . $this->lang->execution->bug; @@ -946,6 +946,23 @@ class execution extends control $this->display(); } + /** + * Execution case list. + * + * @param int $executionID + * @param string $type + * @param string $orderBy + * @param int $recTotal + * @param int $recPerPage + * @param int $pageID + * @access public + * @return void + */ + public function testreport($executionID = 0, $objectID = 0, $objectType = 'product', $extra = '', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) + { + + } + /** * Browse builds of a execution. * diff --git a/module/index/js/index.js b/module/index/js/index.js index 406cc8401d..09cc085a75 100644 --- a/module/index/js/index.js +++ b/module/index/js/index.js @@ -729,6 +729,8 @@ function changeSearchObject() if(searchType == 'deploystep') var searchType = 'deploy-viewstep'; $("#searchType").val(searchType); + $('#searchTypeMenu li:first').attr('class', 'search-type-all'); + return searchType; } diff --git a/module/product/control.php b/module/product/control.php index af1e786a06..968d4d16a5 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -969,17 +969,16 @@ class product extends control * * @param string $moduleName * @param string $activeMenu - * @param int $projectID + * @param int $objectID * @access public * @return void */ - public function showErrorNone($moduleName = 'qa', $activeMenu = 'index', $projectID = 0) + public function showErrorNone($moduleName = 'qa', $activeMenu = 'index', $objectID = 0) { - $this->app->rawModule = $activeMenu; if($moduleName == 'project') { - $this->loadModel('project')->setMenu($projectID); - $project = $this->project->getByID($projectID); + $this->loadModel('project')->setMenu($objectID); + $project = $this->project->getByID($objectID); $this->lang->project->menu = $this->lang->{$project->model}->menu; $this->lang->project->menuOrder = $this->lang->{$project->model}->menuOrder; $this->app->rawModule = $activeMenu; @@ -991,15 +990,22 @@ class product extends control elseif($moduleName == 'qa') { $this->loadModel('qa')->setMenu(array(), 0); + $this->app->rawModule = $activeMenu; if($activeMenu == 'testcase') $this->lang->qa->menu->testcase['subMenu']->case['subModule'] = 'product'; if($activeMenu == 'testsuite') $this->lang->qa->menu->testcase['subMenu']->testsuite['subModule'] = 'product'; if($activeMenu == 'testtask') $this->lang->qa->menu->testtask['subMenu']->testtask['subModule'] = 'product'; if($activeMenu == 'testreport') $this->lang->qa->menu->testtask['subMenu']->report['subModule'] = 'product'; } + elseif($moduleName == 'execution') + { + $this->loadModel('execution')->setMenu($objectID); + if($testreport == '') $this->app->rawModule = $activeMenu; + if($activeMenu == 'testreport') $this->lang->execution->menu->qa['subMenu']->testtask['subMenu']->testtask['subModule'] = 'product'; + } - $this->view->title = $this->lang->$moduleName->common; - $this->view->projectID = $projectID; + $this->view->title = $this->lang->$moduleName->common; + $this->view->objectID = $objectID; $this->display(); } diff --git a/module/product/view/showerrornone.html.php b/module/product/view/showerrornone.html.php index 6743ed3510..d304963287 100644 --- a/module/product/view/showerrornone.html.php +++ b/module/product/view/showerrornone.html.php @@ -13,7 +13,11 @@ app->openApp == 'project'):?>
-

product->noProduct;?> " . $lang->project->manageProducts, '', "class='btn btn-info' data-app='project'");?>

+

product->noProduct;?> " . $lang->project->manageProducts, '', "class='btn btn-info' data-app='project'");?>

+
+app->openApp == 'execution'):?> +
+

product->noProduct;?> " . $lang->execution->manageProducts, '', "class='btn btn-info' data-app='execution'");?>

diff --git a/module/testcase/control.php b/module/testcase/control.php index 47bdd63e52..245ae8c4d6 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -48,7 +48,8 @@ class testcase extends control $projectID = $this->session->project; $products = $this->loadModel('project')->getProducts($projectID, false); } - if($this->app->openApp == 'qa') $products = $this->product->getPairs(); + if($this->app->openApp == 'execution') $products = $this->loadModel('execution')->getProducts($this->session->execution, false); + if($this->app->openApp == 'qa' or $this->app->openApp == 'my') $products = $this->product->getPairs(); $this->view->products = $this->products = $products; if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName={$this->app->openApp}&activeMenu=testcase&projectID=$projectID"))); } diff --git a/module/testreport/control.php b/module/testreport/control.php index 3dd039624f..7fe7c1cdc9 100644 --- a/module/testreport/control.php +++ b/module/testreport/control.php @@ -44,18 +44,23 @@ class testreport extends control $this->loadModel('user'); $this->app->loadLang('report'); - /* Set testreport menu group. */ - $this->projectID = isset($_GET['PRJ']) ? $_GET['PRJ'] : 0; - if(!$this->projectID) + /* Get product data. */ + $objectID = 0; + if($this->app->openApp == 'project') { - $this->app->loadConfig('qa'); - foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa'; + $objectID = $this->session->project; + $products = $this->loadModel('project')->getProducts($objectID, false); } - else + + if($this->app->openApp == 'execution') { - $this->lang->testreport->menu = $this->lang->projectQa->menu; - $this->lang->testreport->subMenu = $this->lang->projectQa->subMenu; + $objectID = $this->session->execution; + $products = $this->loadModel('execution')->getProducts($objectID, false); } + + if($this->app->openApp == 'qa' or $this->app->openApp == 'my') $products = $this->loadModel('product')->getPairs(); + $this->view->products = $this->products = $products; + if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName={$this->app->openApp}&activeMenu=testreport&objectID=$objectID"))); } /** @@ -73,8 +78,8 @@ class testreport extends control */ public function browse($objectID = 0, $objectType = 'product', $extra = '', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { - if($objectType != 'product' and $objectType != 'execution') die('Type Error!'); - $this->session->set('reportList', $this->app->getURI(true), 'qa'); + if(strpos('product|execution|project', $objectType) === false) die('Type Error!'); + $this->session->set('reportList', $this->app->getURI(true), $this->app->openApp); $objectID = $this->commonAction($objectID, $objectType); $object = $this->$objectType->getById($objectID); @@ -547,21 +552,24 @@ class testreport extends control { if($objectType == 'product') { - $projectID = $this->lang->navGroup->testreport == 'qa' ? 0 : $this->session->project; - $this->products = $this->product->getProductPairsByProject($projectID); - if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=qa&activeMenu=testreport"))); - $productID = $this->product->saveState($objectID, $this->products); + $productID = $this->product->saveState($objectID, $this->products); $this->loadModel('qa')->setMenu($this->products, $productID); return $productID; } elseif($objectType == 'execution') { - $this->executions = $this->execution->getPairs($this->session->project, 'all', 'nocode'); - $executionID = $this->execution->saveState($objectID, $this->executions); - $this->execution->setMenu($this->executions, $executionID); - $this->lang->testreport->menu = $this->lang->execution->menu; + $executions = $this->execution->getPairs(); + $executionID = $this->execution->saveState($objectID, $executions); + $this->execution->setMenu($executionID); return $executionID; } + elseif($objectType == 'project') + { + $projects = $this->project->getPairsByProgram(); + $projectID = $this->project->saveState($objectID, $projects) + $this->project->setMenu($projectID); + return $projectID; + } } /** diff --git a/module/testtask/control.php b/module/testtask/control.php index b908549ca6..268ba933e6 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -44,12 +44,8 @@ class testtask extends control $projectID = $this->session->project; $products = $this->loadModel('project')->getProducts($projectID, false); } - if($this->app->openApp == 'qa') - { - $products = $this->loadModel('product')->getPairs(); - $this->app->loadConfig('qa'); - foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa'; - } + if($this->app->openApp == 'execution') $products = $this->loadModel('execution')->getProducts($this->session->execution, false); + if($this->app->openApp == 'qa' or $this->app->openApp == 'my') $products = $this->loadModel('product')->getPairs(); $this->view->products = $this->products = $products; if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName={$this->app->openApp}&activeMenu=testtask&projectID=$projectID"))); }