Simplify code to handle ajax popover and redirects
This commit is contained in:
@@ -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',
|
||||
)));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user