kanbanworkflowstimelinescrumrubyroadmapproject-planningproject-managementopenprojectangularissue-trackerifcgantt-chartganttbug-trackerboardsbcf
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
110 lines
4.0 KiB
110 lines
4.0 KiB
13 years ago
|
#-- encoding: UTF-8
|
||
14 years ago
|
#-- copyright
|
||
12 years ago
|
# OpenProject is a project management system.
|
||
11 years ago
|
# Copyright (C) 2012-2013 the OpenProject Foundation (OPF)
|
||
14 years ago
|
#
|
||
14 years ago
|
# This program is free software; you can redistribute it and/or
|
||
12 years ago
|
# modify it under the terms of the GNU General Public License version 3.
|
||
14 years ago
|
#
|
||
11 years ago
|
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
|
||
|
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
||
|
# Copyright (C) 2010-2013 the ChiliProject Team
|
||
|
#
|
||
|
# 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.
|
||
|
#
|
||
|
# 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.
|
||
|
#
|
||
|
# 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.
|
||
|
#
|
||
14 years ago
|
# See doc/COPYRIGHT.rdoc for more details.
|
||
|
#++
|
||
|
|
||
11 years ago
|
class WorkPackages::ReportsController < ApplicationController
|
||
11 years ago
|
menu_item :summary_field, :only => [:report, :report_details]
|
||
11 years ago
|
before_filter :find_project_by_project_id, :authorize, :find_statuses
|
||
18 years ago
|
|
||
12 years ago
|
def report
|
||
12 years ago
|
@types = @project.types
|
||
15 years ago
|
@versions = @project.shared_versions.sort
|
||
|
@priorities = IssuePriority.all
|
||
|
@categories = @project.issue_categories
|
||
|
@assignees = @project.members.collect { |m| m.user }.sort
|
||
|
@authors = @project.members.collect { |m| m.user }.sort
|
||
15 years ago
|
@subprojects = @project.descendants.visible
|
||
15 years ago
|
|
||
11 years ago
|
@work_packages_by_type = WorkPackage.by_type(@project)
|
||
|
@work_packages_by_version = WorkPackage.by_version(@project)
|
||
|
@work_packages_by_priority = WorkPackage.by_priority(@project)
|
||
|
@work_packages_by_category = WorkPackage.by_category(@project)
|
||
|
@work_packages_by_assigned_to = WorkPackage.by_assigned_to(@project)
|
||
|
@work_packages_by_author = WorkPackage.by_author(@project)
|
||
|
@work_packages_by_subproject = WorkPackage.by_subproject(@project) || []
|
||
14 years ago
|
end
|
||
15 years ago
|
|
||
12 years ago
|
def report_details
|
||
18 years ago
|
case params[:detail]
|
||
12 years ago
|
when "type"
|
||
|
@field = "type_id"
|
||
|
@rows = @project.types
|
||
11 years ago
|
@data = WorkPackage.by_type(@project)
|
||
|
@report_title = WorkPackage.human_attribute_name(:type)
|
||
18 years ago
|
when "version"
|
||
|
@field = "fixed_version_id"
|
||
15 years ago
|
@rows = @project.shared_versions.sort
|
||
11 years ago
|
@data = WorkPackage.by_version(@project)
|
||
|
@report_title = WorkPackage.human_attribute_name(:version)
|
||
18 years ago
|
when "priority"
|
||
|
@field = "priority_id"
|
||
16 years ago
|
@rows = IssuePriority.all
|
||
11 years ago
|
@data = WorkPackage.by_priority(@project)
|
||
|
@report_title = WorkPackage.human_attribute_name(:priority)
|
||
18 years ago
|
when "category"
|
||
|
@field = "category_id"
|
||
|
@rows = @project.issue_categories
|
||
11 years ago
|
@data = WorkPackage.by_category(@project)
|
||
|
@report_title = WorkPackage.human_attribute_name(:category)
|
||
17 years ago
|
when "assigned_to"
|
||
|
@field = "assigned_to_id"
|
||
15 years ago
|
@rows = @project.members.collect { |m| m.user }.sort
|
||
11 years ago
|
@data = WorkPackage.by_assigned_to(@project)
|
||
|
@report_title = WorkPackage.human_attribute_name(:assigned_to)
|
||
18 years ago
|
when "author"
|
||
|
@field = "author_id"
|
||
15 years ago
|
@rows = @project.members.collect { |m| m.user }.sort
|
||
11 years ago
|
@data = WorkPackage.by_author(@project)
|
||
|
@report_title = WorkPackage.human_attribute_name(:author)
|
||
18 years ago
|
when "subproject"
|
||
|
@field = "project_id"
|
||
15 years ago
|
@rows = @project.descendants.visible
|
||
11 years ago
|
@data = WorkPackage.by_subproject(@project) || []
|
||
13 years ago
|
@report_title = l(:label_subproject_plural)
|
||
18 years ago
|
end
|
||
15 years ago
|
|
||
15 years ago
|
respond_to do |format|
|
||
|
if @field
|
||
|
format.html {}
|
||
|
else
|
||
11 years ago
|
format.html { redirect_to report_project_work_packages_path(@project) }
|
||
15 years ago
|
end
|
||
|
end
|
||
15 years ago
|
end
|
||
18 years ago
|
|
||
15 years ago
|
private
|
||
|
|
||
11 years ago
|
def find_statuses
|
||
|
@statuses = Status.find(:all, :order => 'position')
|
||
15 years ago
|
end
|
||
13 years ago
|
|
||
|
def default_breadcrumb
|
||
|
l(:label_summary)
|
||
|
end
|
||
19 years ago
|
end
|