* [bug#60843] adjust mr link task data filter.
This commit is contained in:
@@ -1915,7 +1915,7 @@ class executionModel extends model
|
||||
$taskQuery = $this->session->taskQuery;
|
||||
|
||||
/* Limit current execution when no execution. */
|
||||
if(strpos($taskQuery, "`execution` =") === false && strpos($taskQuery, "`project` =") === false) $taskQuery .= " AND `execution` = $executionID";
|
||||
if(strpos($taskQuery, "`execution` =") === false && strpos($taskQuery, "`project` =") === false && $executionID) $taskQuery .= " AND `execution` = $executionID";
|
||||
if(strpos($taskQuery, "`execution` = 'all'") !== false)
|
||||
{
|
||||
$executions = $this->getPairs(0, 'all', "nocode,noprefix,multiple");
|
||||
|
||||
+14
-5
@@ -719,9 +719,8 @@ class mr extends control
|
||||
foreach($productIdList as $productID)
|
||||
{
|
||||
if(empty($productID)) continue;
|
||||
$executions = array_merge($executions, $this->product->getExecutionPairsByProduct((int)$productID));
|
||||
$executions = $executions + $this->product->getExecutionPairsByProduct((int)$productID);
|
||||
}
|
||||
$productExecutionIDs = array_filter(array_keys($executions));
|
||||
|
||||
$this->loadModel('execution');
|
||||
$this->mrZen->buildLinkTaskSearchForm($MRID, $repoID, $orderBy, $queryID, $executions);
|
||||
@@ -730,10 +729,20 @@ class mr extends control
|
||||
|
||||
/* Get tasks by executions. */
|
||||
$allTasks = array();
|
||||
foreach($productExecutionIDs as $productExecutionID)
|
||||
if($browseType == 'bysearch')
|
||||
{
|
||||
$tasks = $this->execution->getTasks(0, $productExecutionID, array(), $browseType, $queryID, 0, $orderBy, null);
|
||||
$allTasks += array_merge($tasks, $allTasks);
|
||||
$allTasks = $this->execution->getTasks(0, 0, $executions, $browseType, $queryID, 0, $orderBy, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->loadModel('task');
|
||||
$queryStatus = $this->lang->task->statusList;
|
||||
unset($queryStatus['closed']);
|
||||
|
||||
$condition = new stdclass();
|
||||
$condition->statusList = array_keys($queryStatus);
|
||||
$condition->executionList = array_keys($executions);
|
||||
$allTasks = $this->loadModel('task')->getListByCondition($condition);
|
||||
}
|
||||
|
||||
/* Filter linked tasks. */
|
||||
|
||||
@@ -1867,6 +1867,7 @@ class taskModel extends model
|
||||
->beginIF(!empty($condition->statusList))->andWhere('status')->in($condition->statusList)->fi()
|
||||
->beginIF(!empty($condition->idList))->andWhere('id')->in($condition->idList)->fi()
|
||||
->beginIF(!empty($condition->taskName))->andWhere('name')->like("%{$condition->taskName}%")->fi()
|
||||
->beginIF(!empty($condition->executionList))->andWhere('execution')->in($condition->executionList)->fi()
|
||||
->beginIF(!$this->app->user->admin)->andWhere('execution')->in($this->app->user->view->sprints)->fi()
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
|
||||
Reference in New Issue
Block a user