summaryrefslogtreecommitdiff
path: root/app/Controller/File.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-12-31 12:37:15 -0500
committerFrédéric Guillot <fred@kanboard.net>2014-12-31 12:37:15 -0500
commit772804add8095eea9b3ec2a832c2f82fbb9a6fd5 (patch)
tree782a414d15f9091d04bcf3960a957f952958e548 /app/Controller/File.php
parent66f150d887a34d2b51ff14f22d0fd41a34f8cc77 (diff)
Acl refactoring
Diffstat (limited to 'app/Controller/File.php')
-rw-r--r--app/Controller/File.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/Controller/File.php b/app/Controller/File.php
index 1585a701..63052610 100644
--- a/app/Controller/File.php
+++ b/app/Controller/File.php
@@ -37,11 +37,11 @@ class File extends Base
$task = $this->getTask();
if ($this->file->upload($task['project_id'], $task['id'], 'files') === true) {
- $this->response->redirect('?controller=task&action=show&task_id='.$task['id'].'#attachments');
+ $this->response->redirect('?controller=task&action=show&task_id='.$task['id'].'&project_id='.$task['project_id'].'#attachments');
}
else {
$this->session->flashError(t('Unable to upload the file.'));
- $this->response->redirect('?controller=file&action=create&task_id='.$task['id']);
+ $this->response->redirect('?controller=file&action=create&task_id='.$task['id'].'&project_id='.$task['project_id']);
}
}
@@ -61,7 +61,7 @@ class File extends Base
$this->response->binary(file_get_contents($filename));
}
- $this->response->redirect('?controller=task&action=show&task_id='.$task['id']);
+ $this->response->redirect('?controller=task&action=show&task_id='.$task['id'].'&project_id='.$task['project_id']);
}
/**
@@ -76,7 +76,8 @@ class File extends Base
if ($file['task_id'] == $task['id']) {
$this->response->html($this->template->render('file/open', array(
- 'file' => $file
+ 'file' => $file,
+ 'task' => $task,
)));
}
}
@@ -119,7 +120,7 @@ class File extends Base
$this->session->flashError(t('Unable to remove this file.'));
}
- $this->response->redirect('?controller=task&action=show&task_id='.$task['id']);
+ $this->response->redirect('?controller=task&action=show&task_id='.$task['id'].'&project_id='.$task['project_id']);
}
/**