From 14dd2012ccb7250efca1cf757ac3bcc42bee03a9 Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Fri, 9 Apr 2021 06:01:18 +0300 Subject: [PATCH] * Finish task#37299. --- module/bug/control.php | 2 +- module/product/control.php | 9 +++++---- module/projectrelease/control.php | 2 +- module/testcase/control.php | 2 +- module/testreport/control.php | 2 +- module/testsuite/control.php | 2 +- module/testtask/control.php | 2 +- 7 files changed, 11 insertions(+), 10 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index a889a5bec9..aa59553fc7 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -66,7 +66,7 @@ class bug extends control $this->view->products = $this->products = $products; $openApp = ($this->app->openApp == 'project' or $this->app->openApp == 'execution') ? $this->app->openApp : 'qa'; - if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$openApp&activeMenu=bug&objectID=$objectID"))); + if(empty($this->products) and !helper::isAjaxRequest()) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$openApp&activeMenu=bug&objectID=$objectID"))); } /** diff --git a/module/product/control.php b/module/product/control.php index 7e5d6ff973..6e0820de8d 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -994,10 +994,11 @@ class product extends control $this->lang->project->menuOrder = $this->lang->{$project->model}->menuOrder; $this->app->rawModule = $activeMenu; - if($activeMenu == 'bug') $this->lang->{$project->model}->menu->qa['subMenu']->bug['subModule'] = 'product'; - if($activeMenu == 'testcase') $this->lang->{$project->model}->menu->qa['subMenu']->testcase['subModule'] = 'product'; - if($activeMenu == 'testtask') $this->lang->{$project->model}->menu->qa['subMenu']->testtask['subModule'] = 'product'; - if($activeMenu == 'testreport') $this->lang->{$project->model}->menu->qa['subMenu']->testreport['subModule'] = 'product'; + if($activeMenu == 'bug') $this->lang->{$project->model}->menu->qa['subMenu']->bug['subModule'] = 'product'; + if($activeMenu == 'testcase') $this->lang->{$project->model}->menu->qa['subMenu']->testcase['subModule'] = 'product'; + if($activeMenu == 'testtask') $this->lang->{$project->model}->menu->qa['subMenu']->testtask['subModule'] = 'product'; + if($activeMenu == 'testreport') $this->lang->{$project->model}->menu->qa['subMenu']->testreport['subModule'] = 'product'; + if($activeMenu == 'projectrelease') $this->lang->{$project->model}->menu->release['subModule'] = 'projectrelease'; } elseif($moduleName == 'qa') { diff --git a/module/projectrelease/control.php b/module/projectrelease/control.php index 8b44e19510..1484e77770 100644 --- a/module/projectrelease/control.php +++ b/module/projectrelease/control.php @@ -29,7 +29,7 @@ class projectrelease extends control $this->loadModel('release'); $this->loadModel('project'); $this->view->products = $this->products = $this->product->getProductPairsByProject($this->session->project); - if(empty($this->view->products)) $this->locate($this->createLink('product', 'create')); + if(empty($this->products) and !helper::isAjaxRequest()) die($this->locate($this->createLink('product', 'showErrorNone', 'moduleName=project&activeMenu=projectrelease&projectID=' . $this->session->project))); } /** diff --git a/module/testcase/control.php b/module/testcase/control.php index 836ce48fd6..33e38996d9 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -60,7 +60,7 @@ class testcase extends control $this->view->products = $this->products = $products; $openApp = ($this->app->openApp == 'project' or $this->app->openApp == 'execution') ? $this->app->openApp : 'qa'; - if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$openApp&activeMenu=testcase&objectID=$objectID"))); + if(empty($this->products) and !helper::isAjaxRequest()) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$openApp&activeMenu=testcase&objectID=$objectID"))); } /** diff --git a/module/testreport/control.php b/module/testreport/control.php index 6adc70427a..c76ccc0e8f 100644 --- a/module/testreport/control.php +++ b/module/testreport/control.php @@ -63,7 +63,7 @@ class testreport extends control $this->view->products = $this->products = $products; $openApp = ($this->app->openApp == 'project' or $this->app->openApp == 'execution') ? $this->app->openApp : 'qa'; - if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$openApp&activeMenu=testreport&objectID=$objectID"))); + if(empty($this->products) and !helper::isAjaxRequest()) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$openApp&activeMenu=testreport&objectID=$objectID"))); } /** diff --git a/module/testsuite/control.php b/module/testsuite/control.php index a2b287ddf2..4607ed21aa 100644 --- a/module/testsuite/control.php +++ b/module/testsuite/control.php @@ -32,7 +32,7 @@ class testsuite extends control parent::__construct($moduleName, $methodName); $this->view->products = $this->products = $this->loadModel('product')->getPairs(); - if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=qa&activeMenu=testsuite"))); + if(empty($this->products) and !helper::isAjaxRequest()) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=qa&activeMenu=testsuite"))); } /** diff --git a/module/testtask/control.php b/module/testtask/control.php index 433f11315d..69c1a8d79f 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -58,7 +58,7 @@ class testtask extends control $this->view->products = $this->products = $products; $openApp = ($this->app->openApp == 'project' or $this->app->openApp == 'execution') ? $this->app->openApp : 'qa'; - if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$openApp&activeMenu=testtask&objectID=$objectID"))); + if(empty($this->products) and !helper::isAjaxRequest()) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$openApp&activeMenu=testtask&objectID=$objectID"))); } /**