Merge branch 'sprint/lmy_task' into 'master'

* Finish task #85455, #85456.

See merge request easycorp/zentaopms!7066
This commit is contained in:
孙广明
2023-02-24 07:20:22 +00:00
5 changed files with 29 additions and 27 deletions
+6 -3
View File
@@ -2799,17 +2799,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');
@@ -2894,6 +2896,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);