]> source.dussan.org Git - redmine.git/commitdiff
Added details by assignees on issue summary view (Hans Yoon).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 10 Jan 2008 19:20:36 +0000 (19:20 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 10 Jan 2008 19:20:36 +0000 (19:20 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1052 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/reports_controller.rb
app/views/reports/issue_report.rhtml

index e18e117a6b2708b2f0eec697dad51d240aba5e1f..e33fe84127c5a1d7700ca89c7ed54df27a454638 100644 (file)
@@ -47,6 +47,12 @@ class ReportsController < ApplicationController
       @data = issues_by_category
       @report_title = l(:field_category)
       render :template => "reports/issue_report_details"   
+    when "assigned_to"
+      @field = "assigned_to_id"
+      @rows = @project.members.collect { |m| m.user }
+      @data = issues_by_assigned_to
+      @report_title = l(:field_assigned_to)
+      render :template => "reports/issue_report_details"
     when "author"
       @field = "author_id"
       @rows = @project.members.collect { |m| m.user }
@@ -64,12 +70,14 @@ class ReportsController < ApplicationController
       @versions = @project.versions.sort
       @priorities = Enumeration::get_values('IPRI')
       @categories = @project.issue_categories
+      @assignees = @project.members.collect { |m| m.user }
       @authors = @project.members.collect { |m| m.user }
       @subprojects = @project.active_children
       issues_by_tracker
       issues_by_version
       issues_by_priority
       issues_by_category
+      issues_by_assigned_to
       issues_by_author
       issues_by_subproject
       
@@ -180,7 +188,22 @@ private
                                                   and i.project_id=#{@project.id}
                                                 group by s.id, s.is_closed, c.id")     
   end
-       
+  
+  def issues_by_assigned_to
+    @issues_by_assigned_to ||= 
+      ActiveRecord::Base.connection.select_all("select    s.id as status_id, 
+                                                  s.is_closed as closed, 
+                                                  a.id as assigned_to_id,
+                                                  count(i.id) as total 
+                                                from 
+                                                  #{Issue.table_name} i, #{IssueStatus.table_name} s, #{User.table_name} a
+                                                where 
+                                                  i.status_id=s.id 
+                                                  and i.assigned_to_id=a.id
+                                                  and i.project_id=#{@project.id}
+                                                group by s.id, s.is_closed, a.id")
+  end
+  
   def issues_by_author
     @issues_by_author ||= 
       ActiveRecord::Base.connection.select_all("select    s.id as status_id, 
index 0eaba58dca351a313f65517d4cf8563ac3004cc0..1ed16ea3b0c113036d07a0af9851c87cbd0d8609 100644 (file)
@@ -4,8 +4,11 @@
 <h3><%=l(:field_tracker)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :detail => 'tracker' %></h3>
 <%= render :partial => 'simple', :locals => { :data => @issues_by_tracker, :field_name => "tracker_id", :rows => @trackers } %>
 <br />
-<h3><%=l(:field_version)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :detail => 'version' %></h3>
-<%= render :partial => 'simple', :locals => { :data => @issues_by_version, :field_name => "fixed_version_id", :rows => @versions } %>
+<h3><%=l(:field_priority)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :detail => 'priority' %></h3>
+<%= render :partial => 'simple', :locals => { :data => @issues_by_priority, :field_name => "priority_id", :rows => @priorities } %>
+<br />
+<h3><%=l(:field_assigned_to)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :detail => 'assigned_to' %></h3>
+<%= render :partial => 'simple', :locals => { :data => @issues_by_assigned_to, :field_name => "assigned_to_id", :rows => @assignees } %>
 <br />
 <h3><%=l(:field_author)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :detail => 'author' %></h3>
 <%= render :partial => 'simple', :locals => { :data => @issues_by_author, :field_name => "author_id", :rows => @authors } %>
@@ -13,8 +16,8 @@
 </div>
 
 <div class="splitcontentright">
-<h3><%=l(:field_priority)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :detail => 'priority' %></h3>
-<%= render :partial => 'simple', :locals => { :data => @issues_by_priority, :field_name => "priority_id", :rows => @priorities } %>
+<h3><%=l(:field_version)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :detail => 'version' %></h3>
+<%= render :partial => 'simple', :locals => { :data => @issues_by_version, :field_name => "fixed_version_id", :rows => @versions } %>
 <br />
 <% if @project.children.any? %>
 <h3><%=l(:field_subproject)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :detail => 'subproject' %></h3>