From b2632de0a87f44d3d7bfe7c2e5320ffd3bd956f3 Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Thu, 25 Mar 2021 10:09:25 +0800 Subject: [PATCH] * Fix a bug. --- db/update15.0.sql | 2 ++ module/testcase/control.php | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/db/update15.0.sql b/db/update15.0.sql index 03ec09355d..22d13be1e9 100644 --- a/db/update15.0.sql +++ b/db/update15.0.sql @@ -136,6 +136,8 @@ ALTER TABLE `zt_task` ADD `designVersion` smallint(6) unsigned NOT NULL AFTER `s ALTER TABLE `zt_burn` ADD `storyPoint` float NOT NULL AFTER `consumed`; ALTER TABLE `zt_burn` ADD `product` mediumint(8) unsigned NOT NULL DEFAULT '0' AFTER `execution`; +ALTER TABLE `zt_projectcase` ADD `count` mediumint(8) unsigned NOT NULL DEFAULT '1' AFTER `case`; + -- DROP TABLE IF EXISTS `zt_taskspec`; CREATE TABLE IF NOT EXISTS `zt_taskspec` ( `task` mediumint(8) NOT NULL, diff --git a/module/testcase/control.php b/module/testcase/control.php index ea304dda63..4e5e2881fb 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -302,7 +302,10 @@ class testcase extends control if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true)); setcookie('caseModule', 0, 0, $this->config->webRoot, '', false, false); - $response['locate'] = $this->createLink('testcase', 'browse', "productID={$this->post->product}&branch={$this->post->branch}&browseType=all¶m=0&orderBy=id_desc"); + $currentModule = $this->app->openApp == 'project' ? 'project' : 'testcase'; + $currentMethod = $this->app->openApp == 'project' ? 'testcase' : 'browse'; + $projectParam = $this->app->openApp == 'project' ? "projectID={$this->session->project}&" : ''; + $response['locate'] = $this->createLink($currentModule, $currentMethod, $projectParam . "productID={$this->post->product}&branch={$this->post->branch}&browseType=all¶m=0&orderBy=id_desc"); if($this->app->openApp == 'execution') $response['locate'] = $this->createLink('execution', 'testcase', "executionID={$this->session->execution}&type=all"); $this->send($response); } @@ -442,7 +445,10 @@ class testcase extends control if(isonlybody()) die(js::closeModal('parent.parent', 'this')); setcookie('caseModule', 0, 0, $this->config->webRoot, '', false, false); - die(js::locate($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch&browseType=all¶m=0&orderBy=id_desc"), 'parent')); + $currentModule = $this->app->openApp == 'project' ? 'project' : 'testcase'; + $currentMethod = $this->app->openApp == 'project' ? 'testcase' : 'browse'; + $projectParam = $this->app->openApp == 'project' ? "projectID={$this->session->project}&" : ''; + die(js::locate($this->createLink($currentModule, $currentMethod, $projectParam . "productID=$productID&branch=$branch&browseType=all¶m=0&orderBy=id_desc"), 'parent')); } if(empty($this->products)) $this->locate($this->createLink('product', 'create'));