annotate .svn/pristine/b8/b89495372bc55506424effd6c3e5df5c0cb09a12.svn-base @ 1524:82fac3dcf466 redmine-2.5-integration

Fix failure to interpret Javascript when autocompleting members for project
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Thu, 11 Sep 2014 10:24:38 +0100
parents b450a9d58aed
children
rev   line source
Chris@1516 1 # Redmine - project management software
Chris@1516 2 # Copyright (C) 2006-2014 Jean-Philippe Lang
Chris@1516 3 #
Chris@1516 4 # This program is free software; you can redistribute it and/or
Chris@1516 5 # modify it under the terms of the GNU General Public License
Chris@1516 6 # as published by the Free Software Foundation; either version 2
Chris@1516 7 # of the License, or (at your option) any later version.
Chris@1516 8 #
Chris@1516 9 # This program is distributed in the hope that it will be useful,
Chris@1516 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
Chris@1516 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Chris@1516 12 # GNU General Public License for more details.
Chris@1516 13 #
Chris@1516 14 # You should have received a copy of the GNU General Public License
Chris@1516 15 # along with this program; if not, write to the Free Software
Chris@1516 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Chris@1516 17
Chris@1516 18 class AdminController < ApplicationController
Chris@1516 19 layout 'admin'
Chris@1516 20 menu_item :projects, :only => :projects
Chris@1516 21 menu_item :plugins, :only => :plugins
Chris@1516 22 menu_item :info, :only => :info
Chris@1516 23
Chris@1516 24 before_filter :require_admin
Chris@1516 25 helper :sort
Chris@1516 26 include SortHelper
Chris@1516 27
Chris@1516 28 def index
Chris@1516 29 @no_configuration_data = Redmine::DefaultData::Loader::no_data?
Chris@1516 30 end
Chris@1516 31
Chris@1516 32 def projects
Chris@1516 33 @status = params[:status] || 1
Chris@1516 34
Chris@1516 35 scope = Project.status(@status).order('lft')
Chris@1516 36 scope = scope.like(params[:name]) if params[:name].present?
Chris@1516 37 @projects = scope.all
Chris@1516 38
Chris@1516 39 render :action => "projects", :layout => false if request.xhr?
Chris@1516 40 end
Chris@1516 41
Chris@1516 42 def plugins
Chris@1516 43 @plugins = Redmine::Plugin.all
Chris@1516 44 end
Chris@1516 45
Chris@1516 46 # Loads the default configuration
Chris@1516 47 # (roles, trackers, statuses, workflow, enumerations)
Chris@1516 48 def default_configuration
Chris@1516 49 if request.post?
Chris@1516 50 begin
Chris@1516 51 Redmine::DefaultData::Loader::load(params[:lang])
Chris@1516 52 flash[:notice] = l(:notice_default_data_loaded)
Chris@1516 53 rescue Exception => e
Chris@1516 54 flash[:error] = l(:error_can_t_load_default_data, e.message)
Chris@1516 55 end
Chris@1516 56 end
Chris@1516 57 redirect_to admin_path
Chris@1516 58 end
Chris@1516 59
Chris@1516 60 def test_email
Chris@1516 61 raise_delivery_errors = ActionMailer::Base.raise_delivery_errors
Chris@1516 62 # Force ActionMailer to raise delivery errors so we can catch it
Chris@1516 63 ActionMailer::Base.raise_delivery_errors = true
Chris@1516 64 begin
Chris@1516 65 @test = Mailer.test_email(User.current).deliver
Chris@1516 66 flash[:notice] = l(:notice_email_sent, User.current.mail)
Chris@1516 67 rescue Exception => e
Chris@1516 68 flash[:error] = l(:notice_email_error, Redmine::CodesetUtil.replace_invalid_utf8(e.message.dup))
Chris@1516 69 end
Chris@1516 70 ActionMailer::Base.raise_delivery_errors = raise_delivery_errors
Chris@1516 71 redirect_to settings_path(:tab => 'notifications')
Chris@1516 72 end
Chris@1516 73
Chris@1516 74 def info
Chris@1516 75 @db_adapter_name = ActiveRecord::Base.connection.adapter_name
Chris@1516 76 @checklist = [
Chris@1516 77 [:text_default_administrator_account_changed, User.default_admin_account_changed?],
Chris@1516 78 [:text_file_repository_writable, File.writable?(Attachment.storage_path)],
Chris@1516 79 [:text_plugin_assets_writable, File.writable?(Redmine::Plugin.public_directory)],
Chris@1516 80 [:text_rmagick_available, Object.const_defined?(:Magick)],
Chris@1516 81 [:text_convert_available, Redmine::Thumbnail.convert_available?]
Chris@1516 82 ]
Chris@1516 83 end
Chris@1516 84 end