Feature #4989

Validate time entry hours based on a configurable regular expression

Added by li wei almost 12 years ago. Updated almost 12 years ago.

Status:NewStart date:2010-03-05
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Time tracking
Target version:-
Resolution:

Description

"time_entry_hours input" should support Regular expression. eg:set time_entry_hours value less than 8 or other conditions.

History

#1 Updated by li wei almost 12 years ago

Perhaps the feature should be a part of #4316

#2 Updated by Jean-Philippe Lang almost 12 years ago

  • 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)

#3 Updated by li wei almost 12 years ago

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