diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/Controller/BoardTooltip.php | 2 | ||||
-rw-r--r-- | app/Helper/Task.php | 17 | ||||
-rw-r--r-- | app/Model/TaskLink.php | 1 | ||||
-rw-r--r-- | app/Template/board/tooltip_tasklinks.php | 37 |
4 files changed, 40 insertions, 17 deletions
diff --git a/app/Controller/BoardTooltip.php b/app/Controller/BoardTooltip.php index ed58a2f2..bcf7de81 100644 --- a/app/Controller/BoardTooltip.php +++ b/app/Controller/BoardTooltip.php @@ -19,7 +19,7 @@ class BoardTooltip extends Base { $task = $this->getTask(); $this->response->html($this->template->render('board/tooltip_tasklinks', array( - 'links' => $this->taskLink->getAll($task['id']), + 'links' => $this->taskLink->getAllGroupedByLabel($task['id']), 'task' => $task, ))); } diff --git a/app/Helper/Task.php b/app/Helper/Task.php index 500b8a89..d2c59ee9 100644 --- a/app/Helper/Task.php +++ b/app/Helper/Task.php @@ -12,6 +12,14 @@ use Kanboard\Core\Base; */ class Task extends Base { + /** + * Local cache for project columns + * + * @access private + * @var array + */ + private $columns = array(); + public function getColors() { return $this->color->getList(); @@ -65,4 +73,13 @@ class Task extends Base return $html; } + + public function getProgress($task) + { + if (! isset($this->columns[$task['project_id']])) { + $this->columns[$task['project_id']] = $this->board->getColumnsList($task['project_id']); + } + + return $this->task->getProgress($task, $this->columns[$task['project_id']]); + } } diff --git a/app/Model/TaskLink.php b/app/Model/TaskLink.php index 87aae55e..034fcf45 100644 --- a/app/Model/TaskLink.php +++ b/app/Model/TaskLink.php @@ -75,6 +75,7 @@ class TaskLink extends Base Task::TABLE.'.title', Task::TABLE.'.is_active', Task::TABLE.'.project_id', + Task::TABLE.'.column_id', Task::TABLE.'.time_spent AS task_time_spent', Task::TABLE.'.time_estimated AS task_time_estimated', Task::TABLE.'.owner_id AS task_assignee_id', diff --git a/app/Template/board/tooltip_tasklinks.php b/app/Template/board/tooltip_tasklinks.php index 62304330..b51f90ed 100644 --- a/app/Template/board/tooltip_tasklinks.php +++ b/app/Template/board/tooltip_tasklinks.php @@ -1,19 +1,24 @@ <div class="tooltip-tasklinks"> - <ul> - <?php foreach ($links as $link): ?> - <li> - <strong><?= t($link['label']) ?></strong> - [<i><?= $link['project_name'] ?></i>] - <?= $this->url->link( - $this->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 if (! empty($link['task_assignee_username'])): ?> - [<?= $this->e($link['task_assignee_name'] ?: $link['task_assignee_username']) ?>] - <?php endif ?> - </li> + <dl> + <?php foreach ($links as $label => $grouped_links): ?> + <dt><strong><?= t($label) ?></strong></dt> + <?php foreach ($grouped_links as $link): ?> + <dd> + <span class="progress"><?= $this->task->getProgress($link).'%' ?></span> + <?= $this->url->link( + $this->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 if (! empty($link['task_assignee_username'])): ?> + [<?= $this->e($link['task_assignee_name'] ?: $link['task_assignee_username']) ?>] + <?php endif ?> + <?php if ($task['project_id'] != $link['project_id']): ?> + (<i><?= $link['project_name'] ?></i>) + <?php endif ?> + </dd> + <?php endforeach ?> <?php endforeach ?> - </ul> + </dl> </div>
\ No newline at end of file |