diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-07-19 22:08:07 -0230 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-07-19 22:08:07 -0230 |
commit | 833bd3f8a90b604f4ab289dab9366c0032ce5216 (patch) | |
tree | d9dba860b725a2c837fe1a640cafd0bd0b418e43 /app/Controller/Base.php | |
parent | 42ca8390d43080c7403c4ae4cdaf31296bc02576 (diff) |
Add Task CSV export and Kanboard CLI
Diffstat (limited to 'app/Controller/Base.php')
-rw-r--r-- | app/Controller/Base.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/app/Controller/Base.php b/app/Controller/Base.php index 8890db4c..462529b1 100644 --- a/app/Controller/Base.php +++ b/app/Controller/Base.php @@ -246,4 +246,25 @@ abstract class Base return $task; } + + /** + * Common method to get a project + * + * @access protected + * @return array + */ + protected function getProject() + { + $project_id = $this->request->getIntegerParam('project_id'); + $project = $this->project->getById($project_id); + + if (! $project) { + $this->session->flashError(t('Project not found.')); + $this->response->redirect('?controller=project'); + } + + $this->checkProjectPermissions($project['id']); + + return $project; + } } |