Module: FixedIssuesExtension

Defined in:
app/models/version.rb

Overview

Redmine - project management software Copyright © 2006- Jean-Philippe Lang

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Instance Method Summary collapse

Instance Method Details

#closed_countObject

Returns the total amount of closed issues for this version.



40
41
42
43
# File 'app/models/version.rb', line 40

def closed_count
  load_counts
  @closed_count
end

#closed_percentObject

Returns the percentage of issues that have been marked as ‘closed’.



55
56
57
58
59
60
# File 'app/models/version.rb', line 55

def closed_percent
  return 0 if open_count + closed_count == 0
  return 100 if open_count == 0

  issues_progress(false)
end

#completed_percentObject

Returns the completion percentage of this version based on the amount of open/closed issues and the time spent on the open issues.



47
48
49
50
51
52
# File 'app/models/version.rb', line 47

def completed_percent
  return 0 if open_count + closed_count == 0
  return 100 if open_count == 0

  issues_progress(false) + issues_progress(true)
end

#estimated_hoursObject

Returns the total estimated time for this version (sum of leaves estimated_hours)



23
24
25
# File 'app/models/version.rb', line 23

def estimated_hours
  @estimated_hours ||= sum(:estimated_hours).to_f
end

#estimated_remaining_hoursObject

Returns the total estimated remaining time for this version (sum of leaves remaining_estimated_hours)



29
30
31
# File 'app/models/version.rb', line 29

def estimated_remaining_hours
  @estimated_remaining_hours ||= sum(IssueQuery::ESTIMATED_REMAINING_HOURS_SQL).to_f
end

#open_countObject

Returns the total amount of open issues for this version.



34
35
36
37
# File 'app/models/version.rb', line 34

def open_count
  load_counts
  @open_count
end