Mercurial > hg > soundsoftware-site
comparison app/controllers/admin_controller.rb @ 1295:622f24f53b42 redmine-2.3
Update to Redmine SVN revision 11972 on 2.3-stable branch
author | Chris Cannam |
---|---|
date | Fri, 14 Jun 2013 09:02:21 +0100 |
parents | 433d4f72a19b |
children |
comparison
equal
deleted
inserted
replaced
1294:3e4c3460b6ca | 1295:622f24f53b42 |
---|---|
1 # Redmine - project management software | 1 # Redmine - project management software |
2 # Copyright (C) 2006-2012 Jean-Philippe Lang | 2 # Copyright (C) 2006-2013 Jean-Philippe Lang |
3 # | 3 # |
4 # This program is free software; you can redistribute it and/or | 4 # This program is free software; you can redistribute it and/or |
5 # modify it under the terms of the GNU General Public License | 5 # modify it under the terms of the GNU General Public License |
6 # as published by the Free Software Foundation; either version 2 | 6 # as published by the Free Software Foundation; either version 2 |
7 # of the License, or (at your option) any later version. | 7 # of the License, or (at your option) any later version. |
21 menu_item :plugins, :only => :plugins | 21 menu_item :plugins, :only => :plugins |
22 menu_item :info, :only => :info | 22 menu_item :info, :only => :info |
23 | 23 |
24 before_filter :require_admin | 24 before_filter :require_admin |
25 helper :sort | 25 helper :sort |
26 include SortHelper | 26 include SortHelper |
27 | 27 |
28 def index | 28 def index |
29 @no_configuration_data = Redmine::DefaultData::Loader::no_data? | 29 @no_configuration_data = Redmine::DefaultData::Loader::no_data? |
30 end | 30 end |
31 | 31 |
32 def projects | 32 def projects |
33 @status = params[:status] || 1 | 33 @status = params[:status] || 1 |
34 | 34 |
35 scope = Project.status(@status) | 35 scope = Project.status(@status).order('lft') |
36 scope = scope.like(params[:name]) if params[:name].present? | 36 scope = scope.like(params[:name]) if params[:name].present? |
37 | 37 @projects = scope.all |
38 @projects = scope.all(:order => 'lft') | |
39 | 38 |
40 render :action => "projects", :layout => false if request.xhr? | 39 render :action => "projects", :layout => false if request.xhr? |
41 end | 40 end |
42 | 41 |
43 def plugins | 42 def plugins |
53 flash[:notice] = l(:notice_default_data_loaded) | 52 flash[:notice] = l(:notice_default_data_loaded) |
54 rescue Exception => e | 53 rescue Exception => e |
55 flash[:error] = l(:error_can_t_load_default_data, e.message) | 54 flash[:error] = l(:error_can_t_load_default_data, e.message) |
56 end | 55 end |
57 end | 56 end |
58 redirect_to :action => 'index' | 57 redirect_to admin_path |
59 end | 58 end |
60 | 59 |
61 def test_email | 60 def test_email |
62 raise_delivery_errors = ActionMailer::Base.raise_delivery_errors | 61 raise_delivery_errors = ActionMailer::Base.raise_delivery_errors |
63 # Force ActionMailer to raise delivery errors so we can catch it | 62 # Force ActionMailer to raise delivery errors so we can catch it |
67 flash[:notice] = l(:notice_email_sent, User.current.mail) | 66 flash[:notice] = l(:notice_email_sent, User.current.mail) |
68 rescue Exception => e | 67 rescue Exception => e |
69 flash[:error] = l(:notice_email_error, e.message) | 68 flash[:error] = l(:notice_email_error, e.message) |
70 end | 69 end |
71 ActionMailer::Base.raise_delivery_errors = raise_delivery_errors | 70 ActionMailer::Base.raise_delivery_errors = raise_delivery_errors |
72 redirect_to :controller => 'settings', :action => 'edit', :tab => 'notifications' | 71 redirect_to settings_path(:tab => 'notifications') |
73 end | 72 end |
74 | 73 |
75 def info | 74 def info |
76 @db_adapter_name = ActiveRecord::Base.connection.adapter_name | 75 @db_adapter_name = ActiveRecord::Base.connection.adapter_name |
77 @checklist = [ | 76 @checklist = [ |