##// END OF EJS Templates
User custom fields can now be set as editable so that users can edit them on 'My account'....
User custom fields can now be set as editable so that users can edit them on 'My account'. For existing user custom fields, this new attribute is set to false by default to preserve the prior behaviour (it can turned on by editing the custom field in admin area). Note: on the registration form, *required* custom fields will be displayed even if they are not defined as editable so that the account can be created. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2276 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r2232:260373aed71e
r2274:12792d8068d0
Show More
settings_controller.rb
59 lines | 2.2 KiB | text/x-ruby | RubyLexer
/ app / controllers / settings_controller.rb
Jean-Philippe Lang
settings are now stored in the database (config_custom.rb no more used) and editable through the application in: Admin -> Settings...
r164 # redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
Jean-Philippe Lang
Host setting should contain the path prefix (Redmine base URL) to properly generate links in emails that are sent offline (#2122)....
r1987 #
Jean-Philippe Lang
settings are now stored in the database (config_custom.rb no more used) and editable through the application in: Admin -> Settings...
r164 # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
Jean-Philippe Lang
Host setting should contain the path prefix (Redmine base URL) to properly generate links in emails that are sent offline (#2122)....
r1987 #
Jean-Philippe Lang
settings are now stored in the database (config_custom.rb no more used) and editable through the application in: Admin -> Settings...
r164 # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class SettingsController < ApplicationController
before_filter :require_admin
Jean-Philippe Lang
Host setting should contain the path prefix (Redmine base URL) to properly generate links in emails that are sent offline (#2122)....
r1987
Jean-Philippe Lang
settings are now stored in the database (config_custom.rb no more used) and editable through the application in: Admin -> Settings...
r164 def index
edit
render :action => 'edit'
end
def edit
Jean-Philippe Lang
Admin settings screen split to tabs....
r1033 @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]
Jean-Philippe Lang
User display format is now configurable in administration settings....
r1089 return
Jean-Philippe Lang
settings are now stored in the database (config_custom.rb no more used) and editable through the application in: Admin -> Settings...
r164 end
Jean-Philippe Lang
User display format is now configurable in administration settings....
r1089 @options = {}
@options[:user_format] = User::USER_FORMATS.keys.collect {|f| [User.current.name(f), f.to_s] }
Jean-Philippe Lang
Email delivery configuration moved to an unversioned YAML file (config/email.yml, see the sample file) (#1412)....
r1611 @deliveries = ActionMailer::Base.perform_deliveries
Jean-Philippe Lang
Host setting should contain the path prefix (Redmine base URL) to properly generate links in emails that are sent offline (#2122)....
r1987
@guessed_host_and_path = request.host_with_port
Jean-Philippe Lang
Slight changes to ease Rails 2.2 support....
r2232 @guessed_host_and_path << ('/'+ Redmine::Utils.relative_url_root.gsub(%r{^\/}, '')) unless Redmine::Utils.relative_url_root.blank?
Jean-Philippe Lang
settings are now stored in the database (config_custom.rb no more used) and editable through the application in: Admin -> Settings...
r164 end
Jean-Philippe Lang
Host setting should contain the path prefix (Redmine base URL) to properly generate links in emails that are sent offline (#2122)....
r1987
Jean-Philippe Lang
Basic plugin support....
r741 def plugin
Jean-Philippe Lang
Adds .find and .all Plugin class methods....
r2037 @plugin = Redmine::Plugin.find(params[:id])
Jean-Philippe Lang
Basic plugin support....
r741 if request.post?
Jean-Philippe Lang
Adds .find and .all Plugin class methods....
r2037 Setting["plugin_#{@plugin.id}"] = params[:settings]
Jean-Philippe Lang
Basic plugin support....
r741 flash[:notice] = l(:notice_successful_update)
Jean-Philippe Lang
Adds .find and .all Plugin class methods....
r2037 redirect_to :action => 'plugin', :id => @plugin.id
Jean-Philippe Lang
Basic plugin support....
r741 end
Jean-Philippe Lang
Fixed: Plugin's setting page is broken after upgrading to rails 2.1.0 (#1620)....
r1642 @partial = @plugin.settings[:partial]
Jean-Philippe Lang
Adds .find and .all Plugin class methods....
r2037 @settings = Setting["plugin_#{@plugin.id}"]
rescue Redmine::PluginNotFound
render_404
Jean-Philippe Lang
Basic plugin support....
r741 end
Jean-Philippe Lang
settings are now stored in the database (config_custom.rb no more used) and editable through the application in: Admin -> Settings...
r164 end