From 20b60bc628a7c28cb7780e06073df68a821adc19 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Wed, 26 Nov 2014 21:04:46 -0500 Subject: Move subtask templates to a subfolder --- app/Model/SubTask.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'app/Model') 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 @@ -263,6 +263,29 @@ class SubTask extends Base * @return array $valid, $errors [0] = Success or not, [1] = List of errors */ public function validateModification(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')), + 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')), -- cgit v1.2.3