summaryrefslogtreecommitdiff
path: root/app/Controller/File.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-01-30 22:25:16 -0500
committerFrederic Guillot <fred@kanboard.net>2016-01-30 22:25:16 -0500
commitbb040cfb78d53696edd63bf256d0fd8ba3ccdbfa (patch)
tree811d150fddd6220faabb3c1ea1743ffd7f781e45 /app/Controller/File.php
parent4a52d327f7e555c336a428c457cf40c3d97bfab3 (diff)
Simplify code to handle ajax popover and redirects
Diffstat (limited to 'app/Controller/File.php')
-rw-r--r--app/Controller/File.php8
1 files changed, 1 insertions, 7 deletions
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',
)));
}