* [task#125636,done,2h] add project to search fields in execution::task.

This commit is contained in:
liumengyi
2024-08-20 09:47:59 +08:00
committed by 曹延义
parent 00dce315e7
commit 6e3351561f
2 changed files with 15 additions and 3 deletions
+2 -2
View File
@@ -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' => '');
+13 -1
View File
@@ -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' : '');