issues report by author
git-svn-id: http://redmine.rubyforge.org/svn/trunk@35 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
7473be4072
commit
a2d4ca095a
|
@ -41,13 +41,21 @@ class ReportsController < ApplicationController
|
||||||
@data = issues_by_category
|
@data = issues_by_category
|
||||||
@report_title = l(:field_category)
|
@report_title = l(:field_category)
|
||||||
render :template => "reports/issue_report_details"
|
render :template => "reports/issue_report_details"
|
||||||
|
when "author"
|
||||||
|
@field = "author_id"
|
||||||
|
@rows = @project.members.collect { |m| m.user }
|
||||||
|
@data = issues_by_author
|
||||||
|
@report_title = l(:field_author)
|
||||||
|
render :template => "reports/issue_report_details"
|
||||||
else
|
else
|
||||||
@trackers = Tracker.find(:all)
|
@trackers = Tracker.find(:all)
|
||||||
@priorities = Enumeration::get_values('IPRI')
|
@priorities = Enumeration::get_values('IPRI')
|
||||||
@categories = @project.issue_categories
|
@categories = @project.issue_categories
|
||||||
|
@authors = @project.members.collect { |m| m.user }
|
||||||
issues_by_tracker
|
issues_by_tracker
|
||||||
issues_by_priority
|
issues_by_priority
|
||||||
issues_by_category
|
issues_by_category
|
||||||
|
issues_by_author
|
||||||
render :template => "reports/issue_report"
|
render :template => "reports/issue_report"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -102,4 +110,19 @@ private
|
||||||
and i.project_id=#{@project.id}
|
and i.project_id=#{@project.id}
|
||||||
group by s.id, s.is_closed, c.id")
|
group by s.id, s.is_closed, c.id")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def issues_by_author
|
||||||
|
@issues_by_author ||=
|
||||||
|
ActiveRecord::Base.connection.select_all("select s.id as status_id,
|
||||||
|
s.is_closed as closed,
|
||||||
|
a.id as author_id,
|
||||||
|
count(i.id) as total
|
||||||
|
from
|
||||||
|
issues i, issue_statuses s, users a
|
||||||
|
where
|
||||||
|
i.status_id=s.id
|
||||||
|
and i.author_id=a.id
|
||||||
|
and i.project_id=#{@project.id}
|
||||||
|
group by s.id, s.is_closed, a.id")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -85,6 +85,10 @@ class User < ActiveRecord::Base
|
||||||
firstname + " " + lastname
|
firstname + " " + lastname
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def name
|
||||||
|
display_name
|
||||||
|
end
|
||||||
|
|
||||||
def active?
|
def active?
|
||||||
self.status == STATUS_ACTIVE
|
self.status == STATUS_ACTIVE
|
||||||
end
|
end
|
||||||
|
|
|
@ -8,6 +8,10 @@
|
||||||
<strong><%=l(:field_priority)%></strong>
|
<strong><%=l(:field_priority)%></strong>
|
||||||
<%= render :partial => 'simple', :locals => { :data => @issues_by_priority, :field_name => "priority_id", :rows => @priorities } %>
|
<%= render :partial => 'simple', :locals => { :data => @issues_by_priority, :field_name => "priority_id", :rows => @priorities } %>
|
||||||
<p align="right"><small><%= link_to l(:label_details), :detail => 'priority' %></small> </p>
|
<p align="right"><small><%= link_to l(:label_details), :detail => 'priority' %></small> </p>
|
||||||
|
|
||||||
|
<strong><%=l(:field_author)%></strong>
|
||||||
|
<%= render :partial => 'simple', :locals => { :data => @issues_by_author, :field_name => "author_id", :rows => @authors } %>
|
||||||
|
<p align="right"><small><%= link_to l(:label_details), :detail => 'author' %></small> </p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="splitcontentright">
|
<div class="splitcontentright">
|
||||||
|
|
Loading…
Reference in New Issue