Class: Redmine::Helpers::TimeReport

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

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.


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

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


23
24
25
# File 'lib/redmine/helpers/time_report.rb', line 23

def columns
  @columns
end

#criteriaObject (readonly)

Returns the value of attribute criteria


23
24
25
# File 'lib/redmine/helpers/time_report.rb', line 23

def criteria
  @criteria
end

#hoursObject (readonly)

Returns the value of attribute hours


23
24
25
# File 'lib/redmine/helpers/time_report.rb', line 23

def hours
  @hours
end

#periodsObject (readonly)

Returns the value of attribute periods


23
24
25
# File 'lib/redmine/helpers/time_report.rb', line 23

def periods
  @periods
end

#total_hoursObject (readonly)

Returns the value of attribute total_hours


23
24
25
# File 'lib/redmine/helpers/time_report.rb', line 23

def total_hours
  @total_hours
end

Instance Method Details

#available_criteriaObject


40
41
42
# File 'lib/redmine/helpers/time_report.rb', line 40

def available_criteria
  @available_criteria || load_available_criteria
end