summaryrefslogtreecommitdiffstats
path: root/app/controllers/workflows_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-07-15 15:46:14 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-07-15 15:46:14 +0000
commita7bdc5e0afdfa56f2087faf6463926261713694d (patch)
tree61a8c765fc9b821431d6a7dc1054a150eef233a8 /app/controllers/workflows_controller.rb
parent712e5be29f9afccfa353d315fc6b664bdcdf8057 (diff)
downloadredmine-a7bdc5e0afdfa56f2087faf6463926261713694d.tar.gz
redmine-a7bdc5e0afdfa56f2087faf6463926261713694d.zip
Adds option for displaying all statuses on workflow permissions.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9995 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/workflows_controller.rb')
-rw-r--r--app/controllers/workflows_controller.rb20
1 files changed, 11 insertions, 9 deletions
diff --git a/app/controllers/workflows_controller.rb b/app/controllers/workflows_controller.rb
index 727bde68f..7f397bc4e 100644
--- a/app/controllers/workflows_controller.rb
+++ b/app/controllers/workflows_controller.rb
@@ -62,17 +62,19 @@ class WorkflowsController < ApplicationController
@role = Role.find_by_id(params[:role_id]) if params[:role_id]
@tracker = Tracker.find_by_id(params[:tracker_id]) if params[:tracker_id]
- if @role && @tracker
- if request.post?
- WorkflowPermission.replace_permissions(@tracker, @role, params[:permissions] || {})
- redirect_to :action => 'permissions', :role_id => @role, :tracker_id => @tracker
- return
- end
+ if request.post? && @role && @tracker
+ WorkflowPermission.replace_permissions(@tracker, @role, params[:permissions] || {})
+ redirect_to :action => 'permissions', :role_id => @role, :tracker_id => @tracker
+ return
+ end
+ @used_statuses_only = (params[:used_statuses_only] == '0' ? false : true)
+ if @tracker && @used_statuses_only && @tracker.issue_statuses.any?
@statuses = @tracker.issue_statuses
- if @statuses.empty?
- @statuses = IssueStatus.sorted.all
- end
+ end
+ @statuses ||= IssueStatus.sorted.all
+
+ if @role && @tracker
@fields = (Tracker::CORE_FIELDS_ALL - @tracker.disabled_core_fields).map {|field| [field, l("field_"+field.sub(/_id$/, ''))]}
@custom_fields = @tracker.custom_fields