summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-05-26 16:06:02 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-05-26 16:06:02 +0000
commitef39db234b40e557e8e229c5c8ca5792724c6423 (patch)
tree01922b83a582541b20d151179e714b50d5873f3c
parent8af6d24a364c192c6e3b4ea98c290f3e3df3ae52 (diff)
downloadredmine-ef39db234b40e557e8e229c5c8ca5792724c6423.tar.gz
redmine-ef39db234b40e557e8e229c5c8ca5792724c6423.zip
Added issue count details for versions on Reports view.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@543 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/controllers/reports_controller.rb25
-rw-r--r--app/views/reports/issue_report.rhtml3
2 files changed, 27 insertions, 1 deletions
diff --git a/app/controllers/reports_controller.rb b/app/controllers/reports_controller.rb
index 5536e272c..7c0b34773 100644
--- a/app/controllers/reports_controller.rb
+++ b/app/controllers/reports_controller.rb
@@ -29,6 +29,12 @@ class ReportsController < ApplicationController
@data = issues_by_tracker
@report_title = l(:field_tracker)
render :template => "reports/issue_report_details"
+ when "version"
+ @field = "fixed_version_id"
+ @rows = @project.versions.sort
+ @data = issues_by_version
+ @report_title = l(:field_version)
+ render :template => "reports/issue_report_details"
when "priority"
@field = "priority_id"
@rows = Enumeration::get_values('IPRI')
@@ -56,11 +62,13 @@ class ReportsController < ApplicationController
else
@queries = @project.queries.find :all, :conditions => ["is_public=? or user_id=?", true, (logged_in_user ? logged_in_user.id : 0)]
@trackers = Tracker.find(:all, :order => 'position')
+ @versions = @project.versions.sort
@priorities = Enumeration::get_values('IPRI')
@categories = @project.issue_categories
@authors = @project.members.collect { |m| m.user }
@subprojects = @project.children
issues_by_tracker
+ issues_by_version
issues_by_priority
issues_by_category
issues_by_author
@@ -128,7 +136,22 @@ private
and i.project_id=#{@project.id}
group by s.id, s.is_closed, t.id")
end
-
+
+ def issues_by_version
+ @issues_by_version ||=
+ ActiveRecord::Base.connection.select_all("select s.id as status_id,
+ s.is_closed as closed,
+ v.id as fixed_version_id,
+ count(i.id) as total
+ from
+ #{Issue.table_name} i, #{IssueStatus.table_name} s, #{Version.table_name} v
+ where
+ i.status_id=s.id
+ and i.fixed_version_id=v.id
+ and i.project_id=#{@project.id}
+ group by s.id, s.is_closed, v.id")
+ end
+
def issues_by_priority
@issues_by_priority ||=
ActiveRecord::Base.connection.select_all("select s.id as status_id,
diff --git a/app/views/reports/issue_report.rhtml b/app/views/reports/issue_report.rhtml
index 1ab9dbdbd..832bc2cff 100644
--- a/app/views/reports/issue_report.rhtml
+++ b/app/views/reports/issue_report.rhtml
@@ -27,6 +27,9 @@
<h3><%=l(:field_tracker)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :detail => 'tracker' %></h3>
<%= render :partial => 'simple', :locals => { :data => @issues_by_tracker, :field_name => "tracker_id", :rows => @trackers } %>
<br />
+<h3><%=l(:field_version)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :detail => 'version' %></h3>
+<%= render :partial => 'simple', :locals => { :data => @issues_by_version, :field_name => "fixed_version_id", :rows => @versions } %>
+<br />
<h3><%=l(:field_author)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :detail => 'author' %></h3>
<%= render :partial => 'simple', :locals => { :data => @issues_by_author, :field_name => "author_id", :rows => @authors } %>
<br />