mirror of
https://github.com/redmine/redmine.git
synced 2025-12-16 05:20:28 +01:00
code layout clean up app/controllers/workflows_controller.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@19287 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -97,14 +97,18 @@ class WorkflowsController < ApplicationController
|
||||
@target_roles = params[:target_role_ids].blank? ?
|
||||
nil : Role.where(:id => params[:target_role_ids]).to_a
|
||||
if request.post?
|
||||
if params[:source_tracker_id].blank? || params[:source_role_id].blank? || (@source_tracker.nil? && @source_role.nil?)
|
||||
if params[:source_tracker_id].blank? || params[:source_role_id].blank? ||
|
||||
(@source_tracker.nil? && @source_role.nil?)
|
||||
flash.now[:error] = l(:error_workflow_copy_source)
|
||||
elsif @target_trackers.blank? || @target_roles.blank?
|
||||
flash.now[:error] = l(:error_workflow_copy_target)
|
||||
else
|
||||
WorkflowRule.copy(@source_tracker, @source_role, @target_trackers, @target_roles)
|
||||
flash[:notice] = l(:notice_successful_update)
|
||||
redirect_to workflows_copy_path(:source_tracker_id => @source_tracker, :source_role_id => @source_role)
|
||||
redirect_to(
|
||||
workflows_copy_path(:source_tracker_id => @source_tracker,
|
||||
:source_role_id => @source_role)
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user