* Fix bug for API, can get project tasks (this project have not executions) now.
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user