##// END OF EJS Templates
Replaces find(:all) calls....
Replaces find(:all) calls. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10914 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r10687:5b21efd4a432
r10687:5b21efd4a432
Show More
reports_controller.rb
95 lines | 3.2 KiB | text/x-ruby | RubyLexer
/ app / controllers / reports_controller.rb
Jean-Philippe Lang
Ability to assign issues to groups (#2964)....
r6186 # Redmine - project management software
Jean-Philippe Lang
Copyright update....
r9453 # Copyright (C) 2006-2012 Jean-Philippe Lang
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 #
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
Toshi MARUYAMA
remove trailing white-spaces from app/controllers/reports_controller.rb....
r6687 #
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
Toshi MARUYAMA
remove trailing white-spaces from app/controllers/reports_controller.rb....
r6687 #
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class ReportsController < ApplicationController
Jean-Philippe Lang
Highlight the current item of the main menu....
r1062 menu_item :issues
Eric Davis
Refactored IssueStatus finder to a before_filter...
r3296 before_filter :find_project, :authorize, :find_issue_statuses
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330
def issue_report
Eric Davis
Separated ReportsController#issue_report into two separate actions....
r3282 @trackers = @project.trackers
@versions = @project.shared_versions.sort
Jean-Philippe Lang
Reversed order of priorities on the issue summary page (#11205)....
r9696 @priorities = IssuePriority.all.reverse
Eric Davis
Separated ReportsController#issue_report into two separate actions....
r3282 @categories = @project.issue_categories
Jean-Philippe Lang
Ability to assign issues to groups (#2964)....
r6186 @assignees = (Setting.issue_group_assignment? ? @project.principals : @project.users).sort
@authors = @project.users.sort
Jean-Philippe Lang
Fixed: private subprojects names may be revealed on issue summary report (#5360)....
r3578 @subprojects = @project.descendants.visible
Eric Davis
Refactor: inline the utility methods in ReportsController....
r3290
@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)
@issues_by_subproject = Issue.by_subproject(@project) || []
Eric Davis
Separated ReportsController#issue_report into two separate actions....
r3282 render :template => "reports/issue_report"
Toshi MARUYAMA
remove trailing white-spaces from app/controllers/reports_controller.rb....
r6687 end
Eric Davis
Separated ReportsController#issue_report into two separate actions....
r3282
def issue_report_details
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 case params[:detail]
when "tracker"
@field = "tracker_id"
Jean-Philippe Lang
Added per-project tracker selection. Trackers can be selected on project settings....
r907 @rows = @project.trackers
Eric Davis
Refactor: inline the utility methods in ReportsController....
r3290 @data = Issue.by_tracker(@project)
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 @report_title = l(:field_tracker)
Jean-Philippe Lang
Added issue count details for versions on Reports view....
r540 when "version"
@field = "fixed_version_id"
Jean-Philippe Lang
Display shared versions on the issue summary view (#4425)....
r3073 @rows = @project.shared_versions.sort
Eric Davis
Refactor: inline the utility methods in ReportsController....
r3290 @data = Issue.by_version(@project)
Jean-Philippe Lang
Added issue count details for versions on Reports view....
r540 @report_title = l(:field_version)
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 when "priority"
@field = "priority_id"
Jean-Philippe Lang
Reversed order of priorities on the issue summary page (#11205)....
r9696 @rows = IssuePriority.all.reverse
Eric Davis
Refactor: inline the utility methods in ReportsController....
r3290 @data = Issue.by_priority(@project)
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 @report_title = l(:field_priority)
when "category"
@field = "category_id"
@rows = @project.issue_categories
Eric Davis
Refactor: inline the utility methods in ReportsController....
r3290 @data = Issue.by_category(@project)
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 @report_title = l(:field_category)
Jean-Philippe Lang
Added details by assignees on issue summary view (Hans Yoon)....
r1038 when "assigned_to"
@field = "assigned_to_id"
Jean-Philippe Lang
Ability to assign issues to groups (#2964)....
r6186 @rows = (Setting.issue_group_assignment? ? @project.principals : @project.users).sort
Eric Davis
Refactor: inline the utility methods in ReportsController....
r3290 @data = Issue.by_assigned_to(@project)
Jean-Philippe Lang
Added details by assignees on issue summary view (Hans Yoon)....
r1038 @report_title = l(:field_assigned_to)
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 when "author"
@field = "author_id"
Jean-Philippe Lang
Ability to assign issues to groups (#2964)....
r6186 @rows = @project.users.sort
Eric Davis
Refactor: inline the utility methods in ReportsController....
r3290 @data = Issue.by_author(@project)
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 @report_title = l(:field_author)
Jean-Philippe Lang
Added subprojects issue count on project "Reports" page...
r407 when "subproject"
@field = "project_id"
Jean-Philippe Lang
Fixed: private subprojects names may be revealed on issue summary report (#5360)....
r3578 @rows = @project.descendants.visible
Eric Davis
Refactor: inline the utility methods in ReportsController....
r3290 @data = Issue.by_subproject(@project) || []
Jean-Philippe Lang
Added subprojects issue count on project "Reports" page...
r407 @report_title = l(:field_subproject)
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 end
Eric Davis
Separated ReportsController#issue_report into two separate actions....
r3282
Eric Davis
Extracted the rendering from each case statement in issue_reports_details...
r3287 respond_to do |format|
if @field
format.html {}
else
format.html { redirect_to :action => 'issue_report', :id => @project }
end
end
Eric Davis
Separated ReportsController#issue_report into two separate actions....
r3282 end
Jean-Philippe Lang
Added issue count details for versions on Reports view....
r540
Eric Davis
Refactored IssueStatus finder to a before_filter...
r3296 private
def find_issue_statuses
Jean-Philippe Lang
Replaces find(:all) calls....
r10687 @statuses = IssueStatus.sorted.all
Eric Davis
Refactored IssueStatus finder to a before_filter...
r3296 end
Jean-Philippe Lang
Initial commit...
r2 end