Implemented Project duplication with Tasks within Controller\Project
This commit is contained in:
@@ -307,7 +307,14 @@ class Project extends Base
|
|||||||
|
|
||||||
$this->checkCSRFParam();
|
$this->checkCSRFParam();
|
||||||
|
|
||||||
if ($this->project->duplicate($project['id'])) {
|
$clone_project_id = $this->project->duplicate($project['id']);
|
||||||
|
|
||||||
|
if ($clone_project_id) {
|
||||||
|
// Find all task for source project and clone to target project
|
||||||
|
$tasks = $this->taskFinder->getAll($project['id']);
|
||||||
|
foreach($tasks as $task) {
|
||||||
|
$this->taskDuplication->duplicateToProject($task['id'], $clone_project_id);
|
||||||
|
}
|
||||||
$this->session->flash(t('Project cloned successfully.'));
|
$this->session->flash(t('Project cloned successfully.'));
|
||||||
} else {
|
} else {
|
||||||
$this->session->flashError(t('Unable to clone this project.'));
|
$this->session->flashError(t('Unable to clone this project.'));
|
||||||
|
|||||||
Reference in New Issue
Block a user