diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-05-13 21:44:31 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-05-13 21:44:31 -0400 |
commit | 10f662ce07cdc0924cb6688fcb2d502e7aa21acc (patch) | |
tree | 33e58c1978e0b5908c97d786d7145d6dbc7e4a7b /app/Validator | |
parent | a1a48b8374523fc19b3fb8596649baff0f3fa4a4 (diff) |
Add tasks in bulk from the board
Diffstat (limited to 'app/Validator')
-rw-r--r-- | app/Validator/TaskValidator.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/app/Validator/TaskValidator.php b/app/Validator/TaskValidator.php index 1a77dd32..55ea8fdd 100644 --- a/app/Validator/TaskValidator.php +++ b/app/Validator/TaskValidator.php @@ -70,6 +70,32 @@ class TaskValidator extends Base } /** + * Validate task creation + * + * @access public + * @param array $values Form values + * @return array $valid, $errors [0] = Success or not, [1] = List of errors + */ + public function validateBulkCreation(array $values) + { + $rules = array( + new Validators\Required('project_id', t('The project is required')), + new Validators\Required('tasks', t('Field required')), + new Validators\Required('column_id', t('Field required')), + new Validators\Required('swimlane_id', t('Field required')), + new Validators\Integer('category_id', t('This value must be an integer')), + new Validators\Integer('swimlane_id', t('This value must be an integer')), + ); + + $v = new Validator($values, array_merge($rules, $this->commonValidationRules())); + + return array( + $v->execute(), + $v->getErrors() + ); + } + + /** * Validate description creation * * @access public |