Project

General

Profile

Actions

Patch #32109

open

Obey sub-task sharing settings on new issue creation

Added by Andrey Galkin about 5 years ago. Updated almost 3 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Issues
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

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.

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

Files

obey-subtask-settings.patch (880 Bytes) obey-subtask-settings.patch Andrey Galkin, 2019-09-22 07:32
obey-subtask-settings-411.patch (1006 Bytes) 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
obey-subtask-settings-411.patch (1.11 KB) obey-subtask-settings-411.patch Anonymous, 2021-04-12 10:58

Related issues

Related to Redmine - Feature #12704: Allow selecting subprojects on new issue formClosedGo MAEDA

Actions
Actions #1

Updated by Andrey Galkin about 5 years ago

Attaching the patch as file as description got screwed.

Actions #2

Updated by Go MAEDA about 5 years ago

  • Description updated (diff)
Actions #3

Updated by Anonymous over 3 years ago

Here is the adaptation to 4.1.1 of this very useful patch.
It applies the settings of the sub-task to a new issue ( « Allow cross-project issue relations » ).

Actions #4

Updated by Anonymous over 3 years ago

Here is the adaptation to 4.1.1 of this very useful patch.
It applies the settings of the sub-task to a new issue ( « Allow cross-project issue relations » ).

Actions #5

Updated by Go MAEDA over 3 years ago

  • Related to Feature #12704: Allow selecting subprojects on new issue form added
Actions #6

Updated by Go MAEDA over 3 years ago

I think this issue was fixed in Redmine 4.2 by #33419. Could you test with Redmine 4.2?

Actions #7

Updated by Anonymous almost 3 years ago

Yes, I confirm !

Actions

Also available in: Atom PDF