summaryrefslogtreecommitdiff
path: root/app/Controller/ExternalTaskViewController.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Controller/ExternalTaskViewController.php')
-rw-r--r--app/Controller/ExternalTaskViewController.php30
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..4ffc4763
--- /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->retrieve($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>');
+ }
+ }
+}