diff --git a/module/project/control.php b/module/project/control.php index eef68a78b6..9ec71cd5ec 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -446,7 +446,7 @@ class project extends control $toProject = $project->id; $branches = $this->project->getExecutionBranches($toProject); $tasks = $this->project->getTasks2Imported($toProject, $branches); - $projects = $this->project->getExecutionsToImport(array_keys($tasks)); + $projects = $this->project->getExecutionsToImport(array_keys($tasks), $project->type); unset($projects[$toProject]); unset($tasks[$toProject]); diff --git a/module/project/model.php b/module/project/model.php index 3b779d1672..f386c5ac58 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1710,21 +1710,23 @@ class projectModel extends model * Get executions to import * * @param array $executionIds + * @param string $type sprint|stage * @access public * @return array */ - public function getExecutionsToImport($executionIds) + public function getExecutionsToImport($executionIds, $type) { $executions = $this->dao->select('*')->from(TABLE_EXECUTION) ->where('id')->in($executionIds) ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->sprints)->fi() + ->andWhere('type')->eq($type) ->andWhere('deleted')->eq(0) ->orderBy('id desc') ->fetchAll('id'); $pairs = array(); $now = date('Y-m-d'); - foreach($executions as $id => $execution) $pairs[$id] = ucfirst(substr($execution->code, 0, 1)) . ':' . $execution->name; + foreach($executions as $id => $execution) $pairs[$id] = $execution->name; return $pairs; } diff --git a/module/project/view/importtask.html.php b/module/project/view/importtask.html.php index 9c592152c9..0c837810db 100644 --- a/module/project/view/importtask.html.php +++ b/module/project/view/importtask.html.php @@ -53,7 +53,7 @@ id);?> -