Feature #5490 » defang_children.diff
| app/models/issue.rb | ||
|---|---|---|
| 69 | 69 | |
| 70 | 70 |
before_create :default_assign |
| 71 | 71 |
before_save :reschedule_following_issues, :close_duplicates, :update_done_ratio_from_issue_status |
| 72 |
after_save :update_nested_set_attributes, :update_parent_attributes, :create_journal |
|
| 72 |
# HACK! |
|
| 73 |
# This prevents a child issue from updating its parents. |
|
| 74 |
after_save :update_nested_set_attributes, :create_journal |
|
| 75 |
# We've retained the original line below: |
|
| 76 |
# after_save :update_nested_set_attributes, :update_parent_attributes, :create_journal |
|
| 73 | 77 |
after_destroy :destroy_children |
| 74 |
after_destroy :update_parent_attributes |
|
| 78 |
# HACK! |
|
| 79 |
# Commenting this line prevents a child issue from updating its parents. |
|
| 80 |
# after_destroy :update_parent_attributes |
|
| 75 | 81 |
|
| 76 | 82 |
# Returns true if usr or current user is allowed to view the issue |
| 77 | 83 |
def visible?(usr=nil) |
| 78 | 84 |
(usr || User.current).allowed_to?(:view_issues, self.project) |
| 79 | 85 |
end |
| 80 | 86 |
|
| 87 |
# HACK! |
|
| 88 |
# This forces Redmine to believe the issue has no children, |
|
| 89 |
# allowing us to update priority and due dates manually. |
|
| 90 |
# WARNING: There are some unintended consequences: children are not deleted, etc. |
|
| 91 |
def leaf? |
|
| 92 |
true |
|
| 93 |
end |
|
| 94 |
|
|
| 81 | 95 |
def after_initialize |
| 82 | 96 |
if new_record? |
| 83 | 97 |
# set default values for new records only |
| app/views/issues/show.rhtml | ||
|---|---|---|
| 1 | 1 |
<%= render :partial => 'action_menu' %> |
| 2 | 2 | |
| 3 |
<%= debug @priorities %> |
|
| 4 | ||
| 3 | 5 |
<h2><%= @issue.tracker.name %> #<%= @issue.id %></h2> |
| 4 | 6 | |
| 5 | 7 |
<div class="<%= @issue.css_classes %> details"> |