summaryrefslogtreecommitdiff
path: root/app/Controller
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-11-06 20:08:36 -0500
committerFrederic Guillot <fred@kanboard.net>2016-11-06 20:08:36 -0500
commite5c63f4ecc78e144659bf83947a19d996f60b490 (patch)
treefe7abc757f3692dbede251b793103b98780fd93e /app/Controller
parentf758ddfc5e7d5d26d9a23b8c75fa6884159ecd72 (diff)
Load external tasks asynchronously from task view page
Diffstat (limited to 'app/Controller')
-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>');
+ }
+ }
+}