diff options
author | David-Norris <Dave@Rachels-MacBook-Pro.local> | 2015-05-03 00:12:28 -0400 |
---|---|---|
committer | David-Norris <Dave@Rachels-MacBook-Pro.local> | 2015-05-03 00:12:28 -0400 |
commit | a314bbb489eff2d419481ad001805ce13edb5352 (patch) | |
tree | 43961ee5b42857f905eb8042af5090d0a4413221 /app/Model/TaskValidator.php | |
parent | fa5aaa60934223f74c9b9c32e7599f53c72a81fd (diff) |
Initial Recurring Tasks Commit
Initial Recurring Tasks Commit
No Locales Updated.
Diffstat (limited to 'app/Model/TaskValidator.php')
-rw-r--r-- | app/Model/TaskValidator.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/app/Model/TaskValidator.php b/app/Model/TaskValidator.php index ae21ca28..ec1383ad 100644 --- a/app/Model/TaskValidator.php +++ b/app/Model/TaskValidator.php @@ -30,6 +30,13 @@ class TaskValidator extends Base new Validators\Integer('score', t('This value must be an integer')), new Validators\Integer('category_id', t('This value must be an integer')), new Validators\Integer('swimlane_id', t('This value must be an integer')), + new Validators\Integer('recurrence_child', t('This value must be an integer')), + new Validators\Integer('recurrence_parent', t('This value must be an integer')), + new Validators\Integer('recurrence_factor', t('This value must be an integer')), + new Validators\Integer('recurrence_timeframe', t('This value must be an integer')), + new Validators\Integer('recurrence_basedate', t('This value must be an integer')), + new Validators\Integer('recurrence_trigger', t('This value must be an integer')), + new Validators\Integer('recurrence_status', t('This value must be an integer')), new Validators\MaxLength('title', t('The maximum length is %d characters', 200), 200), new Validators\Date('date_due', t('Invalid date'), $this->dateParser->getDateFormats()), new Validators\Date('date_started', t('Invalid date'), $this->dateParser->getDateFormats()), @@ -82,6 +89,28 @@ class TaskValidator extends Base } /** + * Validate edit recurrence + * + * @access public + * @param array $values Form values + * @return array $valid, $errors [0] = Success or not, [1] = List of errors + */ + public function validateEditRecurrence(array $values) + { + $rules = array( + new Validators\Required('id', t('The id is required')), + ); + + $v = new Validator($values, array_merge($rules, $this->commonValidationRules())); + + return array( + $v->execute(), + $v->getErrors() + ); + } + + + /** * Validate task modification (form) * * @access public |