Patch #14679 » redmine-2.3-stable-roadmap-parent-and-son-issues.patch
| app/models/issue.rb (working copy) | ||
|---|---|---|
|
end
|
||
|
end
|
||
|
def parents_count
|
||
|
parent.nil? || parent.project_id != project_id ? 0 : 1 + parent.parents_count
|
||
|
end
|
||
|
# Returns true if issue's project is a valid
|
||
|
# parent issue project
|
||
|
def valid_parent_project?(issue=parent)
|
||
| app/models/version.rb (working copy) | ||
|---|---|---|
|
scope :sorted, order(fields_for_order_statement)
|
||
|
def sorted_fixed_issues
|
||
|
issues = []
|
||
|
fixed_issues.visible.find(:all,
|
||
|
:conditions => nil,
|
||
|
:include => [:parent, :status, :tracker, :priority],
|
||
|
:order => "#{Tracker.table_name}.position, #{Issue.table_name}.id").each do |issue|
|
||
|
if issue.parent.nil? || issue.parent.project_id != issue.project_id
|
||
|
issues << issue
|
||
|
issues += find_son_issues({:parent => issue})
|
||
|
end
|
||
|
end
|
||
|
issues
|
||
|
end
|
||
|
# find all son and grandson issue
|
||
|
def find_son_issues(options)
|
||
|
issues = []
|
||
|
fixed_issues.visible.find(:all,
|
||
|
:conditions => {:parent_id => options[:parent]},
|
||
|
:include => [:parent, :status, :tracker, :priority],
|
||
|
:order => "#{Tracker.table_name}.position, #{Issue.table_name}.id").each do |issue|
|
||
|
issues << issue
|
||
|
issues += find_son_issues(options.merge(:parent => issue))
|
||
|
end
|
||
|
issues
|
||
|
end
|
||
|
# Returns the sharings that +user+ can set the version to
|
||
|
def allowed_sharings(user = User.current)
|
||
|
VERSION_SHARINGS.select do |s|
|
||
| app/controllers/versions_controller.rb (working copy) | ||
|---|---|---|
|
end
|
||
|
def show
|
||
|
respond_to do |format|
|
||
|
format.html {
|
||
|
@issues = @version.fixed_issues.visible.
|
||
|
includes(:status, :tracker, :priority).
|
||
|
reorder("#{Tracker.table_name}.position, #{Issue.table_name}.id").
|
||
|
all
|
||
|
}
|
||
|
format.api
|
||
|
end
|
||
|
@issues = @version.sorted_fixed_issues
|
||
|
end
|
||
|
def new
|
||
| app/views/versions/index.html.erb (working copy) | ||
|---|---|---|
|
<%= render :partial => 'versions/overview', :locals => {:version => version} %>
|
||
|
<%= render(:partial => "wiki/content", :locals => {:content => version.wiki_page.content}) if version.wiki_page %>
|
||
|
<% if (issues = @issues_by_version[version]) && issues.size > 0 %>
|
||
|
<% if (issues = version.sorted_fixed_issues) && issues.size > 0 %>
|
||
|
<%= form_tag({}) do -%>
|
||
|
<table class="list related-issues">
|
||
|
<caption><%= l(:label_related_issues) %></caption>
|
||
|
<% issues.each do |issue| -%>
|
||
|
<tr class="hascontextmenu">
|
||
|
<td class="checkbox"><%= check_box_tag 'ids[]', issue.id, false, :id => nil %></td>
|
||
|
<td><%= link_to_issue(issue, :project => (@project != issue.project)) %></td>
|
||
|
<td style="padding-left: <%= issue.parents_count %>em"><%= link_to_issue(issue, :project => (@project != issue.project)) %></td>
|
||
|
</tr>
|
||
|
<% end -%>
|
||
|
</table>
|
||
| app/views/versions/show.html.erb (working copy) | ||
|---|---|---|
|
<%- @issues.each do |issue| -%>
|
||
|
<tr class="hascontextmenu">
|
||
|
<td class="checkbox"><%= check_box_tag 'ids[]', issue.id, false, :id => nil %></td>
|
||
|
<td><%= link_to_issue(issue, :project => (@project != issue.project)) %></td>
|
||
|
<td style="padding-left: <%= issue.parents_count %>em"><%= link_to_issue(issue, :project => (@project != issue.project)) %></td>
|
||
|
</tr>
|
||
|
<% end %>
|
||
|
</table>
|
||
- « Previous
- 1
- 2
- Next »