summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-01-06 20:24:26 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-01-06 20:24:26 +0000
commita80dbc49b1670877aca09b11101d4a5b40ea58c2 (patch)
treead81a0601a377471558b561c08be9956cd1b008a /app/controllers
parent78d9ae9754578cda4b72d7b28a4f707534c15c49 (diff)
downloadredmine-a80dbc49b1670877aca09b11101d4a5b40ea58c2.tar.gz
redmine-a80dbc49b1670877aca09b11101d4a5b40ea58c2.zip
Admin settings screen split to tabs.
Email notification options moved to this view as a tab and LDAP list is accessible from the 'Authentication' tab. git-svn-id: http://redmine.rubyforge.org/svn/trunk@1046 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/admin_controller.rb13
-rw-r--r--app/controllers/settings_controller.rb13
2 files changed, 11 insertions, 15 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index 9e6a22822..e002f3a27 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -45,17 +45,6 @@ class AdminController < ApplicationController
render :action => "projects", :layout => false if request.xhr?
end
-
- def mail_options
- @notifiables = %w(issue_added issue_updated news_added document_added file_added message_posted)
- if request.post?
- settings = (params[:settings] || {}).dup.symbolize_keys
- settings[:notified_events] ||= []
- settings.each { |name, value| Setting[name] = value }
- flash[:notice] = l(:notice_successful_update)
- redirect_to :controller => 'admin', :action => 'mail_options'
- end
- end
# Loads the default configuration
# (roles, trackers, statuses, workflow, enumerations)
@@ -82,7 +71,7 @@ class AdminController < ApplicationController
flash[:error] = l(:notice_email_error, e.message)
end
ActionMailer::Base.raise_delivery_errors = raise_delivery_errors
- redirect_to :action => 'mail_options'
+ redirect_to :controller => 'settings', :action => 'edit', :tab => 'notifications'
end
def info
diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb
index 09af63176..c5fae2a16 100644
--- a/app/controllers/settings_controller.rb
+++ b/app/controllers/settings_controller.rb
@@ -25,9 +25,16 @@ class SettingsController < ApplicationController
end
def edit
- if request.post? and params[:settings] and params[:settings].is_a? Hash
- params[:settings].each { |name, value| Setting[name] = value }
- redirect_to :action => 'edit' and return
+ @notifiables = %w(issue_added issue_updated news_added document_added file_added message_posted)
+ if request.post? && params[:settings] && params[:settings].is_a?(Hash)
+ settings = (params[:settings] || {}).dup.symbolize_keys
+ settings.each do |name, value|
+ # remove blank values in array settings
+ value.delete_if {|v| v.blank? } if value.is_a?(Array)
+ Setting[name] = value
+ end
+ flash[:notice] = l(:notice_successful_update)
+ redirect_to :action => 'edit', :tab => params[:tab]
end
end