summaryrefslogtreecommitdiff
path: root/app/Template/tasklink/table.php
diff options
context:
space:
mode:
authorOlivier Maridat <olivier.maridat@trialog.com>2016-03-08 11:12:18 +0100
committerOlivier Maridat <olivier.maridat@trialog.com>2016-03-09 11:10:35 +0100
commit7b20a14e8df545080fd5f1e98d31a763a51af517 (patch)
tree9fd61d01ba198ccab7e571c306128905f50af449 /app/Template/tasklink/table.php
parent7026e8d622e3f2a08e20c49814fc18a33453932c (diff)
Enhance task link view to mimic the subtask view
Diffstat (limited to 'app/Template/tasklink/table.php')
-rw-r--r--app/Template/tasklink/table.php86
1 files changed, 86 insertions, 0 deletions
diff --git a/app/Template/tasklink/table.php b/app/Template/tasklink/table.php
new file mode 100644
index 00000000..3378f60f
--- /dev/null
+++ b/app/Template/tasklink/table.php
@@ -0,0 +1,86 @@
+<?php if (empty($links)): ?>
+ <p class="alert"><?= t('There is no internal link for the moment.') ?></p>
+<?php else: ?>
+<table class="tasklinks-table table-stripped">
+ <?php foreach ($links as $label => $grouped_links): ?>
+ <?php $hide_td = false ?>
+ <?php foreach ($grouped_links as $link): ?>
+ <?php if (! $hide_td): ?>
+ <tr>
+ <td class="column-40" colspan="2">
+ <?= t('This task') ?>
+ <strong><?= t($label) ?></strong>
+ <span class="board-column-header-task-count">(<?= count($grouped_links) ?>)</span>
+ </td>
+ <th><?= t('Assignee') ?></th>
+ <th><?= t('Time tracking') ?></th>
+ <?php if ($editable): ?>
+ <th class="column-5"></th>
+ <?php endif ?>
+ </tr>
+ <?php $hide_td = true ?>
+ <?php endif ?>
+
+ <tr>
+ <td>
+ <?php if ($is_public): ?>
+ <?= $this->url->link(
+ $this->text->e('#'.$link['task_id'].' '.$link['title']),
+ 'task',
+ 'readonly',
+ array('task_id' => $link['task_id'], 'token' => $project['token']),
+ false,
+ $link['is_active'] ? '' : 'task-link-closed'
+ ) ?>
+ <?php else: ?>
+ <?= $this->url->link(
+ $this->text->e('#'.$link['task_id'].' '.$link['title']),
+ 'task',
+ 'show',
+ array('task_id' => $link['task_id'], 'project_id' => $link['project_id']),
+ false,
+ $link['is_active'] ? '' : 'task-link-closed'
+ ) ?>
+ <?php endif ?>
+
+ <?php if ($link['project_id'] != $project['id']): ?>
+ <br>
+ <?= t('Project') ?>
+ <?= $this->text->e($link['project_name']) ?>
+ <?php endif ?>
+ </td>
+ <td><?= $this->text->e($link['column_title']) ?></td>
+ <td>
+ <?php if (! empty($link['task_assignee_username'])): ?>
+ <?php if ($editable): ?>
+ <?= $this->url->link($this->text->e($link['task_assignee_name'] ?: $link['task_assignee_username']), 'user', 'show', array('user_id' => $link['task_assignee_id'])) ?>
+ <?php else: ?>
+ <?= $this->text->e($link['task_assignee_name'] ?: $link['task_assignee_username']) ?>
+ <?php endif ?>
+ <?php endif ?>
+ </td>
+ <td>
+ <?php if (! empty($link['task_time_spent'])): ?>
+ <strong><?= $this->text->e($link['task_time_spent']).'h' ?></strong> <?= t('spent') ?>
+ <?php endif ?>
+
+ <?php if (! empty($link['task_time_estimated'])): ?>
+ <strong><?= $this->text->e($link['task_time_estimated']).'h' ?></strong> <?= t('estimated') ?>
+ <?php endif ?>
+ </td>
+ <?php if ($editable && $this->user->hasProjectAccess('Tasklink', 'edit', $task['project_id'])): ?>
+ <td>
+ <div class="dropdown">
+ <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a>
+ <ul>
+ <li><?= $this->url->link(t('Edit'), 'tasklink', 'edit', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id'])) ?></li>
+ <li><?= $this->url->link(t('Remove'), 'tasklink', 'confirm', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id'])) ?></li>
+ </ul>
+ </div>
+ </td>
+ <?php endif ?>
+ </tr>
+ <?php endforeach ?>
+ <?php endforeach ?>
+</table>
+<?php endif ?> \ No newline at end of file