From 9b699300ff82b7a6496c40cfdb3734eb9d77a044 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 9 Jun 2022 16:49:50 +0800 Subject: [PATCH] * code for bug #23516. --- module/bug/control.php | 4 ++-- module/story/control.php | 4 ++-- module/task/control.php | 4 ++-- module/testcase/control.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index a15854651d..cd99ed60d7 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -365,7 +365,6 @@ class bug extends control if(!empty($_POST)) { $response['result'] = 'success'; - $response['message'] = $this->lang->saveSuccess; /* Set from param if there is a object to transfer bug. */ setcookie('lastBugModule', (int)$this->post->module, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, false); @@ -450,7 +449,8 @@ class bug extends control $location = $this->createLink('bug', 'browse', "productID={$this->post->product}&branch=$branch&browseType=byModule¶m={$this->post->module}&orderBy=id_desc"); } if($this->app->getViewType() == 'xhtml') $location = $this->createLink('bug', 'view', "bugID=$bugID", 'html'); - $response['locate'] = $location; + $response['message'] = $this->lang->saveSuccess; + $response['locate'] = $location; return $this->send($response); } diff --git a/module/story/control.php b/module/story/control.php index 74c8505fd9..9a9bcc2a5d 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -116,8 +116,7 @@ class story extends control if(!empty($_POST)) { - $response['result'] = 'success'; - $response['message'] = $this->lang->saveSuccess; + $response['result'] = 'success'; setcookie('lastStoryModule', (int)$this->post->module, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, false); $storyResult = $this->story->create($objectID, $bugID, $from = isset($fromObjectIDKey) ? $fromObjectIDKey : '', $extra); @@ -180,6 +179,7 @@ class story extends control $message = $this->executeHooks($storyID); if($message) $this->lang->saveSuccess = $message; + $response['message'] = $this->lang->saveSuccess; if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $storyID)); diff --git a/module/task/control.php b/module/task/control.php index 926ff45c80..03e57a7fe2 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -105,8 +105,7 @@ class task extends control if(!empty($_POST)) { - $response['result'] = 'success'; - $response['message'] = $this->lang->saveSuccess; + $response['result'] = 'success'; setcookie('lastTaskModule', (int)$this->post->module, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, false); if($this->post->execution) $executionID = (int)$this->post->execution; @@ -164,6 +163,7 @@ class task extends control $message = $this->executeHooks($taskID); if($message) $this->lang->saveSuccess = $message; + $response['message'] = $this->lang->saveSuccess; /* Return task id when call the API. */ if($this->viewType == 'json' or (defined('RUN_MODE') && RUN_MODE == 'api')) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $taskID)); diff --git a/module/testcase/control.php b/module/testcase/control.php index e71c12ac8e..8fcdb966bb 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -316,8 +316,7 @@ class testcase extends control $this->loadModel('story'); if(!empty($_POST)) { - $response['result'] = 'success'; - $response['message'] = $this->lang->saveSuccess; + $response['result'] = 'success'; setcookie('lastCaseModule', (int)$this->post->module, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, false); $caseResult = $this->testcase->create($bugID); @@ -344,6 +343,7 @@ class testcase extends control $message = $this->executeHooks($caseID); if($message) $this->lang->saveSuccess = $message; + $response['message'] = $this->lang->saveSuccess; if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $caseID)); /* If link from no head then reload. */