diff --git a/module/execution/config.php b/module/execution/config.php index 2424586f1f..c3d80406c8 100644 --- a/module/execution/config.php +++ b/module/execution/config.php @@ -57,7 +57,7 @@ $config->execution->search['fields']['desc'] = $lang->task->desc; $config->execution->search['fields']['assignedTo'] = $lang->task->assignedTo; $config->execution->search['fields']['pri'] = $lang->task->pri; -if($app->tab == 'my') $config->execution->search['fields']['project'] = $lang->task->project; +$config->execution->search['fields']['project'] = $lang->task->project; $config->execution->search['fields']['execution'] = $lang->task->execution; $config->execution->search['fields']['module'] = $lang->task->module; $config->execution->search['fields']['estimate'] = $lang->task->estimate; @@ -92,7 +92,7 @@ $config->execution->search['params']['desc'] = array('operator' => 'in $config->execution->search['params']['assignedTo'] = array('operator' => '=', 'control' => 'select', 'values' => 'users'); $config->execution->search['params']['pri'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->task->priList); -if($app->tab == 'my') $config->execution->search['params']['project'] = array('operator' => '=', 'control' => 'select', 'values' => ''); +$config->execution->search['params']['project'] = array('operator' => '=', 'control' => 'select', 'values' => ''); $config->execution->search['params']['execution'] = array('operator' => '=', 'control' => 'select', 'values' => ''); $config->execution->search['params']['module'] = array('operator' => 'belong', 'control' => 'select', 'values' => ''); $config->execution->search['params']['estimate'] = array('operator' => '=', 'control' => 'input', 'values' => ''); diff --git a/module/execution/model.php b/module/execution/model.php index b947dea59f..e6c2443e0b 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -2035,10 +2035,19 @@ class executionModel extends model if(strpos($this->session->taskQuery, "deleted =") === false) $this->session->set('taskQuery', $this->session->taskQuery . " AND deleted = '0'"); $taskQuery = $this->session->taskQuery; + /* Limit current execution when no execution. */ - if(strpos($taskQuery, "`execution` =") === false) $taskQuery .= " AND `execution` = $executionID"; + if(strpos($taskQuery, "`execution` =") === false && strpos($taskQuery, "`project` =") === false) $taskQuery .= " AND `execution` = $executionID"; $executionQuery = "`execution` " . helper::dbIN(array_keys($executions)); $taskQuery = str_replace("`execution` = 'all'", $executionQuery, $taskQuery); // Search all execution. + /* Process all project query. */ + if(strpos($taskQuery, "`project` = 'all'") !== false) + { + $projects = $this->loadModel('project')->getPairsByProgram(); + $projectQuery = "`project` " . helper::dbIN(array_keys($projects)); + $taskQuery = str_replace("`project` = 'all'", $projectQuery, $taskQuery);; + } + $this->session->set('taskQueryCondition', $taskQuery, $this->app->tab); $this->session->set('taskOnlyCondition', true, $this->app->tab); @@ -4102,6 +4111,9 @@ class executionModel extends model $this->config->execution->search['queryID'] = $queryID; $this->config->execution->search['params']['execution']['values'] = array(''=>'', $executionID => $executions[$executionID], 'all' => $this->lang->execution->allExecutions); + $projects = $this->loadModel('project')->getPairsByProgram(); + $this->config->execution->search['params']['project']['values'] = $projects + array('all' => $this->lang->project->allProjects); + $showAllModule = isset($this->config->execution->task->allModule) ? $this->config->execution->task->allModule : ''; $this->config->execution->search['params']['module']['values'] = $this->loadModel('tree')->getTaskOptionMenu($executionID, 0, $showAllModule ? 'allModule' : '');