Commit afe5a2b2 authored by Eric Davis's avatar Eric Davis

Merge branch 'ticket/master/347-execution-after-redirect'

parents 65692235 d2973a64
...@@ -274,6 +274,7 @@ class ApplicationController < ActionController::Base ...@@ -274,6 +274,7 @@ class ApplicationController < ActionController::Base
end end
end end
redirect_to default redirect_to default
false
end end
def render_403(options={}) def render_403(options={})
......
...@@ -38,9 +38,10 @@ class CustomFieldsController < ApplicationController ...@@ -38,9 +38,10 @@ class CustomFieldsController < ApplicationController
flash[:notice] = l(:notice_successful_create) flash[:notice] = l(:notice_successful_create)
call_hook(:controller_custom_fields_new_after_save, :params => params, :custom_field => @custom_field) call_hook(:controller_custom_fields_new_after_save, :params => params, :custom_field => @custom_field)
redirect_to :action => 'index', :tab => @custom_field.class.name redirect_to :action => 'index', :tab => @custom_field.class.name
end else
@trackers = Tracker.find(:all, :order => 'position') @trackers = Tracker.find(:all, :order => 'position')
end end
end
def edit def edit
@custom_field = CustomField.find(params[:id]) @custom_field = CustomField.find(params[:id])
...@@ -48,9 +49,10 @@ class CustomFieldsController < ApplicationController ...@@ -48,9 +49,10 @@ class CustomFieldsController < ApplicationController
flash[:notice] = l(:notice_successful_update) flash[:notice] = l(:notice_successful_update)
call_hook(:controller_custom_fields_edit_after_save, :params => params, :custom_field => @custom_field) call_hook(:controller_custom_fields_edit_after_save, :params => params, :custom_field => @custom_field)
redirect_to :action => 'index', :tab => @custom_field.class.name redirect_to :action => 'index', :tab => @custom_field.class.name
end else
@trackers = Tracker.find(:all, :order => 'position') @trackers = Tracker.find(:all, :order => 'position')
end end
end
def destroy def destroy
@custom_field = CustomField.find(params[:id]).destroy @custom_field = CustomField.find(params[:id]).destroy
......
...@@ -75,10 +75,12 @@ class EnumerationsController < ApplicationController ...@@ -75,10 +75,12 @@ class EnumerationsController < ApplicationController
# No associated objects # No associated objects
@enumeration.destroy @enumeration.destroy
redirect_to :action => 'index' redirect_to :action => 'index'
return
elsif params[:reassign_to_id] elsif params[:reassign_to_id]
if reassign_to = @enumeration.class.find_by_id(params[:reassign_to_id]) if reassign_to = @enumeration.class.find_by_id(params[:reassign_to_id])
@enumeration.destroy(reassign_to) @enumeration.destroy(reassign_to)
redirect_to :action => 'index' redirect_to :action => 'index'
return
end end
end end
@enumerations = @enumeration.class.find(:all) - [@enumeration] @enumerations = @enumeration.class.find(:all) - [@enumeration]
......
...@@ -65,10 +65,12 @@ class IssueCategoriesController < ApplicationController ...@@ -65,10 +65,12 @@ class IssueCategoriesController < ApplicationController
# No issue assigned to this category # No issue assigned to this category
@category.destroy @category.destroy
redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'categories' redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'categories'
return
elsif params[:todo] elsif params[:todo]
reassign_to = @project.issue_categories.find_by_id(params[:reassign_to_id]) if params[:todo] == 'reassign' reassign_to = @project.issue_categories.find_by_id(params[:reassign_to_id]) if params[:todo] == 'reassign'
@category.destroy(reassign_to) @category.destroy(reassign_to)
redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'categories' redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'categories'
return
end end
@categories = @project.issue_categories - [@category] @categories = @project.issue_categories - [@category]
end end
......
...@@ -38,19 +38,21 @@ class RolesController < ApplicationController ...@@ -38,19 +38,21 @@ class RolesController < ApplicationController
end end
flash[:notice] = l(:notice_successful_create) flash[:notice] = l(:notice_successful_create)
redirect_to :action => 'index' redirect_to :action => 'index'
end else
@permissions = @role.setable_permissions @permissions = @role.setable_permissions
@roles = Role.find :all, :order => 'builtin, position' @roles = Role.find :all, :order => 'builtin, position'
end end
end
def edit def edit
@role = Role.find(params[:id]) @role = Role.find(params[:id])
if request.post? and @role.update_attributes(params[:role]) if request.post? and @role.update_attributes(params[:role])
flash[:notice] = l(:notice_successful_update) flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'index' redirect_to :action => 'index'
end else
@permissions = @role.setable_permissions @permissions = @role.setable_permissions
end end
end
def destroy def destroy
@role = Role.find(params[:id]) @role = Role.find(params[:id])
......
...@@ -36,8 +36,7 @@ class SettingsController < ApplicationController ...@@ -36,8 +36,7 @@ class SettingsController < ApplicationController
end end
flash[:notice] = l(:notice_successful_update) flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'edit', :tab => params[:tab] redirect_to :action => 'edit', :tab => params[:tab]
return else
end
@options = {} @options = {}
@options[:user_format] = User::USER_FORMATS.keys.collect {|f| [User.current.name(f), f.to_s] } @options[:user_format] = User::USER_FORMATS.keys.collect {|f| [User.current.name(f), f.to_s] }
@deliveries = ActionMailer::Base.perform_deliveries @deliveries = ActionMailer::Base.perform_deliveries
...@@ -47,6 +46,7 @@ class SettingsController < ApplicationController ...@@ -47,6 +46,7 @@ class SettingsController < ApplicationController
Redmine::Themes.rescan Redmine::Themes.rescan
end end
end
def plugin def plugin
@plugin = Redmine::Plugin.find(params[:id]) @plugin = Redmine::Plugin.find(params[:id])
...@@ -54,9 +54,10 @@ class SettingsController < ApplicationController ...@@ -54,9 +54,10 @@ class SettingsController < ApplicationController
Setting["plugin_#{@plugin.id}"] = params[:settings] Setting["plugin_#{@plugin.id}"] = params[:settings]
flash[:notice] = l(:notice_successful_update) flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'plugin', :id => @plugin.id redirect_to :action => 'plugin', :id => @plugin.id
end else
@partial = @plugin.settings[:partial] @partial = @plugin.settings[:partial]
@settings = Setting["plugin_#{@plugin.id}"] @settings = Setting["plugin_#{@plugin.id}"]
end
rescue Redmine::PluginNotFound rescue Redmine::PluginNotFound
render_404 render_404
end end
......
...@@ -22,7 +22,7 @@ require 'roles_controller' ...@@ -22,7 +22,7 @@ require 'roles_controller'
class RolesController; def rescue_action(e) raise e end; end class RolesController; def rescue_action(e) raise e end; end
class RolesControllerTest < ActionController::TestCase class RolesControllerTest < ActionController::TestCase
fixtures :roles, :users, :members, :member_roles, :workflows fixtures :roles, :users, :members, :member_roles, :workflows, :trackers
def setup def setup
@controller = RolesController.new @controller = RolesController.new
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment