Project

General

Profile

Feature #6687 » no_priority_rollup.diff

No priority rollup patch. - Chris Wolf, 2011-04-28 20:29

View differences:

models/issue.rb 2011-04-28 14:20:34.804207000 -0400
264 264
    end
265 265
    
266 266
    unless leaf?
267
      attrs.reject! {|k,v| %w(priority_id done_ratio start_date due_date estimated_hours).include?(k)}
267
      # NO-PRIORITY-ROLLUP, allow priority to be updated independently in parent
268
	  #attrs.reject! {|k,v| %w(priority_id done_ratio start_date due_date estimated_hours).include?(k)}
269
      attrs.reject! {|k,v| %w(done_ratio start_date due_date estimated_hours).include?(k)}
268 270
    end
269 271
    
270 272
    if attrs.has_key?('parent_issue_id')
......
325 327
    # Checks parent issue assignment
326 328
    if @parent_issue
327 329
      if @parent_issue.project_id != project_id
328
        errors.add :parent_issue_id, :not_same_project
330
        # Comment out to add Redmine Feature #5487 - cwolf
331
		#errors.add :parent_issue_id, :not_same_project
329 332
      elsif !new_record?
330 333
        # moving an existing issue
331 334
        if @parent_issue.root_id != root_id
......
720 723

  
721 724
  def recalculate_attributes_for(issue_id)
722 725
    if issue_id && p = Issue.find_by_id(issue_id)
723
      # priority = highest priority of children
724
      if priority_position = p.children.maximum("#{IssuePriority.table_name}.position", :include => :priority)
725
        p.priority = IssuePriority.find_by_position(priority_position)
726
      end
726
	  # NO-PRIORITY-ROLLUP, comment out this if-block to allow priority to be updated independently in parent
727
      # priority = highest priority of childre
728
      #if priority_position = p.children.maximum("#{IssuePriority.table_name}.position", :include => :priority)
729
      #  p.priority = IssuePriority.find_by_position(priority_position)
730
      #end
727 731
      
728 732
      # start/due dates = lowest/highest dates of children
729 733
      p.start_date = p.children.minimum(:start_date)
730
-- views/issues/_attributes.rhtml.orig	2011-03-07 20:41:00.000000000 -0500
734
++ views/issues/_attributes.rhtml	2011-04-28 14:13:19.554207000 -0400
......
7 7
<p><label><%= l(:field_status) %></label> <%= @issue.status.name %></p>
8 8
<% end %>
9 9

  
10
<p><%= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), {:required => true}, :disabled => !@issue.leaf? %></p>
10
<!-- NO-PRIORITY-ROLLUP, allow priority to be updated independently in parent -->
11
<!--p><%# f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), {:required => true}, :disabled => !@issue.leaf? %></p-->
12
<p><%= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), :required => true %></p>
11 13
<p><%= f.select :assigned_to_id, (@issue.assignable_users.collect {|m| [m.name, m.id]}), :include_blank => true %></p>
12 14
<% unless @project.issue_categories.empty? %>
13 15
<p><%= f.select :category_id, (@project.issue_categories.collect {|c| [c.name, c.id]}), :include_blank => true %>
(1-1/4)