diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-02-18 20:21:48 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-02-18 20:21:48 -0500 |
commit | 11a774e555786182dd634676811e3c58f316dad0 (patch) | |
tree | 4dd0092b45d15d1c6ae1db613e37eb9bb009c0ec /app/Validator | |
parent | 93c05371a882b3c07d16457479129e42a2999492 (diff) |
Send tasks by email
Diffstat (limited to 'app/Validator')
-rw-r--r-- | app/Validator/TaskValidator.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/app/Validator/TaskValidator.php b/app/Validator/TaskValidator.php index 7ca377d9..f9441c8b 100644 --- a/app/Validator/TaskValidator.php +++ b/app/Validator/TaskValidator.php @@ -204,4 +204,27 @@ class TaskValidator extends BaseValidator $v->getErrors() ); } + + /** + * Validate task email creation + * + * @access public + * @param array $values Required parameters to save an action + * @return array $valid, $errors [0] = Success or not, [1] = List of errors + */ + public function validateEmailCreation(array $values) + { + $rules = array( + new Validators\Required('subject', t('This field is required')), + new Validators\Required('email', t('This field is required')), + new Validators\Email('email', t('Email address invalid')), + ); + + $v = new Validator($values, $rules); + + return array( + $v->execute(), + $v->getErrors() + ); + } } |