summaryrefslogtreecommitdiff
path: root/app/Controller/TaskFile.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-05-28 13:41:54 -0400
committerFrederic Guillot <fred@kanboard.net>2016-05-28 13:41:54 -0400
commit1353929a7dbd3f2e897fa7d3ab88e959ca573f9f (patch)
tree30bdbac4e466e74c3dfb4d451422f03c62bcbe41 /app/Controller/TaskFile.php
parentab48a09f0d674b703467975b376c5ac7352670ae (diff)
Rename controllers
Diffstat (limited to 'app/Controller/TaskFile.php')
-rw-r--r--app/Controller/TaskFile.php98
1 files changed, 0 insertions, 98 deletions
diff --git a/app/Controller/TaskFile.php b/app/Controller/TaskFile.php
deleted file mode 100644
index 544c1ea7..00000000
--- a/app/Controller/TaskFile.php
+++ /dev/null
@@ -1,98 +0,0 @@
-<?php
-
-namespace Kanboard\Controller;
-
-/**
- * Task File Controller
- *
- * @package controller
- * @author Frederic Guillot
- */
-class TaskFile extends BaseController
-{
- /**
- * Screenshot
- *
- * @access public
- */
- public function screenshot()
- {
- $task = $this->getTask();
-
- if ($this->request->isPost() && $this->taskFile->uploadScreenshot($task['id'], $this->request->getValue('screenshot')) !== false) {
- $this->flash->success(t('Screenshot uploaded successfully.'));
- return $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), true);
- }
-
- return $this->response->html($this->template->render('task_file/screenshot', array(
- 'task' => $task,
- )));
- }
-
- /**
- * File upload form
- *
- * @access public
- */
- public function create()
- {
- $task = $this->getTask();
-
- $this->response->html($this->template->render('task_file/create', array(
- 'task' => $task,
- 'max_size' => $this->helper->text->phpToBytes(ini_get('upload_max_filesize')),
- )));
- }
-
- /**
- * File upload (save files)
- *
- * @access public
- */
- public function save()
- {
- $task = $this->getTask();
-
- if (! $this->taskFile->uploadFiles($task['id'], $this->request->getFileInfo('files'))) {
- $this->flash->failure(t('Unable to upload the file.'));
- }
-
- $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), true);
- }
-
- /**
- * Remove a file
- *
- * @access public
- */
- public function remove()
- {
- $this->checkCSRFParam();
- $task = $this->getTask();
- $file = $this->taskFile->getById($this->request->getIntegerParam('file_id'));
-
- if ($file['task_id'] == $task['id'] && $this->taskFile->remove($file['id'])) {
- $this->flash->success(t('File removed successfully.'));
- } else {
- $this->flash->failure(t('Unable to remove this file.'));
- }
-
- $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])));
- }
-
- /**
- * Confirmation dialog before removing a file
- *
- * @access public
- */
- public function confirm()
- {
- $task = $this->getTask();
- $file = $this->taskFile->getById($this->request->getIntegerParam('file_id'));
-
- $this->response->html($this->template->render('task_file/remove', array(
- 'task' => $task,
- 'file' => $file,
- )));
- }
-}