summaryrefslogtreecommitdiff
path: root/app/Controller
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-09-23 20:16:07 +0200
committerFrédéric Guillot <fred@kanboard.net>2014-09-23 20:16:07 +0200
commita5337cfe5c688c8b7bc91135af47cbafe7c0527d (patch)
treeb8bf6d0510fec83b18dfe500572a042ac4ba703b /app/Controller
parentdd7579e5a809de9f4c5fe151800bd7ca514af3dc (diff)
Move task edit form to the task layout
Diffstat (limited to 'app/Controller')
-rw-r--r--app/Controller/Task.php31
1 files changed, 17 insertions, 14 deletions
diff --git a/app/Controller/Task.php b/app/Controller/Task.php
index 28db5c28..fc7103ef 100644
--- a/app/Controller/Task.php
+++ b/app/Controller/Task.php
@@ -160,23 +160,25 @@ class Task extends Base
}
$task['score'] = $task['score'] ?: '';
+ $ajax = $this->request->isAjax();
$params = array(
- 'values' => $task,
- 'errors' => array(),
- 'task' => $task,
- 'users_list' => $this->projectPermission->getUsersList($task['project_id']),
- 'colors_list' => $this->color->getList(),
- 'categories_list' => $this->category->getList($task['project_id']),
- 'ajax' => $this->request->isAjax(),
- 'menu' => 'tasks',
- 'title' => t('Edit a task')
- );
- if ($this->request->isAjax()) {
+ 'values' => $task,
+ 'errors' => array(),
+ 'task' => $task,
+ 'users_list' => $this->projectPermission->getUsersList($task['project_id']),
+ 'colors_list' => $this->color->getList(),
+ 'categories_list' => $this->category->getList($task['project_id']),
+ 'ajax' => $ajax,
+ 'menu' => 'tasks',
+ 'title' => t('Edit a task')
+ );
+
+ if ($ajax) {
$this->response->html($this->template->load('task_edit', $params));
}
else {
- $this->response->html($this->template->layout('task_edit', $params));
+ $this->response->html($this->taskLayout('task_edit', $params));
}
}
@@ -209,7 +211,7 @@ class Task extends Base
}
}
- $this->response->html($this->template->layout('task_edit', array(
+ $this->response->html($this->taskLayout('task_edit', array(
'values' => $values,
'errors' => $errors,
'task' => $task,
@@ -218,7 +220,8 @@ class Task extends Base
'colors_list' => $this->color->getList(),
'categories_list' => $this->category->getList($values['project_id']),
'menu' => 'tasks',
- 'title' => t('Edit a task')
+ 'title' => t('Edit a task'),
+ 'ajax' => $this->request->isAjax(),
)));
}