Class: Redmine::Helpers::TimeReport

Inherits:
Object
  • Object
show all
Defined in:
lib/redmine/helpers/time_report.rb

Overview

Since:

  • 1.4.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project, issue, criteria, columns, time_entry_scope) ⇒ TimeReport

Returns a new instance of TimeReport



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/redmine/helpers/time_report.rb', line 23

def initialize(project, issue, criteria, columns, time_entry_scope)
  @project = project
  @issue = issue

  @criteria = criteria || []
  @criteria = @criteria.select{|criteria| available_criteria.has_key? criteria}
  @criteria.uniq!
  @criteria = @criteria[0,3]

  @columns = (columns && %w(year month week day).include?(columns)) ? columns : 'month'
  @scope = time_entry_scope

  run
end

Instance Attribute Details

#columnsObject (readonly)

Returns the value of attribute columns



21
22
23
# File 'lib/redmine/helpers/time_report.rb', line 21

def columns
  @columns
end

#criteriaObject (readonly)

Returns the value of attribute criteria



21
22
23
# File 'lib/redmine/helpers/time_report.rb', line 21

def criteria
  @criteria
end

#hoursObject (readonly)

Returns the value of attribute hours



21
22
23
# File 'lib/redmine/helpers/time_report.rb', line 21

def hours
  @hours
end

#periodsObject (readonly)

Returns the value of attribute periods



21
22
23
# File 'lib/redmine/helpers/time_report.rb', line 21

def periods
  @periods
end

#total_hoursObject (readonly)

Returns the value of attribute total_hours



21
22
23
# File 'lib/redmine/helpers/time_report.rb', line 21

def total_hours
  @total_hours
end

Instance Method Details

#available_criteriaObject



38
39
40
# File 'lib/redmine/helpers/time_report.rb', line 38

def available_criteria
  @available_criteria || load_available_criteria
end