From 7c52546ed2b5ed724d19af95fe97726ab6156291 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Thu, 12 Oct 2017 15:25:13 -0700 Subject: Generate a link if the reference is a URL --- app/Helper/TaskHelper.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'app/Helper') diff --git a/app/Helper/TaskHelper.php b/app/Helper/TaskHelper.php index 3b9e9745..065ece10 100644 --- a/app/Helper/TaskHelper.php +++ b/app/Helper/TaskHelper.php @@ -220,6 +220,21 @@ class TaskHelper extends Base return $html; } + public function renderReference(array $task) + { + if (! empty($task['reference'])) { + $reference = $this->helper->text->e($task['reference']); + + if (filter_var($task['reference'], FILTER_VALIDATE_URL) !== false) { + return sprintf('%s', $reference, $reference); + } + + return $reference; + } + + return ''; + } + public function getProgress($task) { if (! isset($this->columns[$task['project_id']])) { -- cgit v1.2.3