@@ -1,30 +1,30 | |||
|
1 | 1 | # Redmine - project management software |
|
2 |
# Copyright (C) 2006-20 |
|
|
2 | # Copyright (C) 2006-2011 Jean-Philippe Lang | |
|
3 | 3 | # |
|
4 | 4 | # This program is free software; you can redistribute it and/or |
|
5 | 5 | # modify it under the terms of the GNU General Public License |
|
6 | 6 | # as published by the Free Software Foundation; either version 2 |
|
7 | 7 | # of the License, or (at your option) any later version. |
|
8 |
# |
|
|
8 | # | |
|
9 | 9 | # This program is distributed in the hope that it will be useful, |
|
10 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | 12 | # GNU General Public License for more details. |
|
13 |
# |
|
|
13 | # | |
|
14 | 14 | # You should have received a copy of the GNU General Public License |
|
15 | 15 | # along with this program; if not, write to the Free Software |
|
16 | 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
17 | 17 | |
|
18 | 18 | class CustomFieldsController < ApplicationController |
|
19 | 19 | layout 'admin' |
|
20 | ||
|
20 | ||
|
21 | 21 | before_filter :require_admin |
|
22 | 22 | |
|
23 | 23 | def index |
|
24 | 24 | @custom_fields_by_type = CustomField.find(:all).group_by {|f| f.class.name } |
|
25 | 25 | @tab = params[:tab] || 'IssueCustomField' |
|
26 | 26 | end |
|
27 | ||
|
27 | ||
|
28 | 28 | def new |
|
29 | 29 | @custom_field = begin |
|
30 | 30 | if params[:type].to_s.match(/.+CustomField$/) |
@@ -33,7 +33,7 class CustomFieldsController < ApplicationController | |||
|
33 | 33 | rescue |
|
34 | 34 | end |
|
35 | 35 | (redirect_to(:action => 'index'); return) unless @custom_field.is_a?(CustomField) |
|
36 | ||
|
36 | ||
|
37 | 37 | if request.post? and @custom_field.save |
|
38 | 38 | flash[:notice] = l(:notice_successful_create) |
|
39 | 39 | call_hook(:controller_custom_fields_new_after_save, :params => params, :custom_field => @custom_field) |
@@ -53,7 +53,7 class CustomFieldsController < ApplicationController | |||
|
53 | 53 | @trackers = Tracker.find(:all, :order => 'position') |
|
54 | 54 | end |
|
55 | 55 | end |
|
56 | ||
|
56 | ||
|
57 | 57 | def destroy |
|
58 | 58 | @custom_field = CustomField.find(params[:id]).destroy |
|
59 | 59 | redirect_to :action => 'index', :tab => @custom_field.class.name |
General Comments 0
You need to be logged in to leave comments.
Login now