Add 3 new fields for tasks: start date, time estimated and time spent

This commit is contained in:
Frédéric Guillot
2014-10-11 21:11:10 -04:00
parent a8418afdeb
commit acba6839a6
41 changed files with 417 additions and 116 deletions

View File

@@ -31,6 +31,9 @@ class TaskValidator extends Base
new Validators\Integer('category_id', 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()),
new Validators\Numeric('time_spent', t('This value must be numeric')),
new Validators\Numeric('time_estimated', t('This value must be numeric')),
);
}
@@ -189,4 +192,25 @@ class TaskValidator extends Base
$v->getErrors()
);
}
/**
* Validate time tracking modification (form)
*
* @access public
* @param array $values Form values
* @return array $valid, $errors [0] = Success or not, [1] = List of errors
*/
public function validateTimeModification(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()
);
}
}