Project

General

Profile

Feature #5490 » defang_children.diff

Michael Hellein, 2010-06-26 20:40

View differences:

app/models/issue.rb
before_create :default_assign
before_save :reschedule_following_issues, :close_duplicates, :update_done_ratio_from_issue_status
after_save :update_nested_set_attributes, :update_parent_attributes, :create_journal
# HACK!
# This prevents a child issue from updating its parents.
after_save :update_nested_set_attributes, :create_journal
# We've retained the original line below:
# after_save :update_nested_set_attributes, :update_parent_attributes, :create_journal
after_destroy :destroy_children
after_destroy :update_parent_attributes
# HACK!
# Commenting this line prevents a child issue from updating its parents.
# after_destroy :update_parent_attributes
# Returns true if usr or current user is allowed to view the issue
def visible?(usr=nil)
(usr || User.current).allowed_to?(:view_issues, self.project)
end
# HACK!
# This forces Redmine to believe the issue has no children,
# allowing us to update priority and due dates manually.
# WARNING: There are some unintended consequences: children are not deleted, etc.
def leaf?
true
end
def after_initialize
if new_record?
# set default values for new records only
app/views/issues/show.rhtml
<%= render :partial => 'action_menu' %>
<%= debug @priorities %>
<h2><%= @issue.tracker.name %> #<%= @issue.id %></h2>
<div class="<%= @issue.css_classes %> details">
(1-1/9)