* Finish task #85455, #85456.

This commit is contained in:
liumengyi
2023-02-24 06:24:16 +00:00
parent 137dcf1e9a
commit f45c4ccdd4
2 changed files with 8 additions and 4 deletions
+2 -1
View File
@@ -506,9 +506,10 @@ class execution extends control
$execution = $this->commonAction($toExecution);
$toExecution = $execution->id;
$project = $this->loadModel('project')->getByID($execution->project);
$branches = $this->execution->getBranches($toExecution);
$tasks = $this->execution->getTasks2Imported($toExecution, $branches);
$executions = $this->execution->getToImport(array_keys($tasks), $execution->type);
$executions = $this->execution->getToImport(array_keys($tasks), $execution->type, $project->model);
unset($executions[$toExecution]);
unset($tasks[$toExecution]);
+6 -3
View File
@@ -2792,17 +2792,19 @@ class executionModel extends model
* Get executions to import
*
* @param array $executionIds
* @param string $type sprint|stage
* @param string $type sprint|stage|kanban
* @param string $model
* @access public
* @return array
*/
public function getToImport($executionIds, $type)
public function getToImport($executionIds, $type, $model = '')
{
return $this->dao->select('t1.id,concat_ws(" / ", t2.name, t1.name) as name')->from(TABLE_EXECUTION)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t2.id=t1.project')
->where('t1.id')->in($executionIds)
->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->sprints)->fi()
->andWhere('t1.type')->eq($type)
->beginIF(empty($model) or strpos(',waterfallplus,agileplus,', ",$model,") === false)->andWhere('t1.type')->eq($type)->fi()
->beginIF(!empty($model) and $model == 'agileplus')->andWhere('t1.type')->in(array('sprint', 'kanban'))->fi()
->andWhere('t1.deleted')->eq(0)
->orderBy('t1.id desc')
->fetchPairs('id', 'name');
@@ -2887,6 +2889,7 @@ class executionModel extends model
->where('project')->in($brotherProjects)
->andWhere('multiple')->eq('1')
->andWhere('status')->ne('closed')
->andWhere('deleted')->eq(0)
->fetchPairs('id');
$branches = str_replace(',', "','", $branches);