summaryrefslogtreecommitdiff
path: root/app/Controller
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-11-24 21:32:03 -0500
committerFrédéric Guillot <fred@kanboard.net>2014-11-24 21:32:03 -0500
commit37c6616e50dbce2a298a27513b9882bb105405b0 (patch)
tree32fc40db197717893aa08dc50fa275a6804fa34a /app/Controller
parent5d7cff35261b485a994f5346f682fd802218de8d (diff)
Integrate tooltips and code cleanup/fix bugs, see #166
Diffstat (limited to 'app/Controller')
-rw-r--r--app/Controller/Board.php70
-rw-r--r--app/Controller/Subtask.php10
2 files changed, 72 insertions, 8 deletions
diff --git a/app/Controller/Board.php b/app/Controller/Board.php
index bdc82136..f04e847f 100644
--- a/app/Controller/Board.php
+++ b/app/Controller/Board.php
@@ -405,4 +405,74 @@ class Board extends Base
$this->response->status(401);
}
}
+
+ /**
+ * Get subtasks on mouseover
+ *
+ * @access public
+ */
+ public function subtasks()
+ {
+ $task = $this->getTask();
+ $this->response->html($this->template->load('board/subtasks', array(
+ 'subtasks' => $this->subTask->getAll($task['id'])
+ )));
+ }
+
+ /**
+ * Change the status of a subtask from the mouseover
+ *
+ * @access public
+ */
+ public function toggleSubtask()
+ {
+ $task = $this->getTask();
+ $this->subTask->toggleStatus($this->request->getIntegerParam('subtask_id'));
+
+ $this->response->html($this->template->load('board/subtasks', array(
+ 'subtasks' => $this->subTask->getAll($task['id'])
+ )));
+ }
+
+ /**
+ * Display all attachments during the task mouseover
+ *
+ * @access public
+ */
+ public function attachments()
+ {
+ $task = $this->getTask();
+
+ $this->response->html($this->template->load('board/files', array(
+ 'files' => $this->file->getAll($task['id'])
+ )));
+ }
+
+ /**
+ * Display comments during a task mouseover
+ *
+ * @access public
+ */
+ public function comments()
+ {
+ $task = $this->getTask();
+
+ $this->response->html($this->template->load('board/comments', array(
+ 'comments' => $this->comment->getAll($task['id'])
+ )));
+ }
+
+ /**
+ * Display the description
+ *
+ * @access public
+ */
+ public function description()
+ {
+ $task = $this->getTask();
+
+ $this->response->html($this->template->load('board/description', array(
+ 'task' => $task
+ )));
+ }
}
diff --git a/app/Controller/Subtask.php b/app/Controller/Subtask.php
index bc50b5e1..e48e7767 100644
--- a/app/Controller/Subtask.php
+++ b/app/Controller/Subtask.php
@@ -183,15 +183,9 @@ class Subtask extends Base
public function toggleStatus()
{
$task = $this->getTask();
- $subtask = $this->getSubtask();
-
- $value = array(
- 'id' => $subtask['id'],
- 'status' => ($subtask['status'] + 1) % 3,
- 'task_id' => $task['id'],
- );
+ $subtask_id = $this->request->getIntegerParam('subtask_id');
- if (! $this->subTask->update($value)) {
+ if (! $this->subTask->toggleStatus($subtask_id)) {
$this->session->flashError(t('Unable to update your sub-task.'));
}