Patch #5101 » hier-list.patch
| app/controllers/issues_controller.rb | ||
|---|---|---|
|
|
||
|
@issue_count = @query.issue_count
|
||
|
@issue_pages = Paginator.new self, @issue_count, limit, params['page']
|
||
|
hier_sort_clause = sort_clause
|
||
|
if hier_sort_clause == 'issues.id DESC'
|
||
|
hier_sort_clause = 'issues.root_id DESC, issues.lft'
|
||
|
elsif hier_sort_clause == 'issues.id'
|
||
|
hier_sort_clause = 'issues.root_id, issues.lft'
|
||
|
end
|
||
|
@issues = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version],
|
||
|
:order => sort_clause,
|
||
|
:order => hier_sort_clause,
|
||
|
:offset => @issue_pages.current.offset,
|
||
|
:limit => limit)
|
||
|
@issue_count_by_group = @query.issue_count_by_group
|
||
| app/controllers/projects_controller.rb | ||
|---|---|---|
|
issues = version.fixed_issues.visible.find(:all,
|
||
|
:include => [:project, :status, :tracker, :priority],
|
||
|
:conditions => {:tracker_id => @selected_tracker_ids, :project_id => project_ids},
|
||
|
:order => "#{Project.table_name}.lft, #{Tracker.table_name}.position, #{Issue.table_name}.id")
|
||
|
:order => "#{Project.table_name}.lft, #{Tracker.table_name}.position, #{Issue.table_name}.root_id, #{Issue.table_name}.lft")
|
||
|
@issues_by_version[version] = issues
|
||
|
end
|
||
|
end
|
||
| app/helpers/application_helper.rb | ||
|---|---|---|
|
s = link_to "#{issue.tracker} ##{issue.id}", {:controller => "issues", :action => "show", :id => issue},
|
||
|
:class => issue.css_classes,
|
||
|
:title => title
|
||
|
s << ": #{h subject}" if subject
|
||
|
if subject
|
||
|
s << ": "
|
||
|
if options[:indent] == true
|
||
|
s << "<span style=\"padding-left: #{issue.level}em\"></span>"
|
||
|
end
|
||
|
s << "#{h subject}"
|
||
|
end
|
||
|
s = "#{h issue.project} - " + s if options[:project]
|
||
|
s
|
||
|
end
|
||
| app/models/issue.rb | ||
|---|---|---|
|
def estimated_hours=(h)
|
||
|
write_attribute :estimated_hours, (h.is_a?(String) ? h.to_hours : h)
|
||
|
end
|
||
|
|
||
|
SAFE_ATTRIBUTES = %w(
|
||
|
tracker_id
|
||
|
status_id
|
||
| ... | ... | |
|
done_ratio
|
||
|
estimated_hours
|
||
|
custom_field_values
|
||
|
level
|
||
|
) unless const_defined?(:SAFE_ATTRIBUTES)
|
||
|
|
||
|
# Safely sets attributes
|
||
| app/views/issues/_list.rhtml | ||
|---|---|---|
|
<tr id="issue-<%= issue.id %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= issue.css_classes %>">
|
||
|
<td class="checkbox"><%= check_box_tag("ids[]", issue.id, false, :id => nil) %></td>
|
||
|
<td><%= link_to issue.id, :controller => 'issues', :action => 'show', :id => issue %></td>
|
||
|
<% query.columns.each do |column| %><%= content_tag 'td', column_content(column, issue), :class => column.name %><% end %>
|
||
|
<% query.columns.each do |column| %>
|
||
|
<%
|
||
|
if column.name == :subject
|
||
|
indent = "padding-left: #{issue.level}em"
|
||
|
else
|
||
|
indent = ""
|
||
|
end
|
||
|
%>
|
||
|
<%= content_tag 'td', column_content(column, issue), :style => indent, :class => column.name %>
|
||
|
<% end %>
|
||
|
</tr>
|
||
|
<% end -%>
|
||
|
</tbody>
|
||
| app/views/projects/roadmap.rhtml | ||
|---|---|---|
|
<%- issues.each do |issue| -%>
|
||
|
<tr class="hascontextmenu">
|
||
|
<td class="checkbox"><%= check_box_tag 'ids[]', issue.id %></td>
|
||
|
<td><%= link_to_issue(issue, :project => (@project != issue.project)) %></td>
|
||
|
<td><%= link_to_issue(issue, {:project => (@project != issue.project), :indent => true}) %></td>
|
||
|
</tr>
|
||
|
<%- end -%>
|
||
|
</table>
|
||