summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2018-10-03 07:16:47 +0000
committerGo MAEDA <maeda@farend.jp>2018-10-03 07:16:47 +0000
commit3952c4d2642e275c1b1b04135596265b04548a13 (patch)
treebcac05dffca72e5db784d91eb55fed9b3edf65be /app
parent82abfa8ac576c9f8c85d9617d66b7d203b6b6b44 (diff)
downloadredmine-3952c4d2642e275c1b1b04135596265b04548a13.tar.gz
redmine-3952c4d2642e275c1b1b04135596265b04548a13.zip
Extend Issue Summary to include subprojects (#2529).
Patch by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@17563 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/controllers/reports_controller.rb27
-rw-r--r--app/models/issue.rb24
-rw-r--r--app/views/reports/_details.html.erb10
-rw-r--r--app/views/reports/_simple.html.erb8
4 files changed, 35 insertions, 34 deletions
diff --git a/app/controllers/reports_controller.rb b/app/controllers/reports_controller.rb
index 6f75b5652..cfef2f200 100644
--- a/app/controllers/reports_controller.rb
+++ b/app/controllers/reports_controller.rb
@@ -27,49 +27,50 @@ class ReportsController < ApplicationController
@assignees = (Setting.issue_group_assignment? ? @project.principals : @project.users).sort
@authors = @project.users.sort
@subprojects = @project.descendants.visible
-
- @issues_by_tracker = Issue.by_tracker(@project)
- @issues_by_version = Issue.by_version(@project)
- @issues_by_priority = Issue.by_priority(@project)
- @issues_by_category = Issue.by_category(@project)
- @issues_by_assigned_to = Issue.by_assigned_to(@project)
- @issues_by_author = Issue.by_author(@project)
+ with_subprojects = Setting.display_subprojects_issues?
+ @issues_by_tracker = Issue.by_tracker(@project, with_subprojects)
+ @issues_by_version = Issue.by_version(@project, with_subprojects)
+ @issues_by_priority = Issue.by_priority(@project, with_subprojects)
+ @issues_by_category = Issue.by_category(@project, with_subprojects)
+ @issues_by_assigned_to = Issue.by_assigned_to(@project, with_subprojects)
+ @issues_by_author = Issue.by_author(@project, with_subprojects)
@issues_by_subproject = Issue.by_subproject(@project) || []
render :template => "reports/issue_report"
end
def issue_report_details
+ with_subprojects = Setting.display_subprojects_issues?
case params[:detail]
when "tracker"
@field = "tracker_id"
@rows = @project.rolled_up_trackers(false).visible
- @data = Issue.by_tracker(@project)
+ @data = Issue.by_tracker(@project, with_subprojects)
@report_title = l(:field_tracker)
when "version"
@field = "fixed_version_id"
@rows = @project.shared_versions.sort
- @data = Issue.by_version(@project)
+ @data = Issue.by_version(@project, with_subprojects)
@report_title = l(:field_version)
when "priority"
@field = "priority_id"
@rows = IssuePriority.all.reverse
- @data = Issue.by_priority(@project)
+ @data = Issue.by_priority(@project, with_subprojects)
@report_title = l(:field_priority)
when "category"
@field = "category_id"
@rows = @project.issue_categories
- @data = Issue.by_category(@project)
+ @data = Issue.by_category(@project, with_subprojects)
@report_title = l(:field_category)
when "assigned_to"
@field = "assigned_to_id"
@rows = (Setting.issue_group_assignment? ? @project.principals : @project.users).sort
- @data = Issue.by_assigned_to(@project)
+ @data = Issue.by_assigned_to(@project, with_subprojects)
@report_title = l(:field_assigned_to)
when "author"
@field = "author_id"
@rows = @project.users.sort
- @data = Issue.by_author(@project)
+ @data = Issue.by_author(@project, with_subprojects)
@report_title = l(:field_author)
when "subproject"
@field = "project_id"
diff --git a/app/models/issue.rb b/app/models/issue.rb
index b9d8355ec..aa2c08b33 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -1464,28 +1464,28 @@ class Issue < ActiveRecord::Base
end
end
- def self.by_tracker(project)
- count_and_group_by(:project => project, :association => :tracker)
+ def self.by_tracker(project, with_subprojects=false)
+ count_and_group_by(:project => project, :association => :tracker, :with_subprojects => with_subprojects)
end
- def self.by_version(project)
- count_and_group_by(:project => project, :association => :fixed_version)
+ def self.by_version(project, with_subprojects=false)
+ count_and_group_by(:project => project, :association => :fixed_version, :with_subprojects => with_subprojects)
end
- def self.by_priority(project)
- count_and_group_by(:project => project, :association => :priority)
+ def self.by_priority(project, with_subprojects=false)
+ count_and_group_by(:project => project, :association => :priority, :with_subprojects => with_subprojects)
end
- def self.by_category(project)
- count_and_group_by(:project => project, :association => :category)
+ def self.by_category(project, with_subprojects=false)
+ count_and_group_by(:project => project, :association => :category, :with_subprojects => with_subprojects)
end
- def self.by_assigned_to(project)
- count_and_group_by(:project => project, :association => :assigned_to)
+ def self.by_assigned_to(project, with_subprojects=false)
+ count_and_group_by(:project => project, :association => :assigned_to, :with_subprojects => with_subprojects)
end
- def self.by_author(project)
- count_and_group_by(:project => project, :association => :author)
+ def self.by_author(project, with_subprojects=false)
+ count_and_group_by(:project => project, :association => :author, :with_subprojects => with_subprojects)
end
def self.by_subproject(project)
diff --git a/app/views/reports/_details.html.erb b/app/views/reports/_details.html.erb
index 998089caf..d9d9a3614 100644
--- a/app/views/reports/_details.html.erb
+++ b/app/views/reports/_details.html.erb
@@ -14,13 +14,13 @@
<tbody>
<% for row in rows %>
<tr>
- <td class="name"><%= link_to row.name, aggregate_path(@project, field_name, row) %></td>
+ <td class="name"><%= link_to row.name, aggregate_path(@project, field_name, row, :subproject_id => nil) %></td>
<% for status in @statuses %>
- <td><%= aggregate_link data, { field_name => row.id, "status_id" => status.id }, aggregate_path(@project, field_name, row, :status_id => status.id) %></td>
+ <td><%= aggregate_link data, { field_name => row.id, "status_id" => status.id }, aggregate_path(@project, field_name, row, :status_id => status.id, :subproject_id => nil) %></td>
<% end %>
- <td><%= aggregate_link data, { field_name => row.id, "closed" => 0 }, aggregate_path(@project, field_name, row, :status_id => "o") %></td>
- <td><%= aggregate_link data, { field_name => row.id, "closed" => 1 }, aggregate_path(@project, field_name, row, :status_id => "c") %></td>
- <td><%= aggregate_link data, { field_name => row.id }, aggregate_path(@project, field_name, row, :status_id => "*") %></td>
+ <td><%= aggregate_link data, { field_name => row.id, "closed" => 0 }, aggregate_path(@project, field_name, row, :status_id => "o", :subproject_id => nil) %></td>
+ <td><%= aggregate_link data, { field_name => row.id, "closed" => 1 }, aggregate_path(@project, field_name, row, :status_id => "c", :subproject_id => nil) %></td>
+ <td><%= aggregate_link data, { field_name => row.id }, aggregate_path(@project, field_name, row, :status_id => "*", :subproject_id => nil) %></td>
</tr>
<% end %>
</tbody>
diff --git a/app/views/reports/_simple.html.erb b/app/views/reports/_simple.html.erb
index d6f51ad19..754b1f21d 100644
--- a/app/views/reports/_simple.html.erb
+++ b/app/views/reports/_simple.html.erb
@@ -11,10 +11,10 @@
<tbody>
<% for row in rows %>
<tr>
- <td class="name"><%= link_to row.name, aggregate_path(@project, field_name, row) %></td>
- <td><%= aggregate_link data, { field_name => row.id, "closed" => 0 }, aggregate_path(@project, field_name, row, :status_id => "o") %></td>
- <td><%= aggregate_link data, { field_name => row.id, "closed" => 1 }, aggregate_path(@project, field_name, row, :status_id => "c") %></td>
- <td><%= aggregate_link data, { field_name => row.id }, aggregate_path(@project, field_name, row, :status_id => "*") %></td>
+ <td class="name"><%= link_to row.name, aggregate_path(@project, field_name, row, :subproject_id => nil) %></td>
+ <td><%= aggregate_link data, { field_name => row.id, "closed" => 0 }, aggregate_path(@project, field_name, row, :status_id => "o", :subproject_id => nil) %></td>
+ <td><%= aggregate_link data, { field_name => row.id, "closed" => 1 }, aggregate_path(@project, field_name, row, :status_id => "c", :subproject_id => nil) %></td>
+ <td><%= aggregate_link data, { field_name => row.id }, aggregate_path(@project, field_name, row, :status_id => "*", :subproject_id => nil) %></td>
</tr>
<% end %>
</tbody>