From c231b65cfc54aad8b143a76e19c6aea428f42a5c Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 4 Jul 2015 20:12:17 -0400 Subject: Display user initials when tasks are in collapsed mode --- app/Helper/User.php | 18 ++++++++++++++++++ app/Template/board/task_private.php | 5 +++++ 2 files changed, 23 insertions(+) (limited to 'app') 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 @@ -10,6 +10,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 * 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 @@ render('board/task_menu', array('task' => $task)) ?> -- cgit v1.2.3