summaryrefslogtreecommitdiff
path: root/app/Model
diff options
context:
space:
mode:
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