summaryrefslogtreecommitdiffstats
path: root/app/controllers/workflows_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-12-16 08:32:35 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-12-16 08:32:35 +0000
commit68c7f4ef208524e0c9f866cebac4ba349b944b23 (patch)
treeee96710da2f3ccfc8d9a512459e482bf5b85af66 /app/controllers/workflows_controller.rb
parentaf7ba4ad53a67cedd555fb75b4775ec47b4b029c (diff)
downloadredmine-68c7f4ef208524e0c9f866cebac4ba349b944b23.tar.gz
redmine-68c7f4ef208524e0c9f866cebac4ba349b944b23.zip
Workflow editing shows statuses of irrelevant roles (#24281).
Patch by Jens Krämer. git-svn-id: http://svn.redmine.org/redmine/trunk@16081 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/workflows_controller.rb')
-rw-r--r--app/controllers/workflows_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/workflows_controller.rb b/app/controllers/workflows_controller.rb
index e825171bf..dd75860ff 100644
--- a/app/controllers/workflows_controller.rb
+++ b/app/controllers/workflows_controller.rb
@@ -138,7 +138,11 @@ class WorkflowsController < ApplicationController
def find_statuses
@used_statuses_only = (params[:used_statuses_only] == '0' ? false : true)
if @trackers && @used_statuses_only
- @statuses = @trackers.map(&:issue_statuses).flatten.uniq.sort.presence
+ role_ids = Role.all.select(&:consider_workflow?).map(&:id)
+ status_ids = WorkflowTransition.where(
+ :tracker_id => @trackers.map(&:id), :role_id => role_ids
+ ).uniq.pluck(:old_status_id, :new_status_id).flatten.uniq
+ @statuses = IssueStatus.where(:id => status_ids).sorted.to_a.presence
end
@statuses ||= IssueStatus.sorted.to_a
end