* Get project tasks (project have no executions), modify code in api and json.
This commit is contained in:
@@ -44,8 +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 = '';
|
||||
/* Can not use $this->app->tab in API. */
|
||||
if((defined('RUN_MODE') and RUN_MODE == 'api') or $this->viewType == 'json') $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')
|
||||
|
||||
@@ -1632,11 +1632,13 @@ class executionModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
/* Can not use $this->app->tab in API. */
|
||||
$filterMulti = ((defined('RUN_MODE') and RUN_MODE == 'api') or $this->app->getViewType() == 'json') ? false : (!$this->session->multiple and $this->app->tab == 'execution');
|
||||
/* Order by status's content whether or not done */
|
||||
$executions = $this->dao->select("*, IF(INSTR('done,closed', status) < 2, 0, 1) AS isDone, INSTR('doing,wait,suspended,closed', status) AS sortStatus")->from(TABLE_EXECUTION)
|
||||
->where('deleted')->eq(0)
|
||||
->andWhere('vision')->eq($this->config->vision)
|
||||
->beginIF(!$this->session->multiple and $this->app->tab == 'execution')->andWhere('multiple')->eq('1')->fi()
|
||||
->beginIF($filterMulti)->andWhere('multiple')->eq('1')->fi()
|
||||
->beginIF(strpos($mode, 'multiple') !== false)->andWhere('multiple')->eq('1')->fi()
|
||||
->beginIF($type == 'all')->andWhere('type')->in('stage,sprint,kanban')->fi()
|
||||
->beginIF($projectID)->andWhere('project')->eq($projectID)->fi()
|
||||
|
||||
Reference in New Issue
Block a user