summaryrefslogtreecommitdiff
path: root/app/Model
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/Model
parent5d7cff35261b485a994f5346f682fd802218de8d (diff)
Integrate tooltips and code cleanup/fix bugs, see #166
Diffstat (limited to 'app/Model')
-rw-r--r--app/Model/Acl.php2
-rw-r--r--app/Model/SubTask.php22
2 files changed, 23 insertions, 1 deletions
diff --git a/app/Model/Acl.php b/app/Model/Acl.php
index d96d5deb..4a5032d3 100644
--- a/app/Model/Acl.php
+++ b/app/Model/Acl.php
@@ -32,8 +32,8 @@ class Acl extends Base
*/
private $user_actions = array(
'app' => array('index', 'preview'),
- 'board' => array('index', 'show', 'save', 'check', 'changeassignee', 'updateassignee', 'changecategory', 'updatecategory', 'movecolumn', 'edit', 'update', 'add', 'confirm', 'remove'),
'project' => array('index', 'show', 'exporttasks', 'exportdaily', 'share', 'edit', 'update', 'users', 'remove', 'duplicate', 'disable', 'enable', 'activity', 'search', 'tasks', 'create', 'save'),
+ 'board' => array('index', 'show', 'save', 'check', 'changeassignee', 'updateassignee', 'changecategory', 'updatecategory', 'movecolumn', 'edit', 'update', 'add', 'confirm', 'remove', 'subtasks', 'togglesubtask', 'attachments', 'comments', 'description'),
'user' => array('edit', 'forbidden', 'logout', 'show', 'external', 'unlinkgoogle', 'unlinkgithub', 'sessions', 'removesession', 'last', 'notifications', 'password'),
'comment' => array('create', 'save', 'confirm', 'remove', 'update', 'edit', 'forbidden'),
'file' => array('create', 'save', 'download', 'confirm', 'remove', 'open', 'image'),
diff --git a/app/Model/SubTask.php b/app/Model/SubTask.php
index 6e61330b..1faad680 100644
--- a/app/Model/SubTask.php
+++ b/app/Model/SubTask.php
@@ -172,6 +172,28 @@ class SubTask extends Base
}
/**
+ * Change the status of subtask
+ *
+ * Todo -> In progress -> Done -> Todo -> etc...
+ *
+ * @access public
+ * @param integer $subtask_id
+ * @return bool
+ */
+ public function toggleStatus($subtask_id)
+ {
+ $subtask = $this->getById($subtask_id);
+
+ $values = array(
+ 'id' => $subtask['id'],
+ 'status' => ($subtask['status'] + 1) % 3,
+ 'task_id' => $subtask['task_id'],
+ );
+
+ return $this->update($values);
+ }
+
+ /**
* Remove
*
* @access public