* Fix bug for API, can get project tasks (this project have not executions) now.

This commit is contained in:
songchenxuan
2023-05-17 14:51:56 +08:00
parent dd11beaebc
commit a8951152f2
2 changed files with 17 additions and 0 deletions
+15
View File
@@ -54,6 +54,21 @@ class tasksEntry extends entry
}
else
{
/* If $executionID is a project that have no execution, get real executionID. */
$project = $this->loadModel('project')->getByID($executionID);
if($project and $project->type == 'project' and !$project->multiple)
{
$executions = $this->loadModel('execution')->getList($project->id);
foreach($executions as $execution)
{
if(!$execution->multiple)
{
$executionID = $execution->id;
break;
}
}
}
/* Get tasks by execution. */
$control = $this->loadController('execution', 'task');
$control->task($executionID, $this->param('status', 'all'), 0, $this->param('order', 'id_desc'), 0, $this->param('limit', 100), $this->param('page', 1));
+2
View File
@@ -44,6 +44,8 @@ class execution extends control
if(!isset($this->app->user)) return;
$mode = $this->app->tab == 'execution' ? 'multiple' : '';
/* this->app->tab will always be my if use API. */
if(defined('RUN_MODE') and RUN_MODE == 'api') $mode = '';
$this->executions = $this->execution->getPairs(0, 'all', "nocode,{$mode}");
$skipCreateStep = array('computeburn', 'ajaxgetdropmenu', 'executionkanban', 'ajaxgetteammembers', 'all');
if(!in_array($this->methodName, $skipCreateStep) and $this->app->tab == 'execution')