Feature #5358 » inherited_categories.diff
app/models/project.rb | ||
---|---|---|
125 | 125 |
end |
126 | 126 |
end |
127 | 127 | |
128 |
def inherited_categories |
|
129 |
self_and_ancestors.inject([]) { |l, p| l += p.issue_categories } |
|
130 |
end |
|
131 | ||
128 | 132 |
def identifier=(identifier) |
129 | 133 |
super unless identifier_frozen? |
130 | 134 |
end |
app/views/issues/_attributes.html.erb | ||
---|---|---|
16 | 16 |
<p><%= f.select :assigned_to_id, principals_options_for_select(@issue.assignable_users, @issue.assigned_to), :include_blank => true %></p> |
17 | 17 |
<% end %> |
18 | 18 | |
19 |
<% if @issue.safe_attribute?('category_id') && @issue.project.issue_categories.any? %>
|
|
20 |
<p><%= f.select :category_id, (@issue.project.issue_categories.collect {|c| [c.name, c.id]}), :include_blank => true %>
|
|
19 |
<% if @issue.safe_attribute?('category_id') && @issue.project.inherited_categories.any? %>
|
|
20 |
<p><%= f.select :category_id, (@issue.project.inherited_categories.collect {|c| [c.name, c.id]}), :include_blank => true %>
|
|
21 | 21 |
<%= prompt_to_remote(image_tag('add.png', :style => 'vertical-align: middle;'), |
22 | 22 |
l(:label_issue_category_new), |
23 | 23 |
'issue_category[name]', |