Deprecates Version#*_pourcent in favour of #*_percent (#12724).

Patch by Daniel Felix.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11113 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2013-01-04 08:30:25 +00:00
parent 9c698157f4
commit 9613a13b10
7 changed files with 39 additions and 27 deletions
+1 -1
View File
@@ -1026,7 +1026,7 @@ module ApplicationHelper
(pcts[1] > 0 ? content_tag('td', '', :style => "width: #{pcts[1]}%;", :class => 'done') : ''.html_safe) +
(pcts[2] > 0 ? content_tag('td', '', :style => "width: #{pcts[2]}%;", :class => 'todo') : ''.html_safe)
), :class => 'progress', :style => "width: #{width};").html_safe +
content_tag('p', legend, :class => 'pourcent').html_safe
content_tag('p', legend, :class => 'percent').html_safe
end
def checked_image(checked=true)
+1 -1
View File
@@ -567,7 +567,7 @@ class Project < ActiveRecord::Base
total / self_and_descendants.count
else
if versions.count > 0
total = versions.collect(&:completed_pourcent).sum
total = versions.collect(&:completed_percent).sum
total / versions.count
else
+16 -4
View File
@@ -97,10 +97,10 @@ class Version < ActiveRecord::Base
end
def behind_schedule?
if completed_pourcent == 100
if completed_percent == 100
return false
elsif due_date && start_date
done_date = start_date + ((due_date - start_date+1)* completed_pourcent/100).floor
done_date = start_date + ((due_date - start_date+1)* completed_percent/100).floor
return done_date <= Date.today
else
false # No issues so it's not late
@@ -109,7 +109,7 @@ class Version < ActiveRecord::Base
# Returns the completion percentage of this version based on the amount of open/closed issues
# and the time spent on the open issues.
def completed_pourcent
def completed_percent
if issues_count == 0
0
elsif open_issues_count == 0
@@ -119,8 +119,14 @@ class Version < ActiveRecord::Base
end
end
# TODO: remove in Redmine 3.0
def completed_pourcent
ActiveSupport::Deprecation.warn "Version#completed_pourcent is deprecated and will be removed in Redmine 3.0. Please use #completed_percent instead."
completed_percent
end
# Returns the percentage of issues that have been marked as 'closed'.
def closed_pourcent
def closed_percent
if issues_count == 0
0
else
@@ -128,6 +134,12 @@ class Version < ActiveRecord::Base
end
end
# TODO: remove in Redmine 3.0
def closed_pourcent
ActiveSupport::Deprecation.warn "Version#closed_pourcent is deprecated and will be removed in Redmine 3.0. Please use #closed_percent instead."
closed_percent
end
# Returns true if the version is overdue: due date reached and some open issues
def overdue?
effective_date && (effective_date < Date.today) && (open_issues_count > 0)
+1 -1
View File
@@ -16,7 +16,7 @@
<% end %>
<% if version.issues_count > 0 %>
<%= progress_bar([version.closed_pourcent, version.completed_pourcent], :width => '40em', :legend => ('%0.0f%' % version.completed_pourcent)) %>
<%= progress_bar([version.closed_percent, version.completed_percent], :width => '40em', :legend => ('%0.0f%' % version.completed_percent)) %>
<p class="progress-info">
<%= link_to(l(:label_x_issues, :count => version.issues_count),
project_issues_path(version.project, :status_id => '*', :fixed_version_id => version, :set_filter => 1)) %>