Add files upload
This commit is contained in:
@@ -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 ?>
|
||||
|
||||
@@ -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'])) ?>
|
||||
|
||||
@@ -13,4 +13,5 @@
|
||||
<?= $task_content_for_layout ?>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
<script type="text/javascript" src="assets/js/task.js"></script>
|
||||
@@ -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&action=open&task_id=<?= $task['id'] ?>" class="btn btn-red"><?= t('Yes') ?></a>
|
||||
<?= t('or') ?> <a href="?controller=task&action=show&task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<a href="?controller=task&action=open&task_id=<?= $task['id'] ?>" class="btn btn-red"><?= t('Yes') ?></a>
|
||||
<?= t('or') ?> <a href="?controller=task&action=show&task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
6
app/Templates/task_open_file.php
Normal file
6
app/Templates/task_open_file.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<div class="page-header">
|
||||
<h2><?= Helper\escape($file['name']) ?></h2>
|
||||
<div class="task-file-viewer">
|
||||
<img src="?controller=task&action=image&file_id=<?= $file['id'] ?>&task_id=<?= $file['task_id'] ?>" alt="<?= Helper\escape($file['name']) ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -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'])) ?>
|
||||
|
||||
14
app/Templates/task_remove_file.php
Normal file
14
app/Templates/task_remove_file.php
Normal file
@@ -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&action=removeFile&task_id=<?= $task['id'] ?>&file_id=<?= $file['id'] ?>" class="btn btn-red"><?= t('Yes') ?></a>
|
||||
<?= t('or') ?> <a href="?controller=task&action=show&task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -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&action=download&file_id=<?= $file['id'] ?>&task_id=<?= $task['id'] ?>"><?= Helper\escape($file['name']) ?></a>
|
||||
<span class="task-show-file-actions">
|
||||
<?php if ($file['is_image']): ?>
|
||||
<a href="?controller=task&action=openFile&file_id=<?= $file['id'] ?>&task_id=<?= $task['id'] ?>" class="popover"><?= t('open') ?></a>,
|
||||
<?php endif ?>
|
||||
<a href="?controller=task&action=confirmRemoveFile&file_id=<?= $file['id'] ?>&task_id=<?= $task['id'] ?>"><?= t('remove') ?></a>
|
||||
</span>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
|
||||
<h2><?= t('Comments') ?></h2>
|
||||
<?php if ($comments): ?>
|
||||
<ul id="comments">
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
<h2><?= t('Actions') ?></h2>
|
||||
<div class="task-show-actions">
|
||||
<ul>
|
||||
<li><a href="?controller=task&action=duplicate&project_id=<?= $task['project_id'] ?>&task_id=<?= $task['id'] ?>"><?= t('Duplicate') ?></a></li>
|
||||
<li><a href="?controller=task&action=show&task_id=<?= $task['id'] ?>"><?= t('Description') ?></a></li>
|
||||
<li><a href="?controller=task&action=edit&task_id=<?= $task['id'] ?>"><?= t('Edit') ?></a></li>
|
||||
<li><a href="?controller=task&action=file&task_id=<?= $task['id'] ?>"><?= t('Attach a document') ?></a></li>
|
||||
<li><a href="?controller=task&action=duplicate&project_id=<?= $task['project_id'] ?>&task_id=<?= $task['id'] ?>"><?= t('Duplicate') ?></a></li>
|
||||
<li>
|
||||
<?php if ($task['is_active'] == 1): ?>
|
||||
<a href="?controller=task&action=confirmClose&task_id=<?= $task['id'] ?>"><?= t('Close this task') ?></a>
|
||||
|
||||
10
app/Templates/task_upload.php
Normal file
10
app/Templates/task_upload.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<div class="page-header">
|
||||
<h2><?= t('Attach a document') ?></h2>
|
||||
</div>
|
||||
|
||||
<form action="?controller=task&action=upload&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>
|
||||
Reference in New Issue
Block a user