From e2d72fe43eecc4bc99d5d09abcdd1031b7e42469 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Thu, 28 Dec 2023 15:08:32 +0800 Subject: [PATCH] * Adjust project execution return data for api. --- module/project/control.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/module/project/control.php b/module/project/control.php index 17ff358c81..078f637e88 100755 --- a/module/project/control.php +++ b/module/project/control.php @@ -748,13 +748,18 @@ class project extends control $project = $this->project->getByID($projectID); $this->project->setMenu($projectID); - if(!$projectID) return $this->send(array('result' => 'fail', 'locate' => inlink('browse'))); + if(!$projectID) return $this->locate(inlink('browse')); if(!$project->multiple) { $executionID = $this->execution->getNoMultipleID($projectID); - return print(js::locate($this->createLink('execution', 'task', "executionID=$executionID"))); + if(defined('RUN_MODE') && RUN_MODE == 'api') + { + $this->view->executionStats = array($this->execution->getByID($executionID)); + return $this->display(); + } + return $this->locate($this->createLink('execution', 'task', "executionID=$executionID")); } - if(!empty($project->model) and $project->model == 'kanban' and !(defined('RUN_MODE') and RUN_MODE == 'api')) return $this->send(array('result' => 'fail', 'locate' => inlink('index', "projectID=$projectID"))); + if(!empty($project->model) && $project->model == 'kanban' && !(defined('RUN_MODE') && RUN_MODE == 'api')) return $this->locate(inlink('index', "projectID=$projectID")); /* Load pager and get tasks. */ $this->app->loadClass('pager', true);