From 1353929a7dbd3f2e897fa7d3ab88e959ca573f9f Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 28 May 2016 13:41:54 -0400 Subject: Rename controllers --- .../ProjectActionDuplicationController.php | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 app/Controller/ProjectActionDuplicationController.php (limited to 'app/Controller/ProjectActionDuplicationController.php') diff --git a/app/Controller/ProjectActionDuplicationController.php b/app/Controller/ProjectActionDuplicationController.php new file mode 100644 index 00000000..790b7ed3 --- /dev/null +++ b/app/Controller/ProjectActionDuplicationController.php @@ -0,0 +1,38 @@ +getProject(); + $projects = $this->projectUserRole->getProjectsByUser($this->userSession->getId()); + unset($projects[$project['id']]); + + $this->response->html($this->template->render('project_action_duplication/show', array( + 'project' => $project, + 'projects_list' => $projects, + ))); + } + + public function save() + { + $project = $this->getProject(); + $src_project_id = $this->request->getValue('src_project_id'); + + if ($this->action->duplicate($src_project_id, $project['id'])) { + $this->flash->success(t('Actions duplicated successfully.')); + } else { + $this->flash->failure(t('Unable to duplicate actions.')); + } + + $this->response->redirect($this->helper->url->to('ActionController', 'index', array('project_id' => $project['id']))); + } +} -- cgit v1.2.3