Defect #5360 ยป 0001-Fixed-Issues-report-shows-sub-projects-for-non-memb.patch
| app/controllers/reports_controller.rb | ||
|---|---|---|
|
@categories = @project.issue_categories
|
||
|
@assignees = @project.members.collect { |m| m.user }.sort
|
||
|
@authors = @project.members.collect { |m| m.user }.sort
|
||
|
@subprojects = @project.descendants.active
|
||
|
@subprojects = @project.descendants.find(:all, :conditions => Project.visible_by(User.current))
|
||
|
@issues_by_tracker = Issue.by_tracker(@project)
|
||
|
@issues_by_version = Issue.by_version(@project)
|
||
| ... | ... | |
|
@report_title = l(:field_author)
|
||
|
when "subproject"
|
||
|
@field = "project_id"
|
||
|
@rows = @project.descendants.active
|
||
|
@rows = @project.descendants.find(:all, :conditions => Project.visible_by(User.current))
|
||
|
@data = Issue.by_subproject(@project) || []
|
||
|
@report_title = l(:field_subproject)
|
||
|
end
|
||
| app/models/issue.rb | ||
|---|---|---|
|
#{Issue.table_name} i, #{IssueStatus.table_name} s
|
||
|
where
|
||
|
i.status_id=s.id
|
||
|
and i.project_id IN (#{project.descendants.active.collect{|p| p.id}.join(',')})
|
||
|
group by s.id, s.is_closed, i.project_id") if project.descendants.active.any?
|
||
|
and i.project_id IN (#{project.descendants.find(:all, :conditions => Project.visible_by(User.current)).collect{|p| p.id}.join(',')})
|
||
|
group by s.id, s.is_closed, i.project_id") if project.descendants.find(:all, :conditions => Project.visible_by(User.current)).any?
|
||
|
end
|
||
|
# End ReportsController extraction
|
||
|
|
||