From 142bc197323bd49e520103d5049fef232df06f47 Mon Sep 17 00:00:00 2001 From: wangyuting Date: Fri, 19 Apr 2024 14:50:06 +0800 Subject: [PATCH] * Fix search lite story locate bug. bug #48063. --- module/execution/control.php | 2 +- module/story/control.php | 2 +- module/task/control.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index dc95054545..174b65c7b7 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1595,7 +1595,7 @@ class execution extends control $execution = $this->execution->getByID($executionID, true); $type = $this->config->vision == 'lite' ? 'kanban' : 'stage,sprint,kanban'; - if(empty($execution) || strpos($type, $execution->type) === false) return $this->send(array('result' => 'success', 'load' => array('alert' => $this->lang->notFound, 'locate' => $this->createLink('execution', 'all')))); + if(empty($execution) || strpos($type, $execution->type) === false) return $this->send(array('result' => 'success', 'load' => array('alert' => $this->lang->notFound, 'locate' => $this->config->vision == 'lite' ? $this->createLink('project', 'index') : $this->createLink('execution', 'all')))); if($execution->type == 'kanban' and defined('RUN_MODE') and RUN_MODE == 'api') return print($this->fetch('execution', 'kanban', "executionID=$executionID")); diff --git a/module/story/control.php b/module/story/control.php index 12828775d4..47edb9bc2d 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -497,7 +497,7 @@ class story extends control $product = $this->product->getByID((int)$story->product); if($tab == 'product' and !empty($product->shadow)) return $this->send(array('result' => 'success', 'open' => array('url' => $uri, 'app' => 'project'))); - if(!$story) return $this->send(array('result' => 'success', 'message' => $this->lang->notFound, 'load' => $this->createLink($this->config->vision == 'lite' ? 'project' : 'product', 'all'))); + if(!$story) return $this->send(array('result' => 'success', 'load' => array('alert' => $this->lang->notFound, 'locate' => $this->createLink($this->config->vision == 'lite' ? 'project' : 'product', 'index')))); if(!$this->app->user->admin and strpos(",{$this->app->user->view->products},", ",$story->product,") === false) return $this->send(array('result' => 'success', 'message' => $this->lang->product->accessDenied, 'load' => array('back' => true))); $this->session->set('productList', $uri . "#app={$tab}", 'product'); diff --git a/module/task/control.php b/module/task/control.php index 813cdee527..5164a4848e 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -333,7 +333,7 @@ class task extends control if(!$task) { if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'code' => 404, 'message' => '404 Not found')); - return $this->send(array('result' => 'fail', 'load' => array('alert' => $this->lang->notFound, 'locate' => $this->createLink('execution', 'all')))); + return $this->send(array('result' => 'success', 'load' => array('alert' => $this->lang->notFound, 'locate' => $this->config->vision == 'lite' ? $this->createLink('project', 'index') : $this->createLink('execution', 'all')))); } if(!$this->loadModel('common')->checkPrivByObject('execution', $task->execution)) return print(js::error($this->lang->execution->accessDenied) . js::locate($this->createLink('execution', 'all')));