summaryrefslogtreecommitdiff
path: root/app/Templates
diff options
context:
space:
mode:
Diffstat (limited to 'app/Templates')
-rw-r--r--app/Templates/board_show.php6
-rw-r--r--app/Templates/task_close.php4
-rw-r--r--app/Templates/task_layout.php3
-rw-r--r--app/Templates/task_open.php24
-rw-r--r--app/Templates/task_open_file.php6
-rw-r--r--app/Templates/task_remove.php4
-rw-r--r--app/Templates/task_remove_file.php14
-rw-r--r--app/Templates/task_show.php17
-rw-r--r--app/Templates/task_sidebar.php4
-rw-r--r--app/Templates/task_upload.php10
10 files changed, 76 insertions, 16 deletions
diff --git a/app/Templates/board_show.php b/app/Templates/board_show.php
index 719e3bdd..78f9dd50 100644
--- a/app/Templates/board_show.php
+++ b/app/Templates/board_show.php
@@ -59,7 +59,7 @@
</div>
<?php endif ?>
- <?php if (! empty($task['date_due']) || ! empty($task['nb_comments']) || ! empty($task['description'])): ?>
+ <?php if (! empty($task['date_due']) || ! empty($task['nb_files']) || ! empty($task['nb_comments']) || ! empty($task['description'])): ?>
<div class="task-footer">
<?php if (! empty($task['date_due'])): ?>
@@ -69,6 +69,10 @@
<?php endif ?>
<div class="task-icons">
+ <?php if (! empty($task['nb_files'])): ?>
+ <?= $task['nb_files'] ?> <i class="fa fa-paperclip"></i>
+ <?php endif ?>
+
<?php if (! empty($task['nb_comments'])): ?>
<?= $task['nb_comments'] ?> <i class="fa fa-comment-o" title="<?= p($task['nb_comments'], t('%d comment', $task['nb_comments']), t('%d comments', $task['nb_comments'])) ?>"></i>
<?php endif ?>
diff --git a/app/Templates/task_close.php b/app/Templates/task_close.php
index 3531b37d..6843c2f6 100644
--- a/app/Templates/task_close.php
+++ b/app/Templates/task_close.php
@@ -1,3 +1,7 @@
+<div class="page-header">
+ <h2><?= t('Close a task') ?></h2>
+</div>
+
<div class="confirm">
<p class="alert alert-info">
<?= t('Do you really want to close this task: "%s"?', Helper\escape($task['title'])) ?>
diff --git a/app/Templates/task_layout.php b/app/Templates/task_layout.php
index 9a6bbd00..ce5f36c5 100644
--- a/app/Templates/task_layout.php
+++ b/app/Templates/task_layout.php
@@ -13,4 +13,5 @@
<?= $task_content_for_layout ?>
</div>
</section>
-</section> \ No newline at end of file
+</section>
+<script type="text/javascript" src="assets/js/task.js"></script> \ No newline at end of file
diff --git a/app/Templates/task_open.php b/app/Templates/task_open.php
index 54cc11f0..59ea0b54 100644
--- a/app/Templates/task_open.php
+++ b/app/Templates/task_open.php
@@ -1,16 +1,14 @@
-<section id="main">
- <div class="page-header">
- <h2><?= t('Open a task') ?></h2>
- </div>
+<div class="page-header">
+ <h2><?= t('Open a task') ?></h2>
+</div>
- <div class="confirm">
- <p class="alert alert-info">
- <?= t('Do you really want to open this task: "%s"?', Helper\escape($task['title'])) ?>
- </p>
+<div class="confirm">
+ <p class="alert alert-info">
+ <?= t('Do you really want to open this task: "%s"?', Helper\escape($task['title'])) ?>
+ </p>
- <div class="form-actions">
- <a href="?controller=task&amp;action=open&amp;task_id=<?= $task['id'] ?>" class="btn btn-red"><?= t('Yes') ?></a>
- <?= t('or') ?> <a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a>
- </div>
+ <div class="form-actions">
+ <a href="?controller=task&amp;action=open&amp;task_id=<?= $task['id'] ?>" class="btn btn-red"><?= t('Yes') ?></a>
+ <?= t('or') ?> <a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a>
</div>
-</section> \ No newline at end of file
+</div> \ No newline at end of file
diff --git a/app/Templates/task_open_file.php b/app/Templates/task_open_file.php
new file mode 100644
index 00000000..e0817f01
--- /dev/null
+++ b/app/Templates/task_open_file.php
@@ -0,0 +1,6 @@
+<div class="page-header">
+ <h2><?= Helper\escape($file['name']) ?></h2>
+ <div class="task-file-viewer">
+ <img src="?controller=task&amp;action=image&amp;file_id=<?= $file['id'] ?>&amp;task_id=<?= $file['task_id'] ?>" alt="<?= Helper\escape($file['name']) ?>"/>
+ </div>
+</div> \ No newline at end of file
diff --git a/app/Templates/task_remove.php b/app/Templates/task_remove.php
index 1aa9503b..60e4e8e7 100644
--- a/app/Templates/task_remove.php
+++ b/app/Templates/task_remove.php
@@ -1,3 +1,7 @@
+<div class="page-header">
+ <h2><?= t('Remove a task') ?></h2>
+</div>
+
<div class="confirm">
<p class="alert alert-info">
<?= t('Do you really want to remove this task: "%s"?', Helper\escape($task['title'])) ?>
diff --git a/app/Templates/task_remove_file.php b/app/Templates/task_remove_file.php
new file mode 100644
index 00000000..9687b602
--- /dev/null
+++ b/app/Templates/task_remove_file.php
@@ -0,0 +1,14 @@
+<div class="page-header">
+ <h2><?= t('Remove a file') ?></h2>
+</div>
+
+<div class="confirm">
+ <p class="alert alert-info">
+ <?= t('Do you really want to remove this file: "%s"?', Helper\escape($file['name'])) ?>
+ </p>
+
+ <div class="form-actions">
+ <a href="?controller=task&amp;action=removeFile&amp;task_id=<?= $task['id'] ?>&amp;file_id=<?= $file['id'] ?>" class="btn btn-red"><?= t('Yes') ?></a>
+ <?= t('or') ?> <a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a>
+ </div>
+</div> \ No newline at end of file
diff --git a/app/Templates/task_show.php b/app/Templates/task_show.php
index a5b79359..56f6cba5 100644
--- a/app/Templates/task_show.php
+++ b/app/Templates/task_show.php
@@ -64,6 +64,23 @@
</form>
<?php endif ?>
+<?php if (! empty($files)): ?>
+ <h2 id="attachments"><?= t('Attachments') ?></h2>
+ <ul class="task-show-files">
+ <?php foreach ($files as $file): ?>
+ <li>
+ <a href="?controller=task&amp;action=download&amp;file_id=<?= $file['id'] ?>&amp;task_id=<?= $task['id'] ?>"><?= Helper\escape($file['name']) ?></a>
+ <span class="task-show-file-actions">
+ <?php if ($file['is_image']): ?>
+ <a href="?controller=task&amp;action=openFile&amp;file_id=<?= $file['id'] ?>&amp;task_id=<?= $task['id'] ?>" class="popover"><?= t('open') ?></a>,
+ <?php endif ?>
+ <a href="?controller=task&amp;action=confirmRemoveFile&amp;file_id=<?= $file['id'] ?>&amp;task_id=<?= $task['id'] ?>"><?= t('remove') ?></a>
+ </span>
+ </li>
+ <?php endforeach ?>
+ </ul>
+<?php endif ?>
+
<h2><?= t('Comments') ?></h2>
<?php if ($comments): ?>
<ul id="comments">
diff --git a/app/Templates/task_sidebar.php b/app/Templates/task_sidebar.php
index 314d5214..9dbc1a8c 100644
--- a/app/Templates/task_sidebar.php
+++ b/app/Templates/task_sidebar.php
@@ -2,8 +2,10 @@
<h2><?= t('Actions') ?></h2>
<div class="task-show-actions">
<ul>
- <li><a href="?controller=task&amp;action=duplicate&amp;project_id=<?= $task['project_id'] ?>&amp;task_id=<?= $task['id'] ?>"><?= t('Duplicate') ?></a></li>
+ <li><a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>"><?= t('Description') ?></a></li>
<li><a href="?controller=task&amp;action=edit&amp;task_id=<?= $task['id'] ?>"><?= t('Edit') ?></a></li>
+ <li><a href="?controller=task&amp;action=file&amp;task_id=<?= $task['id'] ?>"><?= t('Attach a document') ?></a></li>
+ <li><a href="?controller=task&amp;action=duplicate&amp;project_id=<?= $task['project_id'] ?>&amp;task_id=<?= $task['id'] ?>"><?= t('Duplicate') ?></a></li>
<li>
<?php if ($task['is_active'] == 1): ?>
<a href="?controller=task&amp;action=confirmClose&amp;task_id=<?= $task['id'] ?>"><?= t('Close this task') ?></a>
diff --git a/app/Templates/task_upload.php b/app/Templates/task_upload.php
new file mode 100644
index 00000000..7100ab31
--- /dev/null
+++ b/app/Templates/task_upload.php
@@ -0,0 +1,10 @@
+<div class="page-header">
+ <h2><?= t('Attach a document') ?></h2>
+</div>
+
+<form action="?controller=task&amp;action=upload&amp;task_id=<?= $task['id'] ?>" method="post" enctype="multipart/form-data">
+ <input type="file" name="files[]" multiple />
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
+ </div>
+</form> \ No newline at end of file