From bb040cfb78d53696edd63bf256d0fd8ba3ccdbfa Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 30 Jan 2016 22:25:16 -0500 Subject: Simplify code to handle ajax popover and redirects --- app/Controller/File.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'app/Controller/File.php') diff --git a/app/Controller/File.php b/app/Controller/File.php index b46f7d19..18e787f1 100644 --- a/app/Controller/File.php +++ b/app/Controller/File.php @@ -23,17 +23,11 @@ class File extends Base if ($this->request->isPost() && $this->file->uploadScreenshot($task['project_id'], $task['id'], $this->request->getValue('screenshot')) !== false) { $this->flash->success(t('Screenshot uploaded successfully.')); - - if ($this->request->getStringParam('redirect') === 'board') { - $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $task['project_id']))); - } - - $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))); + return $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), true); } $this->response->html($this->taskLayout('file/screenshot', array( 'task' => $task, - 'redirect' => 'task', ))); } -- cgit v1.2.3