Patch #32109

Updated by Go MAEDA almost 3 years ago

There have been previous efforts to improve sub-task management, but they lack support for cross-project sharing setting.

Below is a patch which has been tested manually. Some extra test case are desired, but I would be unable to help more unfortunately.

<pre><code class="diff"> ```patch
Index: app/models/issue.rb
===================================================================
--- app/models/issue.rb (revision 18330)
+++ app/models/issue.rb (working copy)
@@ -1509,7 +1509,18 @@
# Returns a scope of projects that user can assign the issue to
def allowed_target_projects(user=User.current, context=nil)
if new_record? && context.is_a?(Project) && !copy?
- current_project = context.self_and_descendants
+ case Setting.cross_project_subtasks
+ when 'system'
+ current_project = nil
+ when 'tree'
+ current_project = context.root.self_and_descendants
+ when 'hierarchy'
+ current_project = context.hierarchy
+ when 'descendants'
+ current_project = context.self_and_descendants
+ else
+ current_project = nil
+ end
elsif new_record?
current_project = nil
else
</code></pre> ```

Back