diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-11-26 21:04:46 -0500 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-11-26 21:04:46 -0500 |
commit | 20b60bc628a7c28cb7780e06073df68a821adc19 (patch) | |
tree | b51360727b274cbab78771748cb0e87fc0c677c6 /app/Model | |
parent | c6b9a2a92e60cb4488748d597a9df14c556236d3 (diff) |
Move subtask templates to a subfolder
Diffstat (limited to 'app/Model')
-rw-r--r-- | app/Model/SubTask.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/app/Model/SubTask.php b/app/Model/SubTask.php index 1faad680..f301ad62 100644 --- a/app/Model/SubTask.php +++ b/app/Model/SubTask.php @@ -267,6 +267,29 @@ class SubTask extends Base $rules = array( new Validators\Required('id', t('The subtask id is required')), new Validators\Required('task_id', t('The task id is required')), + new Validators\Required('title', t('The title is required')), + ); + + $v = new Validator($values, array_merge($rules, $this->commonValidationRules())); + + return array( + $v->execute(), + $v->getErrors() + ); + } + + /** + * Validate API modification + * + * @access public + * @param array $values Form values + * @return array $valid, $errors [0] = Success or not, [1] = List of errors + */ + public function validateApiModification(array $values) + { + $rules = array( + new Validators\Required('id', t('The subtask id is required')), + new Validators\Required('task_id', t('The task id is required')), ); $v = new Validator($values, array_merge($rules, $this->commonValidationRules())); |