diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-08-12 12:03:15 -0700 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-08-12 12:03:15 -0700 |
commit | 66b5659578a9f982b03a85bce7985252119613c3 (patch) | |
tree | 813535bd651e2d43b317a217c4c2913c2c5c1373 /app/Controller | |
parent | 9f46120de940d8e8d1f97a7583b1eb197eb5405a (diff) |
Project cloning/duplication (pull-request #196)
Diffstat (limited to 'app/Controller')
-rw-r--r-- | app/Controller/Project.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/app/Controller/Project.php b/app/Controller/Project.php index 8c21801b..0d430b44 100644 --- a/app/Controller/Project.php +++ b/app/Controller/Project.php @@ -13,6 +13,27 @@ use Core\Translator; */ class Project extends Base { + + /** + * Clone Project + * + * @author Antonio Rabelo + * @access public + */ + public function duplicate() + { + $this->checkCSRFParam(); + $project_id = $this->request->getIntegerParam('project_id'); + + if ($project_id && $this->project->duplicate($project_id)) { + $this->session->flash(t('Project cloned successfully.')); + } else { + $this->session->flashError(t('Unable to clone this project.')); + } + + $this->response->redirect('?controller=project'); + } + /** * Task export * |