Project

General

Profile

Patch #32109 » obey-subtask-settings-411.patch

Applies the settings of the sub-task to a new issue in 4.1.1 - Anonymous, 2021-04-12 10:08

View differences:

app/models/issue.rb (working copy)
1515 1515

  
1516 1516
  # Returns a scope of projects that user can assign the issue to
1517 1517
  def allowed_target_projects(user=User.current, context=nil)
1518
    if new_record? && context.is_a?(Project) && !copy?
1519
      current_project = context.self_and_descendants
1520
    elsif new_record?
1521
      current_project = nil
1522
    else
1523
      current_project = project
1524
    end
1518
      case Setting.cross_project_subtasks
1519
      when 'system'
1520
        current_project = nil
1521
      when 'tree'
1522
        current_project = context.root.self_and_descendants
1523
      when 'hierarchy'
1524
        current_project = context.hierarchy
1525
      when 'descendants'
1526
        current_project = context.self_and_descendants
1527
      else
1528
        current_project = nil
1529
      end
1525 1530

  
1526 1531
    self.class.allowed_target_projects(user, current_project)
1527 1532
  end
1528 1533
 
1529 1534
    
(2-2/3)