diff options
Diffstat (limited to 'app/Controller/ExternalTaskViewController.php')
-rw-r--r-- | app/Controller/ExternalTaskViewController.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/app/Controller/ExternalTaskViewController.php b/app/Controller/ExternalTaskViewController.php new file mode 100644 index 00000000..18bc15c1 --- /dev/null +++ b/app/Controller/ExternalTaskViewController.php @@ -0,0 +1,30 @@ +<?php + +namespace Kanboard\Controller; + +use Kanboard\Core\ExternalTask\ExternalTaskException; + +/** + * Class ExternalTaskViewController + * + * @package Kanboard\Controller + * @author Frederic Guillot + */ +class ExternalTaskViewController extends BaseController +{ + public function show() + { + try { + $task = $this->getTask(); + $taskProvider = $this->externalTaskManager->getProvider($task['external_provider']); + $externalTask = $taskProvider->fetch($task['external_uri']); + + $this->response->html($this->template->render($taskProvider->getViewTemplate(), array( + 'task' => $task, + 'external_task' => $externalTask, + ))); + } catch (ExternalTaskException $e) { + $this->response->html('<div class="alert alert-error">'.$e->getMessage().'</div>'); + } + } +} |