summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-01-06 12:18:29 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-01-06 12:18:29 +0000
commit8ed55e8d7ac953b2f057a160726c1e19fce8c1de (patch)
treebcbde48d777cc54a53b3b1f10853ac231909c40e /app
parent979892a109bd298cec45258bc4b2b91c8fe676cb (diff)
downloadredmine-8ed55e8d7ac953b2f057a160726c1e19fce8c1de.tar.gz
redmine-8ed55e8d7ac953b2f057a160726c1e19fce8c1de.zip
added total number of issues per tracker on projects/show
git-svn-id: http://redmine.rubyforge.org/svn/trunk@152 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects_controller.rb4
-rw-r--r--app/views/projects/show.rhtml5
2 files changed, 5 insertions, 4 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index c3d54dfe9..68dc1a661 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -79,7 +79,9 @@ class ProjectsController < ApplicationController
@members = @project.members.find(:all, :include => [:user, :role])
@subprojects = @project.children if @project.children_count > 0
@news = @project.news.find(:all, :limit => 5, :include => [ :author, :project ], :order => "news.created_on DESC")
- @trackers = Tracker.find(:all)
+ @trackers = Tracker.find(:all)
+ @open_issues_by_tracker = Issue.count(:group => :tracker, :joins => "INNER JOIN issue_statuses ON issue_statuses.id = issues.status_id", :conditions => ["project_id=? and issue_statuses.is_closed=?", @project.id, false])
+ @total_issues_by_tracker = Issue.count(:group => :tracker, :conditions => ["project_id=?", @project.id])
end
def settings
diff --git a/app/views/projects/show.rhtml b/app/views/projects/show.rhtml
index be5b67abb..212e10f99 100644
--- a/app/views/projects/show.rhtml
+++ b/app/views/projects/show.rhtml
@@ -22,9 +22,8 @@
<li><%= link_to tracker.name, :controller => 'projects', :action => 'list_issues', :id => @project,
:set_filter => 1,
"tracker_id" => tracker.id %>:
- <%= issue_count = Issue.count(:conditions => ["project_id=? and tracker_id=? and issue_statuses.is_closed=?", @project.id, tracker.id, false], :include => :status) %>
- <%= lwr(:label_open_issues, issue_count) %>
- </li>
+ <%= @open_issues_by_tracker[tracker] || 0 %> <%= lwr(:label_open_issues, @open_issues_by_tracker[tracker] || 0) %>
+ <%= l(:label_on) %> <%= @total_issues_by_tracker[tracker] || 0 %></li>
<% end %>
</ul>
<p class="textcenter"><small><%= link_to l(:label_issue_view_all), :controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1 %></small></p>