diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-09-03 14:25:17 -0700 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-09-03 14:25:17 -0700 |
commit | 749136361e6eedbc868778db17bdc67aa0f3b677 (patch) | |
tree | 78845b6f41fa69e4bc52c5e372689904ce8b5ac7 /app/Model | |
parent | d68ff648b1995c14506d4c61c9d97dc7f599496f (diff) |
Change a category directly from the board
Diffstat (limited to 'app/Model')
-rw-r--r-- | app/Model/Acl.php | 2 | ||||
-rw-r--r-- | app/Model/Task.php | 24 |
2 files changed, 25 insertions, 1 deletions
diff --git a/app/Model/Acl.php b/app/Model/Acl.php index a7620731..21c76329 100644 --- a/app/Model/Acl.php +++ b/app/Model/Acl.php @@ -30,7 +30,7 @@ class Acl extends Base */ private $user_actions = array( 'app' => array('index'), - 'board' => array('index', 'show', 'assign', 'assigntask', 'save', 'check'), + 'board' => array('index', 'show', 'save', 'check', 'changeassignee', 'updateassignee', 'changecategory', 'updatecategory'), 'project' => array('tasks', 'index', 'forbidden', 'search', 'export', 'show'), 'user' => array('index', 'edit', 'forbidden', 'logout', 'index', 'show', 'external', 'unlinkgoogle', 'unlinkgithub', 'sessions', 'removesession', 'last', 'notifications', 'password'), 'comment' => array('create', 'save', 'confirm', 'remove', 'update', 'edit', 'forbidden'), diff --git a/app/Model/Task.php b/app/Model/Task.php index 6a20f4d0..df6e4426 100644 --- a/app/Model/Task.php +++ b/app/Model/Task.php @@ -705,6 +705,30 @@ class Task extends Base } /** + * Validate category change + * + * @access public + * @param array $values Form values + * @return array $valid, $errors [0] = Success or not, [1] = List of errors + */ + public function validateCategoryModification(array $values) + { + $v = new Validator($values, array( + new Validators\Required('id', t('The id is required')), + new Validators\Integer('id', t('This value must be an integer')), + new Validators\Required('project_id', t('The project is required')), + new Validators\Integer('project_id', t('This value must be an integer')), + new Validators\Required('category_id', t('This value is required')), + new Validators\Integer('category_id', t('This value must be an integer')), + )); + + return array( + $v->execute(), + $v->getErrors() + ); + } + + /** * Validate project modification * * @access public |