@@ -29,6 +29,12 class ReportsController < ApplicationController | |||
|
29 | 29 | @data = issues_by_tracker |
|
30 | 30 | @report_title = l(:field_tracker) |
|
31 | 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 | 38 | when "priority" |
|
33 | 39 | @field = "priority_id" |
|
34 | 40 | @rows = Enumeration::get_values('IPRI') |
@@ -56,11 +62,13 class ReportsController < ApplicationController | |||
|
56 | 62 | else |
|
57 | 63 | @queries = @project.queries.find :all, :conditions => ["is_public=? or user_id=?", true, (logged_in_user ? logged_in_user.id : 0)] |
|
58 | 64 | @trackers = Tracker.find(:all, :order => 'position') |
|
65 | @versions = @project.versions.sort | |
|
59 | 66 | @priorities = Enumeration::get_values('IPRI') |
|
60 | 67 | @categories = @project.issue_categories |
|
61 | 68 | @authors = @project.members.collect { |m| m.user } |
|
62 | 69 | @subprojects = @project.children |
|
63 | 70 | issues_by_tracker |
|
71 | issues_by_version | |
|
64 | 72 | issues_by_priority |
|
65 | 73 | issues_by_category |
|
66 | 74 | issues_by_author |
@@ -128,7 +136,22 private | |||
|
128 | 136 | and i.project_id=#{@project.id} |
|
129 | 137 | group by s.id, s.is_closed, t.id") |
|
130 | 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 | 155 | def issues_by_priority |
|
133 | 156 | @issues_by_priority ||= |
|
134 | 157 | ActiveRecord::Base.connection.select_all("select s.id as status_id, |
@@ -27,6 +27,9 | |||
|
27 | 27 | <h3><%=l(:field_tracker)%> <%= link_to image_tag('zoom_in.png'), :detail => 'tracker' %></h3> |
|
28 | 28 | <%= render :partial => 'simple', :locals => { :data => @issues_by_tracker, :field_name => "tracker_id", :rows => @trackers } %> |
|
29 | 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 | 33 | <h3><%=l(:field_author)%> <%= link_to image_tag('zoom_in.png'), :detail => 'author' %></h3> |
|
31 | 34 | <%= render :partial => 'simple', :locals => { :data => @issues_by_author, :field_name => "author_id", :rows => @authors } %> |
|
32 | 35 | <br /> |
General Comments 0
You need to be logged in to leave comments.
Login now