##// END OF EJS Templates
Don't show roles without issue add/edit permission in workflow setup (#15988)....
Jean-Philippe Lang -
r13366:c886ffe200a4
parent child
Show More
@@ -72,7 +72,7 class WorkflowsController < ApplicationController
72 72 end
73 73
74 74 def copy
75 @roles = Role.sorted
75 @roles = Role.sorted.select(&:consider_workflow?)
76 76 @trackers = Tracker.sorted
77 77
78 78 if params[:source_tracker_id].blank? || params[:source_tracker_id] == 'any'
@@ -36,7 +36,7 class WorkflowRule < ActiveRecord::Base
36 36 target_roles = [target_roles].flatten.compact
37 37
38 38 target_trackers = Tracker.sorted.to_a if target_trackers.empty?
39 target_roles = Role.all if target_roles.empty?
39 target_roles = Role.all.select(&:consider_workflow?) if target_roles.empty?
40 40
41 41 target_trackers.each do |target_tracker|
42 42 target_roles.each do |target_role|
@@ -21,7 +21,7 class WorkflowTransition < WorkflowRule
21 21 # Returns workflow transitions count by tracker and role
22 22 def self.count_by_tracker_and_role
23 23 counts = connection.select_all("SELECT role_id, tracker_id, count(id) AS c FROM #{table_name} WHERE type = 'WorkflowTransition' GROUP BY role_id, tracker_id")
24 roles = Role.sorted
24 roles = Role.sorted.to_a.select(&:consider_workflow?)
25 25 trackers = Tracker.sorted
26 26 result = []
27 27 trackers.each do |tracker|
@@ -14,7 +14,7
14 14 <%= form_tag({}, :method => 'get') do %>
15 15 <p>
16 16 <label><%=l(:label_role)%>:
17 <%= options_for_workflow_select 'role_id[]', Role.sorted, @roles, :id => 'role_id', :class => 'expandable' %>
17 <%= options_for_workflow_select 'role_id[]', Role.sorted.select(&:consider_workflow?), @roles, :id => 'role_id', :class => 'expandable' %>
18 18 </label>
19 19 <a href="#" data-expands="#role_id"><%= image_tag 'bullet_toggle_plus.png' %></a>
20 20
@@ -14,7 +14,7
14 14 <%= form_tag({}, :method => 'get') do %>
15 15 <p>
16 16 <label><%=l(:label_role)%>:
17 <%= options_for_workflow_select 'role_id[]', Role.sorted, @roles, :id => 'role_id', :class => 'expandable' %>
17 <%= options_for_workflow_select 'role_id[]', Role.sorted.select(&:consider_workflow?), @roles, :id => 'role_id', :class => 'expandable' %>
18 18 </label>
19 19 <a href="#" data-expands="#role_id"><%= image_tag 'bullet_toggle_plus.png' %></a>
20 20
General Comments 0
You need to be logged in to leave comments. Login now