diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/Helper/User.php | 18 | ||||
-rw-r--r-- | app/Template/board/task_private.php | 5 |
2 files changed, 23 insertions, 0 deletions
diff --git a/app/Helper/User.php b/app/Helper/User.php index 1cad6042..c1fff8c6 100644 --- a/app/Helper/User.php +++ b/app/Helper/User.php @@ -11,6 +11,24 @@ namespace Helper; class User extends \Core\Base { /** + * Get initials from a user + * + * @access public + * @param string $name + * @return string + */ + public function getInitials($name) + { + $initials = ''; + + foreach (explode(' ', $name) as $string) { + $initials .= mb_substr($string, 0, 1); + } + + return mb_strtoupper($initials); + } + + /** * Get user id * * @access public diff --git a/app/Template/board/task_private.php b/app/Template/board/task_private.php index 3cd471d7..48e931c9 100644 --- a/app/Template/board/task_private.php +++ b/app/Template/board/task_private.php @@ -11,6 +11,11 @@ <?= $this->render('board/task_menu', array('task' => $task)) ?> <div class="task-board-collapsed" style="display: none"> + <?php if (! empty($task['assignee_username'])): ?> + <span title="<?= $this->e($task['assignee_name'] ?: $task['assignee_username']) ?>"> + <?= $this->e($this->user->getInitials($task['assignee_name'] ?: $task['assignee_username'])) ?> + </span> - + <?php endif ?> <?= $this->url->link($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-collapsed-title') ?> </div> |