diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2006-10-21 15:41:42 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2006-10-21 15:41:42 +0000 |
commit | a2d4ca095a676fd5bf5e1f4e03c9c93c8177d018 (patch) | |
tree | b9148eba0476adaaf34b5c48bc88e6f64fea9c39 /redmine | |
parent | 7473be407216246dbf0da705dc6c7b104b4c5a7e (diff) | |
download | redmine-a2d4ca095a676fd5bf5e1f4e03c9c93c8177d018.tar.gz redmine-a2d4ca095a676fd5bf5e1f4e03c9c93c8177d018.zip |
issues report by author
git-svn-id: http://redmine.rubyforge.org/svn/trunk@35 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'redmine')
-rw-r--r-- | redmine/app/controllers/reports_controller.rb | 23 | ||||
-rw-r--r-- | redmine/app/models/user.rb | 4 | ||||
-rw-r--r-- | redmine/app/views/reports/issue_report.rhtml | 4 |
3 files changed, 31 insertions, 0 deletions
diff --git a/redmine/app/controllers/reports_controller.rb b/redmine/app/controllers/reports_controller.rb index 6e5726329..4a2f7972e 100644 --- a/redmine/app/controllers/reports_controller.rb +++ b/redmine/app/controllers/reports_controller.rb @@ -41,13 +41,21 @@ class ReportsController < ApplicationController @data = issues_by_category
@report_title = l(:field_category)
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
@trackers = Tracker.find(:all)
@priorities = Enumeration::get_values('IPRI')
@categories = @project.issue_categories
+ @authors = @project.members.collect { |m| m.user }
issues_by_tracker
issues_by_priority
issues_by_category
+ issues_by_author
render :template => "reports/issue_report"
end
end
@@ -101,5 +109,20 @@ private and i.category_id=c.id
and i.project_id=#{@project.id}
group by s.id, s.is_closed, c.id")
+ 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 diff --git a/redmine/app/models/user.rb b/redmine/app/models/user.rb index 5ff19f2bc..7f09ef550 100644 --- a/redmine/app/models/user.rb +++ b/redmine/app/models/user.rb @@ -85,6 +85,10 @@ class User < ActiveRecord::Base firstname + " " + lastname
end
+ def name
+ display_name
+ end
+
def active?
self.status == STATUS_ACTIVE
end
diff --git a/redmine/app/views/reports/issue_report.rhtml b/redmine/app/views/reports/issue_report.rhtml index f4704969b..e2f8a844d 100644 --- a/redmine/app/views/reports/issue_report.rhtml +++ b/redmine/app/views/reports/issue_report.rhtml @@ -8,6 +8,10 @@ <strong><%=l(:field_priority)%></strong>
<%= 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>
+
+<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 class="splitcontentright">
|