Add task links (Merge pull-request #610)

This commit is contained in:
Frederic Guillot
2015-02-13 17:50:20 -05:00
parent 124f7cad28
commit 364382b1b5
38 changed files with 1769 additions and 41 deletions

View File

@@ -100,7 +100,7 @@
<?php endif ?>
<?php if (! empty($task['date_due']) || ! empty($task['nb_files']) || ! empty($task['nb_comments']) || ! empty($task['description']) || ! empty($task['nb_subtasks'])): ?>
<?php if (! empty($task['date_due']) || ! empty($task['nb_files']) || ! empty($task['nb_comments']) || ! empty($task['description']) || ! empty($task['nb_subtasks']) || ! empty($task['nb_links'])): ?>
<div class="task-board-footer">
<?php if (! empty($task['date_due'])): ?>
@@ -110,7 +110,10 @@
<?php endif ?>
<div class="task-board-icons">
<?php if (! empty($task['nb_links'])): ?>
<span title="<?= t('Links') ?>" class="task-board-tooltip" data-href="<?= $this->u('board', 'tasklinks', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"><?= $task['nb_links'] ?> <i class="fa fa-code-fork"></i></span>
<?php endif ?>
<?php if (! empty($task['nb_subtasks'])): ?>
<span title="<?= t('Sub-Tasks') ?>" class="task-board-tooltip" data-href="<?= $this->u('board', 'subtasks', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"><?= round($task['nb_completed_subtasks']/$task['nb_subtasks']*100, 0).'%' ?> <i class="fa fa-bars"></i></span>
<?php endif ?>
@@ -132,4 +135,4 @@
</div>
<?php endif ?>
</div>
</div>

View File

@@ -0,0 +1,28 @@
<section class="tooltip-tasklinks">
<div>
<ul>
<?php
$previous_link = null;
foreach ($links as $link): ?>
<?php if (null == $previous_link || $previous_link != $link['label']): ?>
<?php if (null != $previous_link): ?>
</ul>
</li>
<?php endif ?>
<?php $previous_link = $link['label']; ?>
<li><?= t($this->e($link['label'])) ?>
<ul>
<?php endif ?>
<li<?php if (0 == $link['task_inverse_is_active']): ?> class="task-closed"<?php endif ?>>
<?= $this->e($link['task_inverse_category']) ?>
<?= $this->a('#'.$this->e($link['task_inverse_id']).' - '.trim($this->e($link['task_inverse_title'])),
'task',
'show',
array('task_id' => $link['task_inverse_id'], 'project_id' => $link['task_inverse_project_id'])) ?>
</li>
<?php endforeach ?>
</ul>
</li>
</ul>
</div>
</section>