diff options
author | Frédéric Guillot <contact@fredericguillot.com> | 2014-03-04 22:45:58 -0500 |
---|---|---|
committer | Frédéric Guillot <contact@fredericguillot.com> | 2014-03-04 22:45:58 -0500 |
commit | 141616b48cdb2f05a8288be0519ac4094c292ba6 (patch) | |
tree | 80c4382b19abc5b75636899a764e6252fc9032b1 /models | |
parent | 19409360ca7d4c00d070b16bbfcc6cd02543cdca (diff) |
Add the possibility to add a description directly from the task show view
Diffstat (limited to 'models')
-rw-r--r-- | models/acl.php | 2 | ||||
-rw-r--r-- | models/task.php | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/models/acl.php b/models/acl.php index 468022cb..767d62f8 100644 --- a/models/acl.php +++ b/models/acl.php @@ -16,7 +16,7 @@ class Acl extends Base 'app' => array('index'), 'board' => array('index', 'show', 'assign', 'assigntask', 'save'), 'project' => array('tasks', 'index', 'forbidden'), - 'task' => array('show', 'create', 'save', 'edit', 'update', 'close', 'confirmclose', 'open', 'confirmopen', 'comment'), + 'task' => array('show', 'create', 'save', 'edit', 'update', 'close', 'confirmclose', 'open', 'confirmopen', 'comment', 'description'), 'user' => array('index', 'edit', 'update', 'forbidden', 'logout', 'index'), 'config' => array('index'), ); diff --git a/models/task.php b/models/task.php index e542e8e0..77c620c8 100644 --- a/models/task.php +++ b/models/task.php @@ -192,6 +192,20 @@ class Task extends Base ); } + public function validateDescriptionCreation(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('description', t('The description is required')), + )); + + return array( + $v->execute(), + $v->getErrors() + ); + } + public function validateModification(array $values) { $v = new Validator($values, array( |