Feature #4989
open
Validate time entry hours based on a configurable regular expression
Added by li wei over 14 years ago.
Updated over 14 years ago.
Description
"time_entry_hours input" should support Regular expression. eg:set time_entry_hours value less than 8 or other conditions.
Perhaps the feature should be a part of #4316
- Subject changed from "time_entry_hours inputbox" should support Regular expression to Validate time entry hours based on a configurable regular expression
- Assignee deleted (
Eric Davis)
li wei wrote:
"time_entry_hours input" should support Regular expression. eg:set time_entry_hours value less than 8 or other conditions.
"app/models/time_entry.rb" replace 'hours >= 1000' by 'hours >= 8'
def validate
errors.add :hours, :invalid if hours && (hours < 0 || hours > 8) # replace hours >= 1000 by hours >= 8
errors.add :project_id, :invalid if project.nil?
errors.add :issue_id, :invalid if (issue_id && !issue) || (issue && project!=issue.project)
end
Also available in: Atom
PDF