@data = issues_by_category\r
@report_title = l(:field_category)\r
render :template => "reports/issue_report_details" \r
+ when "author"\r
+ @field = "author_id"\r
+ @rows = @project.members.collect { |m| m.user }\r
+ @data = issues_by_author\r
+ @report_title = l(:field_author)\r
+ render :template => "reports/issue_report_details" \r
else\r
@trackers = Tracker.find(:all)\r
@priorities = Enumeration::get_values('IPRI')\r
@categories = @project.issue_categories\r
+ @authors = @project.members.collect { |m| m.user }\r
issues_by_tracker\r
issues_by_priority\r
issues_by_category\r
+ issues_by_author\r
render :template => "reports/issue_report"\r
end\r
end \r
and i.category_id=c.id\r
and i.project_id=#{@project.id}\r
group by s.id, s.is_closed, c.id") \r
+ end\r
+ \r
+ def issues_by_author\r
+ @issues_by_author ||= \r
+ ActiveRecord::Base.connection.select_all("select s.id as status_id, \r
+ s.is_closed as closed, \r
+ a.id as author_id,\r
+ count(i.id) as total \r
+ from \r
+ issues i, issue_statuses s, users a\r
+ where \r
+ i.status_id=s.id \r
+ and i.author_id=a.id\r
+ and i.project_id=#{@project.id}\r
+ group by s.id, s.is_closed, a.id") \r
end
end
<strong><%=l(:field_priority)%></strong>\r
<%= render :partial => 'simple', :locals => { :data => @issues_by_priority, :field_name => "priority_id", :rows => @priorities } %>\r
<p align="right"><small><%= link_to l(:label_details), :detail => 'priority' %></small> </p>\r
+\r
+<strong><%=l(:field_author)%></strong>\r
+<%= render :partial => 'simple', :locals => { :data => @issues_by_author, :field_name => "author_id", :rows => @authors } %>\r
+<p align="right"><small><%= link_to l(:label_details), :detail => 'author' %></small> </p>\r
</div>\r
\r
<div class="splitcontentright">\r