annotate .svn/pristine/8e/8e2b9fee089af39ba59ee64ccb9baee42d90cb0a.svn-base @ 1327:287f201c2802 redmine-2.2-integration

Add italic
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Wed, 19 Jun 2013 20:56:22 +0100
parents 038ba2d95de8
children
rev   line source
Chris@1296 1 # Redmine - project management software
Chris@1296 2 # Copyright (C) 2006-2012 Jean-Philippe Lang
Chris@1296 3 #
Chris@1296 4 # This program is free software; you can redistribute it and/or
Chris@1296 5 # modify it under the terms of the GNU General Public License
Chris@1296 6 # as published by the Free Software Foundation; either version 2
Chris@1296 7 # of the License, or (at your option) any later version.
Chris@1296 8 #
Chris@1296 9 # This program is distributed in the hope that it will be useful,
Chris@1296 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
Chris@1296 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Chris@1296 12 # GNU General Public License for more details.
Chris@1296 13 #
Chris@1296 14 # You should have received a copy of the GNU General Public License
Chris@1296 15 # along with this program; if not, write to the Free Software
Chris@1296 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Chris@1296 17
Chris@1296 18 class ReportsController < ApplicationController
Chris@1296 19 menu_item :issues
Chris@1296 20 before_filter :find_project, :authorize, :find_issue_statuses
Chris@1296 21
Chris@1296 22 def issue_report
Chris@1296 23 @trackers = @project.trackers
Chris@1296 24 @versions = @project.shared_versions.sort
Chris@1296 25 @priorities = IssuePriority.all.reverse
Chris@1296 26 @categories = @project.issue_categories
Chris@1296 27 @assignees = (Setting.issue_group_assignment? ? @project.principals : @project.users).sort
Chris@1296 28 @authors = @project.users.sort
Chris@1296 29 @subprojects = @project.descendants.visible
Chris@1296 30
Chris@1296 31 @issues_by_tracker = Issue.by_tracker(@project)
Chris@1296 32 @issues_by_version = Issue.by_version(@project)
Chris@1296 33 @issues_by_priority = Issue.by_priority(@project)
Chris@1296 34 @issues_by_category = Issue.by_category(@project)
Chris@1296 35 @issues_by_assigned_to = Issue.by_assigned_to(@project)
Chris@1296 36 @issues_by_author = Issue.by_author(@project)
Chris@1296 37 @issues_by_subproject = Issue.by_subproject(@project) || []
Chris@1296 38
Chris@1296 39 render :template => "reports/issue_report"
Chris@1296 40 end
Chris@1296 41
Chris@1296 42 def issue_report_details
Chris@1296 43 case params[:detail]
Chris@1296 44 when "tracker"
Chris@1296 45 @field = "tracker_id"
Chris@1296 46 @rows = @project.trackers
Chris@1296 47 @data = Issue.by_tracker(@project)
Chris@1296 48 @report_title = l(:field_tracker)
Chris@1296 49 when "version"
Chris@1296 50 @field = "fixed_version_id"
Chris@1296 51 @rows = @project.shared_versions.sort
Chris@1296 52 @data = Issue.by_version(@project)
Chris@1296 53 @report_title = l(:field_version)
Chris@1296 54 when "priority"
Chris@1296 55 @field = "priority_id"
Chris@1296 56 @rows = IssuePriority.all.reverse
Chris@1296 57 @data = Issue.by_priority(@project)
Chris@1296 58 @report_title = l(:field_priority)
Chris@1296 59 when "category"
Chris@1296 60 @field = "category_id"
Chris@1296 61 @rows = @project.issue_categories
Chris@1296 62 @data = Issue.by_category(@project)
Chris@1296 63 @report_title = l(:field_category)
Chris@1296 64 when "assigned_to"
Chris@1296 65 @field = "assigned_to_id"
Chris@1296 66 @rows = (Setting.issue_group_assignment? ? @project.principals : @project.users).sort
Chris@1296 67 @data = Issue.by_assigned_to(@project)
Chris@1296 68 @report_title = l(:field_assigned_to)
Chris@1296 69 when "author"
Chris@1296 70 @field = "author_id"
Chris@1296 71 @rows = @project.users.sort
Chris@1296 72 @data = Issue.by_author(@project)
Chris@1296 73 @report_title = l(:field_author)
Chris@1296 74 when "subproject"
Chris@1296 75 @field = "project_id"
Chris@1296 76 @rows = @project.descendants.visible
Chris@1296 77 @data = Issue.by_subproject(@project) || []
Chris@1296 78 @report_title = l(:field_subproject)
Chris@1296 79 end
Chris@1296 80
Chris@1296 81 respond_to do |format|
Chris@1296 82 if @field
Chris@1296 83 format.html {}
Chris@1296 84 else
Chris@1296 85 format.html { redirect_to :action => 'issue_report', :id => @project }
Chris@1296 86 end
Chris@1296 87 end
Chris@1296 88 end
Chris@1296 89
Chris@1296 90 private
Chris@1296 91
Chris@1296 92 def find_issue_statuses
Chris@1296 93 @statuses = IssueStatus.find(:all, :order => 'position')
Chris@1296 94 end
Chris@1296 95 end