Module: FixedIssuesExtension

Defined in:
app/models/version.rb

Overview

Redmine - project management software Copyright (C) 2006-2020 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.


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

def closed_count
  load_counts
  @closed_count
end

#closed_percentObject

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


52
53
54
55
56
57
58
# File 'app/models/version.rb', line 52

def closed_percent
  if count == 0
    0
  else
    issues_progress(false)
  end
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.


41
42
43
44
45
46
47
48
49
# File 'app/models/version.rb', line 41

def completed_percent
  if count == 0
    0
  elsif open_count == 0
    100
  else
    issues_progress(false) + issues_progress(true)
  end
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

#open_countObject

Returns the total amount of open issues for this version.


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

def open_count
  load_counts
  @open_count
end