Patch #27676 » 0002-Adds-visibility-checks-on-version-views.patch
app/helpers/versions_helper.rb | ||
---|---|---|
57 | 57 |
h = Hash.new {|k,v| k[v] = [0, 0]} |
58 | 58 |
begin |
59 | 59 |
# Total issue count |
60 |
version.fixed_issues.group(criteria).count.each {|c,s| h[c][0] = s} |
|
60 |
version.fixed_issues.visible.group(criteria).count.each {|c,s| h[c][0] = s}
|
|
61 | 61 |
# Open issues count |
62 |
version.fixed_issues.open.group(criteria).count.each {|c,s| h[c][1] = s} |
|
62 |
version.fixed_issues.visible.open.group(criteria).count.each {|c,s| h[c][1] = s}
|
|
63 | 63 |
rescue ActiveRecord::RecordNotFound |
64 | 64 |
# When grouping by an association, Rails throws this exception if there's no result (bug) |
65 | 65 |
end |
app/views/versions/_overview.html.erb | ||
---|---|---|
14 | 14 |
</ul> |
15 | 15 |
<% end %> |
16 | 16 | |
17 |
<% if version.issues_count > 0 %>
|
|
18 |
<%= progress_bar([version.closed_percent, version.completed_percent],
|
|
17 |
<% if version.fixed_issues.visible.count > 0 %>
|
|
18 |
<%= progress_bar([version.fixed_issues.visible.closed_percent, version.fixed_issues.visible.completed_percent],
|
|
19 | 19 |
:titles => |
20 |
["%s: %0.0f%%" % [l(:label_closed_issues_plural), version.closed_percent], |
|
21 |
"%s: %0.0f%%" % [l(:field_done_ratio), version.completed_percent]], |
|
22 |
:legend => ('%0.0f%%' % version.completed_percent)) %> |
|
20 |
["%s: %0.0f%%" % [l(:label_closed_issues_plural), version.fixed_issues.visible.closed_percent],
|
|
21 |
"%s: %0.0f%%" % [l(:field_done_ratio), version.fixed_issues.visible.completed_percent]],
|
|
22 |
:legend => ('%0.0f%%' % version.fixed_issues.visible.completed_percent)) %>
|
|
23 | 23 |
<p class="progress-info"> |
24 |
<%= link_to(l(:label_x_issues, :count => version.issues_count),
|
|
24 |
<%= link_to(l(:label_x_issues, :count => version.fixed_issues.visible.count),
|
|
25 | 25 |
version_filtered_issues_path(version, :status_id => '*')) %> |
26 | 26 |
|
27 |
(<%= link_to_if(version.closed_issues_count > 0,
|
|
28 |
l(:label_x_closed_issues_abbr, :count => version.closed_issues_count),
|
|
27 |
(<%= link_to_if(version.fixed_issues.visible.closed_count > 0,
|
|
28 |
l(:label_x_closed_issues_abbr, :count => version.fixed_issues.visible.closed_count),
|
|
29 | 29 |
version_filtered_issues_path(version, :status_id => 'c')) %> |
30 | 30 |
— |
31 |
<%= link_to_if(version.open_issues_count > 0,
|
|
32 |
l(:label_x_open_issues_abbr, :count => version.open_issues_count),
|
|
31 |
<%= link_to_if(version.fixed_issues.visible.open_count > 0,
|
|
32 |
l(:label_x_open_issues_abbr, :count => version.fixed_issues.visible.open_count),
|
|
33 | 33 |
version_filtered_issues_path(version, :status_id => 'o')) %>) |
34 | 34 |
</p> |
35 | 35 |
<% else %> |
app/views/versions/show.html.erb | ||
---|---|---|
12 | 12 |
<%= render(:partial => "wiki/content", :locals => {:content => @version.wiki_page.content}) if @version.wiki_page %> |
13 | 13 | |
14 | 14 |
<div id="version-summary"> |
15 |
<% if @version.estimated_hours > 0 || User.current.allowed_to?(:view_time_entries, @project) %> |
|
15 |
<% if @version.fixed_issues.visible.estimated_hours > 0 || User.current.allowed_to?(:view_time_entries, @project) %>
|
|
16 | 16 |
<fieldset class="time-tracking"><legend><%= l(:label_time_tracking) %></legend> |
17 | 17 |
<table> |
18 | 18 |
<tr> |
19 | 19 |
<th><%= l(:field_estimated_hours) %></th> |
20 |
<td class="total-hours"><%= link_to html_hours(l_hours(@version.estimated_hours)), |
|
20 |
<td class="total-hours"><%= link_to html_hours(l_hours(@version.fixed_issues.visible.estimated_hours)),
|
|
21 | 21 |
project_issues_path(@version.project, :set_filter => 1, :status_id => '*', :fixed_version_id => @version.id, :c => [:tracker, :status, :subject, :estimated_hours], :t => [:estimated_hours]) %></td> |
22 | 22 |
</tr> |
23 | 23 |
<% if User.current.allowed_to_view_all_time_entries?(@project) %> |