summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-02-14 15:49:59 -0500
committerFrederic Guillot <fred@kanboard.net>2016-02-14 15:49:59 -0500
commit8477da26437cd927b47fbac8874e2a7e02b580ca (patch)
tree2e1b256eba73a3b719f57ff5df8b4497faa2c3f9
parent8e25c875f26b05e3138fb4d09d9f720456c09f76 (diff)
Rename File controller to TaskFile
-rw-r--r--app/Controller/BoardPopover.php2
-rw-r--r--app/Controller/TaskFile.php (renamed from app/Controller/File.php)12
-rw-r--r--app/ServiceProvider/AuthenticationProvider.php2
-rw-r--r--app/ServiceProvider/RouteProvider.php2
-rw-r--r--app/Template/board/tooltip_files.php4
-rw-r--r--app/Template/file/open.php6
-rw-r--r--app/Template/task/menu.php4
-rw-r--r--app/Template/task/show.php2
-rw-r--r--app/Template/task_file/new.php (renamed from app/Template/file/new.php)2
-rw-r--r--app/Template/task_file/open.php6
-rw-r--r--app/Template/task_file/remove.php (renamed from app/Template/file/remove.php)2
-rw-r--r--app/Template/task_file/screenshot.php (renamed from app/Template/file/screenshot.php)2
-rw-r--r--app/Template/task_file/show.php (renamed from app/Template/file/show.php)14
13 files changed, 29 insertions, 31 deletions
diff --git a/app/Controller/BoardPopover.php b/app/Controller/BoardPopover.php
index f2b39d8d..965669ff 100644
--- a/app/Controller/BoardPopover.php
+++ b/app/Controller/BoardPopover.php
@@ -93,7 +93,7 @@ class BoardPopover extends Base
{
$task = $this->getTask();
- $this->response->html($this->template->render('file/screenshot', array(
+ $this->response->html($this->template->render('task_file/screenshot', array(
'task' => $task,
)));
}
diff --git a/app/Controller/File.php b/app/Controller/TaskFile.php
index c5517df8..102fdc5c 100644
--- a/app/Controller/File.php
+++ b/app/Controller/TaskFile.php
@@ -5,12 +5,12 @@ namespace Kanboard\Controller;
use Kanboard\Core\ObjectStorage\ObjectStorageException;
/**
- * File controller
+ * File File Controller
*
* @package controller
* @author Frederic Guillot
*/
-class File extends Base
+class TaskFile extends Base
{
/**
* Screenshot
@@ -26,7 +26,7 @@ class File extends Base
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->helper->layout->task('file/screenshot', array(
+ $this->response->html($this->helper->layout->task('task_file/screenshot', array(
'task' => $task,
)));
}
@@ -40,7 +40,7 @@ class File extends Base
{
$task = $this->getTask();
- $this->response->html($this->helper->layout->task('file/new', array(
+ $this->response->html($this->helper->layout->task('task_file/new', array(
'task' => $task,
'max_size' => $this->helper->text->phpToBytes(ini_get('upload_max_filesize')),
)));
@@ -95,7 +95,7 @@ class File extends Base
$file = $this->taskFile->getById($this->request->getIntegerParam('file_id'));
if ($file['task_id'] == $task['id']) {
- $this->response->html($this->template->render('file/open', array(
+ $this->response->html($this->template->render('task_file/open', array(
'file' => $file,
'task' => $task,
)));
@@ -178,7 +178,7 @@ class File extends Base
$task = $this->getTask();
$file = $this->taskFile->getById($this->request->getIntegerParam('file_id'));
- $this->response->html($this->helper->layout->task('file/remove', array(
+ $this->response->html($this->helper->layout->task('task_file/remove', array(
'task' => $task,
'file' => $file,
)));
diff --git a/app/ServiceProvider/AuthenticationProvider.php b/app/ServiceProvider/AuthenticationProvider.php
index c2f7a5c4..cc7b9302 100644
--- a/app/ServiceProvider/AuthenticationProvider.php
+++ b/app/ServiceProvider/AuthenticationProvider.php
@@ -76,7 +76,7 @@ class AuthenticationProvider implements ServiceProviderInterface
$acl->add('Comment', '*', Role::PROJECT_MEMBER);
$acl->add('Customfilter', '*', Role::PROJECT_MEMBER);
$acl->add('Export', '*', Role::PROJECT_MANAGER);
- $acl->add('File', array('screenshot', 'create', 'save', 'remove', 'confirm'), Role::PROJECT_MEMBER);
+ $acl->add('TaskFile', array('screenshot', 'create', 'save', 'remove', 'confirm'), Role::PROJECT_MEMBER);
$acl->add('Gantt', '*', Role::PROJECT_MANAGER);
$acl->add('Project', array('share', 'integrations', 'notifications', 'duplicate', 'disable', 'enable', 'remove'), Role::PROJECT_MANAGER);
$acl->add('ProjectPermission', '*', Role::PROJECT_MANAGER);
diff --git a/app/ServiceProvider/RouteProvider.php b/app/ServiceProvider/RouteProvider.php
index 5003eb88..c723140e 100644
--- a/app/ServiceProvider/RouteProvider.php
+++ b/app/ServiceProvider/RouteProvider.php
@@ -94,8 +94,6 @@ class RouteProvider implements ServiceProviderInterface
$container['route']->addRoute('public/task/:task_id/:token', 'task', 'readonly');
$container['route']->addRoute('project/:project_id/task/:task_id/activity', 'activity', 'task');
- $container['route']->addRoute('project/:project_id/task/:task_id/screenshot', 'file', 'screenshot');
- $container['route']->addRoute('project/:project_id/task/:task_id/upload', 'file', 'create');
$container['route']->addRoute('project/:project_id/task/:task_id/transitions', 'task', 'transitions');
$container['route']->addRoute('project/:project_id/task/:task_id/analytics', 'task', 'analytics');
$container['route']->addRoute('project/:project_id/task/:task_id/subtasks', 'subtask', 'show');
diff --git a/app/Template/board/tooltip_files.php b/app/Template/board/tooltip_files.php
index 407309b3..4fa14b57 100644
--- a/app/Template/board/tooltip_files.php
+++ b/app/Template/board/tooltip_files.php
@@ -8,9 +8,9 @@
</tr>
<tr>
<td>
- <i class="fa fa-download fa-fw"></i><?= $this->url->link(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
+ <i class="fa fa-download fa-fw"></i><?= $this->url->link(t('download'), 'TaskFile', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
<?php if ($file['is_image'] == 1): ?>
- &nbsp;<i class="fa fa-eye"></i> <?= $this->url->link(t('open file'), 'file', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?>
+ &nbsp;<i class="fa fa-eye"></i> <?= $this->url->link(t('open file'), 'TaskFile', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?>
<?php endif ?>
</td>
</tr>
diff --git a/app/Template/file/open.php b/app/Template/file/open.php
deleted file mode 100644
index 3df012b6..00000000
--- a/app/Template/file/open.php
+++ /dev/null
@@ -1,6 +0,0 @@
-<div class="page-header">
- <h2><?= $this->e($file['name']) ?></h2>
- <div class="task-file-viewer">
- <img src="<?= $this->url->href('file', 'image', array('file_id' => $file['id'], 'project_id' => $task['project_id'], 'task_id' => $file['task_id'])) ?>" alt="<?= $this->e($file['name']) ?>"/>
- </div>
-</div> \ No newline at end of file
diff --git a/app/Template/task/menu.php b/app/Template/task/menu.php
index e997a6ad..cddd930a 100644
--- a/app/Template/task/menu.php
+++ b/app/Template/task/menu.php
@@ -38,11 +38,11 @@
</li>
<li>
<i class="fa fa-file fa-fw"></i>
- <?= $this->url->link(t('Attach a document'), 'file', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
+ <?= $this->url->link(t('Attach a document'), 'TaskFile', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
</li>
<li>
<i class="fa fa-camera fa-fw"></i>
- <?= $this->url->link(t('Add a screenshot'), 'file', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
+ <?= $this->url->link(t('Add a screenshot'), 'TaskFile', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
</li>
<li>
<i class="fa fa-files-o fa-fw"></i>
diff --git a/app/Template/task/show.php b/app/Template/task/show.php
index 43906a81..a32232ae 100644
--- a/app/Template/task/show.php
+++ b/app/Template/task/show.php
@@ -25,7 +25,7 @@
<?= $this->render('task/time_tracking_summary', array('task' => $task)) ?>
-<?= $this->render('file/show', array(
+<?= $this->render('task_file/show', array(
'task' => $task,
'files' => $files,
'images' => $images
diff --git a/app/Template/file/new.php b/app/Template/task_file/new.php
index e84ef839..f03ce8dc 100644
--- a/app/Template/file/new.php
+++ b/app/Template/task_file/new.php
@@ -18,7 +18,7 @@
<div
id="file-dropzone"
data-max-size="<?= $max_size ?>"
- data-url="<?= $this->url->href('file', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>">
+ data-url="<?= $this->url->href('TaskFile', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>">
<div id="file-dropzone-inner">
<?= t('Drag and drop your files here') ?> <?= t('or') ?> <a href="#" id="file-browser"><?= t('choose files') ?></a>
</div>
diff --git a/app/Template/task_file/open.php b/app/Template/task_file/open.php
new file mode 100644
index 00000000..e3721b59
--- /dev/null
+++ b/app/Template/task_file/open.php
@@ -0,0 +1,6 @@
+<div class="page-header">
+ <h2><?= $this->e($file['name']) ?></h2>
+ <div class="task-file-viewer">
+ <img src="<?= $this->url->href('TaskFile', 'image', array('file_id' => $file['id'], 'project_id' => $task['project_id'], 'task_id' => $file['task_id'])) ?>" alt="<?= $this->e($file['name']) ?>"/>
+ </div>
+</div> \ No newline at end of file
diff --git a/app/Template/file/remove.php b/app/Template/task_file/remove.php
index 24844835..5e6c83f2 100644
--- a/app/Template/file/remove.php
+++ b/app/Template/task_file/remove.php
@@ -8,7 +8,7 @@
</p>
<div class="form-actions">
- <?= $this->url->link(t('Yes'), 'file', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), true, 'btn btn-red') ?>
+ <?= $this->url->link(t('Yes'), 'TaskFile', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), true, 'btn btn-red') ?>
<?= t('or') ?>
<?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?>
</div>
diff --git a/app/Template/file/screenshot.php b/app/Template/task_file/screenshot.php
index 58b93ac3..72214362 100644
--- a/app/Template/file/screenshot.php
+++ b/app/Template/task_file/screenshot.php
@@ -6,7 +6,7 @@
<p id="screenshot-inner"><?= t('Take a screenshot and press CTRL+V or ⌘+V to paste here.') ?></p>
</div>
-<form class="popover-form" action="<?= $this->url->href('file', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" method="post">
+<form class="popover-form" action="<?= $this->url->href('TaskFile', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" method="post">
<input type="hidden" name="screenshot"/>
<?= $this->form->csrf() ?>
<div class="form-actions">
diff --git a/app/Template/file/show.php b/app/Template/task_file/show.php
index ed006299..98f26c33 100644
--- a/app/Template/file/show.php
+++ b/app/Template/task_file/show.php
@@ -8,21 +8,21 @@
<div class="file-thumbnails">
<?php foreach ($images as $file): ?>
<div class="file-thumbnail">
- <a href="<?= $this->url->href('file', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>" class="popover"><img src="<?= $this->url->href('file', 'thumbnail', array('file_id' => $file['id'], 'project_id' => $task['project_id'], 'task_id' => $file['task_id'])) ?>" title="<?= $this->e($file['name']) ?>" alt="<?= $this->e($file['name']) ?>"></a>
+ <a href="<?= $this->url->href('TaskFile', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>" class="popover"><img src="<?= $this->url->href('TaskFile', 'thumbnail', array('file_id' => $file['id'], 'project_id' => $task['project_id'], 'task_id' => $file['task_id'])) ?>" title="<?= $this->e($file['name']) ?>" alt="<?= $this->e($file['name']) ?>"></a>
<div class="file-thumbnail-content">
<div class="file-thumbnail-title">
<div class="dropdown">
<a href="#" class="dropdown-menu dropdown-menu-link-text"><?= $this->e($file['name']) ?> <i class="fa fa-caret-down"></i></a>
<ul>
- <?php if ($this->user->hasProjectAccess('file', 'remove', $task['project_id'])): ?>
+ <?php if ($this->user->hasProjectAccess('TaskFile', 'remove', $task['project_id'])): ?>
<li>
<i class="fa fa-trash fa-fw"></i>
- <?= $this->url->link(t('Remove'), 'file', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?>
+ <?= $this->url->link(t('Remove'), 'TaskFile', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?>
</li>
<?php endif ?>
<li>
<i class="fa fa-download fa-fw"></i>
- <?= $this->url->link(t('Download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
+ <?= $this->url->link(t('Download'), 'TaskFile', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
</li>
</ul>
</div>
@@ -54,15 +54,15 @@
<div class="dropdown">
<a href="#" class="dropdown-menu dropdown-menu-link-text"><?= $this->e($file['name']) ?> <i class="fa fa-caret-down"></i></a>
<ul>
- <?php if ($this->user->hasProjectAccess('file', 'remove', $task['project_id'])): ?>
+ <?php if ($this->user->hasProjectAccess('TaskFile', 'remove', $task['project_id'])): ?>
<li>
<i class="fa fa-trash fa-fw"></i>
- <?= $this->url->link(t('Remove'), 'file', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?>
+ <?= $this->url->link(t('Remove'), 'TaskFile', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?>
</li>
<?php endif ?>
<li>
<i class="fa fa-download fa-fw"></i>
- <?= $this->url->link(t('Download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
+ <?= $this->url->link(t('Download'), 'TaskFile', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
</li>
</ul>
</div>