summaryrefslogtreecommitdiffstats
path: root/app/helpers/issues_helper.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2021-01-01 00:59:07 +0000
committerGo MAEDA <maeda@farend.jp>2021-01-01 00:59:07 +0000
commit3f3514d8b1a6c7db39c7b0e180598437a210fac0 (patch)
tree39b2f8498584ffa36ff07baff92a38e6bf5bdc35 /app/helpers/issues_helper.rb
parent2ee2b349879a0816fc49700fade0be1750a6fa87 (diff)
downloadredmine-3f3514d8b1a6c7db39c7b0e180598437a210fac0.tar.gz
redmine-3f3514d8b1a6c7db39c7b0e180598437a210fac0.zip
Show only valid projects on issue form when the issue is a subtask (#33419).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@20701 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/issues_helper.rb')
-rw-r--r--app/helpers/issues_helper.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index 808842325..4a9e7a2aa 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -696,4 +696,14 @@ module IssuesHelper
user_default_tab
end
end
+
+ def projects_for_select(issue)
+ if issue.parent_issue_id.present?
+ issue.allowed_target_projects_for_subtask(User.current)
+ elsif issue.new_record? && !issue.copy?
+ issue.allowed_target_projects(User.current, 'descendants')
+ else
+ issue.allowed_target_projects(User.current)
+ end
+ end
end