@@ -29,14 +29,15 class ReportsController < ApplicationController | |||||
29 | @assignees = @project.members.collect { |m| m.user }.sort |
|
29 | @assignees = @project.members.collect { |m| m.user }.sort | |
30 | @authors = @project.members.collect { |m| m.user }.sort |
|
30 | @authors = @project.members.collect { |m| m.user }.sort | |
31 | @subprojects = @project.descendants.active |
|
31 | @subprojects = @project.descendants.active | |
32 | issues_by_tracker |
|
32 | ||
33 | issues_by_version |
|
33 | @issues_by_tracker = Issue.by_tracker(@project) | |
34 | issues_by_priority |
|
34 | @issues_by_version = Issue.by_version(@project) | |
35 | issues_by_category |
|
35 | @issues_by_priority = Issue.by_priority(@project) | |
36 | issues_by_assigned_to |
|
36 | @issues_by_category = Issue.by_category(@project) | |
37 | issues_by_author |
|
37 | @issues_by_assigned_to = Issue.by_assigned_to(@project) | |
38 | issues_by_subproject |
|
38 | @issues_by_author = Issue.by_author(@project) | |
39 |
|
39 | @issues_by_subproject = Issue.by_subproject(@project) || [] | ||
|
40 | ||||
40 | render :template => "reports/issue_report" |
|
41 | render :template => "reports/issue_report" | |
41 | end |
|
42 | end | |
42 |
|
43 | |||
@@ -47,37 +48,37 class ReportsController < ApplicationController | |||||
47 | when "tracker" |
|
48 | when "tracker" | |
48 | @field = "tracker_id" |
|
49 | @field = "tracker_id" | |
49 | @rows = @project.trackers |
|
50 | @rows = @project.trackers | |
50 |
@data = |
|
51 | @data = Issue.by_tracker(@project) | |
51 | @report_title = l(:field_tracker) |
|
52 | @report_title = l(:field_tracker) | |
52 | when "version" |
|
53 | when "version" | |
53 | @field = "fixed_version_id" |
|
54 | @field = "fixed_version_id" | |
54 | @rows = @project.shared_versions.sort |
|
55 | @rows = @project.shared_versions.sort | |
55 |
@data = |
|
56 | @data = Issue.by_version(@project) | |
56 | @report_title = l(:field_version) |
|
57 | @report_title = l(:field_version) | |
57 | when "priority" |
|
58 | when "priority" | |
58 | @field = "priority_id" |
|
59 | @field = "priority_id" | |
59 | @rows = IssuePriority.all |
|
60 | @rows = IssuePriority.all | |
60 |
@data = |
|
61 | @data = Issue.by_priority(@project) | |
61 | @report_title = l(:field_priority) |
|
62 | @report_title = l(:field_priority) | |
62 | when "category" |
|
63 | when "category" | |
63 | @field = "category_id" |
|
64 | @field = "category_id" | |
64 | @rows = @project.issue_categories |
|
65 | @rows = @project.issue_categories | |
65 |
@data = |
|
66 | @data = Issue.by_category(@project) | |
66 | @report_title = l(:field_category) |
|
67 | @report_title = l(:field_category) | |
67 | when "assigned_to" |
|
68 | when "assigned_to" | |
68 | @field = "assigned_to_id" |
|
69 | @field = "assigned_to_id" | |
69 | @rows = @project.members.collect { |m| m.user }.sort |
|
70 | @rows = @project.members.collect { |m| m.user }.sort | |
70 |
@data = |
|
71 | @data = Issue.by_assigned_to(@project) | |
71 | @report_title = l(:field_assigned_to) |
|
72 | @report_title = l(:field_assigned_to) | |
72 | when "author" |
|
73 | when "author" | |
73 | @field = "author_id" |
|
74 | @field = "author_id" | |
74 | @rows = @project.members.collect { |m| m.user }.sort |
|
75 | @rows = @project.members.collect { |m| m.user }.sort | |
75 |
@data = |
|
76 | @data = Issue.by_author(@project) | |
76 | @report_title = l(:field_author) |
|
77 | @report_title = l(:field_author) | |
77 | when "subproject" |
|
78 | when "subproject" | |
78 | @field = "project_id" |
|
79 | @field = "project_id" | |
79 | @rows = @project.descendants.active |
|
80 | @rows = @project.descendants.active | |
80 |
@data = |
|
81 | @data = Issue.by_subproject(@project) || [] | |
81 | @report_title = l(:field_subproject) |
|
82 | @report_title = l(:field_subproject) | |
82 | end |
|
83 | end | |
83 |
|
84 | |||
@@ -89,33 +90,5 class ReportsController < ApplicationController | |||||
89 | end |
|
90 | end | |
90 | end |
|
91 | end | |
91 | end |
|
92 | end | |
92 | private |
|
|||
93 | def issues_by_tracker |
|
|||
94 | @issues_by_tracker ||= Issue.by_tracker(@project) |
|
|||
95 | end |
|
|||
96 |
|
93 | |||
97 | def issues_by_version |
|
|||
98 | @issues_by_version ||= Issue.by_version(@project) |
|
|||
99 | end |
|
|||
100 |
|
||||
101 | def issues_by_priority |
|
|||
102 | @issues_by_priority ||= Issue.by_priority(@project) |
|
|||
103 | end |
|
|||
104 |
|
||||
105 | def issues_by_category |
|
|||
106 | @issues_by_category ||= Issue.by_category(@project) |
|
|||
107 | end |
|
|||
108 |
|
||||
109 | def issues_by_assigned_to |
|
|||
110 | @issues_by_assigned_to ||= Issue.by_assigned_to(@project) |
|
|||
111 | end |
|
|||
112 |
|
||||
113 | def issues_by_author |
|
|||
114 | @issues_by_author ||= Issue.by_author(@project) |
|
|||
115 | end |
|
|||
116 |
|
||||
117 | def issues_by_subproject |
|
|||
118 | @issues_by_subproject ||= Issue.by_subproject(@project) |
|
|||
119 | @issues_by_subproject ||= [] |
|
|||
120 | end |
|
|||
121 | end |
|
94 | end |
General Comments 0
You need to be logged in to leave comments.
Login now