diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-10-16 19:09:25 -0700 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-10-16 19:09:25 -0700 |
commit | 41c2ab0c2451ea00d1236bc31f13ee7c2da97c3a (patch) | |
tree | fa1dda191117d08b4196138248eb5ed97cbdc14b /app/Helper | |
parent | 914b40b4afcfd309eed4044ea93a52ba636e90e7 (diff) |
Add tooltip to subtask icons
Diffstat (limited to 'app/Helper')
-rw-r--r-- | app/Helper/SubtaskHelper.php | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/app/Helper/SubtaskHelper.php b/app/Helper/SubtaskHelper.php index 3a853238..b11e3b04 100644 --- a/app/Helper/SubtaskHelper.php +++ b/app/Helper/SubtaskHelper.php @@ -3,6 +3,7 @@ namespace Kanboard\Helper; use Kanboard\Core\Base; +use Kanboard\Model\SubtaskModel; /** * Subtask helpers @@ -66,9 +67,9 @@ class SubtaskHelper extends Base ); if ($subtask['status'] == 0 && $this->hasSubtaskInProgress()) { - $html = $this->helper->url->link($title, 'SubtaskRestrictionController', 'show', $params, false, 'js-modal-confirm'); + $html = $this->helper->url->link($title, 'SubtaskRestrictionController', 'show', $params, false, 'js-modal-confirm', $this->getSubtaskTooltip($subtask)); } else { - $html = $this->helper->url->link($title, 'SubtaskStatusController', 'change', $params, false, 'js-subtask-toggle-status'); + $html = $this->helper->url->link($title, 'SubtaskStatusController', 'change', $params, false, 'js-subtask-toggle-status', $this->getSubtaskTooltip($subtask)); } } @@ -136,4 +137,18 @@ class SubtaskHelper extends Base return $html; } + + public function getSubtaskTooltip(array $subtask) + { + switch ($subtask['status']) { + case SubtaskModel::STATUS_TODO: + return t('Subtask not started'); + case SubtaskModel::STATUS_INPROGRESS: + return t('Subtask currently in progress'); + case SubtaskModel::STATUS_DONE: + return t('Subtask completed'); + } + + return ''; + } } |