@@ -29,6 +29,12 class ReportsController < ApplicationController | |||||
29 | @data = issues_by_tracker |
|
29 | @data = issues_by_tracker | |
30 | @report_title = l(:field_tracker) |
|
30 | @report_title = l(:field_tracker) | |
31 | render :template => "reports/issue_report_details" |
|
31 | render :template => "reports/issue_report_details" | |
|
32 | when "version" | |||
|
33 | @field = "fixed_version_id" | |||
|
34 | @rows = @project.versions.sort | |||
|
35 | @data = issues_by_version | |||
|
36 | @report_title = l(:field_version) | |||
|
37 | render :template => "reports/issue_report_details" | |||
32 | when "priority" |
|
38 | when "priority" | |
33 | @field = "priority_id" |
|
39 | @field = "priority_id" | |
34 | @rows = Enumeration::get_values('IPRI') |
|
40 | @rows = Enumeration::get_values('IPRI') | |
@@ -56,11 +62,13 class ReportsController < ApplicationController | |||||
56 | else |
|
62 | else | |
57 | @queries = @project.queries.find :all, :conditions => ["is_public=? or user_id=?", true, (logged_in_user ? logged_in_user.id : 0)] |
|
63 | @queries = @project.queries.find :all, :conditions => ["is_public=? or user_id=?", true, (logged_in_user ? logged_in_user.id : 0)] | |
58 | @trackers = Tracker.find(:all, :order => 'position') |
|
64 | @trackers = Tracker.find(:all, :order => 'position') | |
|
65 | @versions = @project.versions.sort | |||
59 | @priorities = Enumeration::get_values('IPRI') |
|
66 | @priorities = Enumeration::get_values('IPRI') | |
60 | @categories = @project.issue_categories |
|
67 | @categories = @project.issue_categories | |
61 | @authors = @project.members.collect { |m| m.user } |
|
68 | @authors = @project.members.collect { |m| m.user } | |
62 | @subprojects = @project.children |
|
69 | @subprojects = @project.children | |
63 | issues_by_tracker |
|
70 | issues_by_tracker | |
|
71 | issues_by_version | |||
64 | issues_by_priority |
|
72 | issues_by_priority | |
65 | issues_by_category |
|
73 | issues_by_category | |
66 | issues_by_author |
|
74 | issues_by_author | |
@@ -129,6 +137,21 private | |||||
129 | group by s.id, s.is_closed, t.id") |
|
137 | group by s.id, s.is_closed, t.id") | |
130 | end |
|
138 | end | |
131 |
|
139 | |||
|
140 | def issues_by_version | |||
|
141 | @issues_by_version ||= | |||
|
142 | ActiveRecord::Base.connection.select_all("select s.id as status_id, | |||
|
143 | s.is_closed as closed, | |||
|
144 | v.id as fixed_version_id, | |||
|
145 | count(i.id) as total | |||
|
146 | from | |||
|
147 | #{Issue.table_name} i, #{IssueStatus.table_name} s, #{Version.table_name} v | |||
|
148 | where | |||
|
149 | i.status_id=s.id | |||
|
150 | and i.fixed_version_id=v.id | |||
|
151 | and i.project_id=#{@project.id} | |||
|
152 | group by s.id, s.is_closed, v.id") | |||
|
153 | end | |||
|
154 | ||||
132 | def issues_by_priority |
|
155 | def issues_by_priority | |
133 | @issues_by_priority ||= |
|
156 | @issues_by_priority ||= | |
134 | ActiveRecord::Base.connection.select_all("select s.id as status_id, |
|
157 | ActiveRecord::Base.connection.select_all("select s.id as status_id, |
@@ -27,6 +27,9 | |||||
27 | <h3><%=l(:field_tracker)%> <%= link_to image_tag('zoom_in.png'), :detail => 'tracker' %></h3> |
|
27 | <h3><%=l(:field_tracker)%> <%= link_to image_tag('zoom_in.png'), :detail => 'tracker' %></h3> | |
28 | <%= render :partial => 'simple', :locals => { :data => @issues_by_tracker, :field_name => "tracker_id", :rows => @trackers } %> |
|
28 | <%= render :partial => 'simple', :locals => { :data => @issues_by_tracker, :field_name => "tracker_id", :rows => @trackers } %> | |
29 | <br /> |
|
29 | <br /> | |
|
30 | <h3><%=l(:field_version)%> <%= link_to image_tag('zoom_in.png'), :detail => 'version' %></h3> | |||
|
31 | <%= render :partial => 'simple', :locals => { :data => @issues_by_version, :field_name => "fixed_version_id", :rows => @versions } %> | |||
|
32 | <br /> | |||
30 | <h3><%=l(:field_author)%> <%= link_to image_tag('zoom_in.png'), :detail => 'author' %></h3> |
|
33 | <h3><%=l(:field_author)%> <%= link_to image_tag('zoom_in.png'), :detail => 'author' %></h3> | |
31 | <%= render :partial => 'simple', :locals => { :data => @issues_by_author, :field_name => "author_id", :rows => @authors } %> |
|
34 | <%= render :partial => 'simple', :locals => { :data => @issues_by_author, :field_name => "author_id", :rows => @authors } %> | |
32 | <br /> |
|
35 | <br /> |
General Comments 0
You need to be logged in to leave comments.
Login now