From 141616b48cdb2f05a8288be0519ac4094c292ba6 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Tue, 4 Mar 2014 22:45:58 -0500 Subject: Add the possibility to add a description directly from the task show view --- models/task.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'models/task.php') diff --git a/models/task.php b/models/task.php index e542e8e0..77c620c8 100644 --- a/models/task.php +++ b/models/task.php @@ -192,6 +192,20 @@ class Task extends Base ); } + public function validateDescriptionCreation(array $values) + { + $v = new Validator($values, array( + new Validators\Required('id', t('The id is required')), + new Validators\Integer('id', t('This value must be an integer')), + new Validators\Required('description', t('The description is required')), + )); + + return array( + $v->execute(), + $v->getErrors() + ); + } + public function validateModification(array $values) { $v = new Validator($values, array( -- cgit v1.2.3