1 | NO CONTENT: modified file |
|
NO CONTENT: modified file |
@@ -1,69 +1,67 | |||||
1 | # redMine - project management software |
|
1 | # redMine - project management software | |
2 | # Copyright (C) 2006 Jean-Philippe Lang |
|
2 | # Copyright (C) 2006 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. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU General Public License |
|
14 | # You should have received a copy of the GNU General Public License | |
15 | # along with this program; if not, write to the Free Software |
|
15 | # along with this program; if not, write to the Free Software | |
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
17 |
|
17 | |||
18 | class IssueStatusesController < ApplicationController |
|
18 | class IssueStatusesController < ApplicationController | |
19 |
|
|
19 | layout 'base' | |
20 |
|
|
20 | before_filter :require_admin | |
21 |
|
21 | |||
22 | def index |
|
22 | def index | |
23 | list |
|
23 | list | |
24 | render :action => 'list' unless request.xhr? |
|
24 | render :action => 'list' unless request.xhr? | |
25 | end |
|
25 | end | |
26 |
|
26 | |||
27 | def list |
|
27 | def list | |
28 | @issue_status_pages, @issue_statuses = paginate :issue_statuses, :per_page => 10 |
|
28 | @issue_status_pages, @issue_statuses = paginate :issue_statuses, :per_page => 10 | |
29 | render :action => "list", :layout => false if request.xhr? |
|
29 | render :action => "list", :layout => false if request.xhr? | |
30 | end |
|
30 | end | |
31 |
|
31 | |||
32 | def new |
|
32 | def new | |
33 | @issue_status = IssueStatus.new |
|
33 | @issue_status = IssueStatus.new | |
34 | end |
|
34 | end | |
35 |
|
35 | |||
36 | def create |
|
36 | def create | |
37 | @issue_status = IssueStatus.new(params[:issue_status]) |
|
37 | @issue_status = IssueStatus.new(params[:issue_status]) | |
38 | if @issue_status.save |
|
38 | if @issue_status.save | |
39 | flash[:notice] = l(:notice_successful_create) |
|
39 | flash[:notice] = l(:notice_successful_create) | |
40 | redirect_to :action => 'list' |
|
40 | redirect_to :action => 'list' | |
41 | else |
|
41 | else | |
42 | render :action => 'new' |
|
42 | render :action => 'new' | |
43 | end |
|
43 | end | |
44 | end |
|
44 | end | |
45 |
|
45 | |||
46 | def edit |
|
46 | def edit | |
47 | @issue_status = IssueStatus.find(params[:id]) |
|
47 | @issue_status = IssueStatus.find(params[:id]) | |
48 | end |
|
48 | end | |
49 |
|
49 | |||
50 | def update |
|
50 | def update | |
51 | @issue_status = IssueStatus.find(params[:id]) |
|
51 | @issue_status = IssueStatus.find(params[:id]) | |
52 | if @issue_status.update_attributes(params[:issue_status]) |
|
52 | if @issue_status.update_attributes(params[:issue_status]) | |
53 | flash[:notice] = l(:notice_successful_update) |
|
53 | flash[:notice] = l(:notice_successful_update) | |
54 | redirect_to :action => 'list' |
|
54 | redirect_to :action => 'list' | |
55 | else |
|
55 | else | |
56 | render :action => 'edit' |
|
56 | render :action => 'edit' | |
57 | end |
|
57 | end | |
58 | end |
|
58 | end | |
59 |
|
59 | |||
60 | def destroy |
|
60 | def destroy | |
61 | IssueStatus.find(params[:id]).destroy |
|
61 | IssueStatus.find(params[:id]).destroy | |
62 | redirect_to :action => 'list' |
|
62 | redirect_to :action => 'list' | |
63 | rescue |
|
63 | rescue | |
64 | flash[:notice] = "Unable to delete issue status" |
|
64 | flash[:notice] = "Unable to delete issue status" | |
65 | redirect_to :action => 'list' |
|
65 | redirect_to :action => 'list' | |
66 | end |
|
66 | end | |
67 |
|
||||
68 |
|
||||
69 | end |
|
67 | end |
@@ -1,43 +1,42 | |||||
1 | # redMine - project management software |
|
1 | # redMine - project management software | |
2 | # Copyright (C) 2006 Jean-Philippe Lang |
|
2 | # Copyright (C) 2006 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. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU General Public License |
|
14 | # You should have received a copy of the GNU General Public License | |
15 | # along with this program; if not, write to the Free Software |
|
15 | # along with this program; if not, write to the Free Software | |
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
17 |
|
17 | |||
18 | class MembersController < ApplicationController |
|
18 | class MembersController < ApplicationController | |
19 | layout 'base' |
|
19 | layout 'base' | |
20 | before_filter :find_project, :authorize |
|
20 | before_filter :find_project, :authorize | |
21 |
|
21 | |||
22 | def edit |
|
22 | def edit | |
23 | if request.post? and @member.update_attributes(params[:member]) |
|
23 | if request.post? and @member.update_attributes(params[:member]) | |
24 | flash[:notice] = l(:notice_successful_update) |
|
24 | flash[:notice] = l(:notice_successful_update) | |
25 | redirect_to :controller => 'projects', :action => 'settings', :tab => 'members', :id => @project |
|
25 | redirect_to :controller => 'projects', :action => 'settings', :tab => 'members', :id => @project | |
26 | end |
|
26 | end | |
27 | end |
|
27 | end | |
28 |
|
28 | |||
29 | def destroy |
|
29 | def destroy | |
30 | @member.destroy |
|
30 | @member.destroy | |
31 | flash[:notice] = l(:notice_successful_delete) |
|
31 | flash[:notice] = l(:notice_successful_delete) | |
32 | redirect_to :controller => 'projects', :action => 'settings', :tab => 'members', :id => @project |
|
32 | redirect_to :controller => 'projects', :action => 'settings', :tab => 'members', :id => @project | |
33 | end |
|
33 | end | |
34 |
|
34 | |||
35 | private |
|
35 | private | |
36 | def find_project |
|
36 | def find_project | |
37 | @member = Member.find(params[:id]) |
|
37 | @member = Member.find(params[:id]) | |
38 | @project = @member.project |
|
38 | @project = @member.project | |
39 | rescue ActiveRecord::RecordNotFound |
|
39 | rescue ActiveRecord::RecordNotFound | |
40 | render_404 |
|
40 | render_404 | |
41 |
end |
|
41 | end | |
42 |
|
||||
43 | end |
|
42 | end |
1 | NO CONTENT: modified file |
|
NO CONTENT: modified file |
1 | NO CONTENT: modified file |
|
NO CONTENT: modified file |
1 | NO CONTENT: modified file |
|
NO CONTENT: modified file |
@@ -1,61 +1,60 | |||||
1 | # redMine - project management software |
|
1 | # redMine - project management software | |
2 | # Copyright (C) 2006 Jean-Philippe Lang |
|
2 | # Copyright (C) 2006 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. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU General Public License |
|
14 | # You should have received a copy of the GNU General Public License | |
15 | # along with this program; if not, write to the Free Software |
|
15 | # along with this program; if not, write to the Free Software | |
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
17 |
|
17 | |||
18 | class TrackersController < ApplicationController |
|
18 | class TrackersController < ApplicationController | |
19 | layout 'base' |
|
19 | layout 'base' | |
20 | before_filter :require_admin |
|
20 | before_filter :require_admin | |
21 |
|
21 | |||
22 | def index |
|
22 | def index | |
23 | list |
|
23 | list | |
24 | render :action => 'list' unless request.xhr? |
|
24 | render :action => 'list' unless request.xhr? | |
25 | end |
|
25 | end | |
26 |
|
26 | |||
27 | # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html) |
|
27 | # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html) | |
28 | verify :method => :post, :only => [ :destroy ], :redirect_to => { :action => :list } |
|
28 | verify :method => :post, :only => [ :destroy ], :redirect_to => { :action => :list } | |
29 |
|
29 | |||
30 | def list |
|
30 | def list | |
31 | @tracker_pages, @trackers = paginate :trackers, :per_page => 10 |
|
31 | @tracker_pages, @trackers = paginate :trackers, :per_page => 10 | |
32 | render :action => "list", :layout => false if request.xhr? |
|
32 | render :action => "list", :layout => false if request.xhr? | |
33 | end |
|
33 | end | |
34 |
|
34 | |||
35 | def new |
|
35 | def new | |
36 | @tracker = Tracker.new(params[:tracker]) |
|
36 | @tracker = Tracker.new(params[:tracker]) | |
37 | if request.post? and @tracker.save |
|
37 | if request.post? and @tracker.save | |
38 | flash[:notice] = l(:notice_successful_create) |
|
38 | flash[:notice] = l(:notice_successful_create) | |
39 | redirect_to :action => 'list' |
|
39 | redirect_to :action => 'list' | |
40 | end |
|
40 | end | |
41 | end |
|
41 | end | |
42 |
|
42 | |||
43 | def edit |
|
43 | def edit | |
44 | @tracker = Tracker.find(params[:id]) |
|
44 | @tracker = Tracker.find(params[:id]) | |
45 | if request.post? and @tracker.update_attributes(params[:tracker]) |
|
45 | if request.post? and @tracker.update_attributes(params[:tracker]) | |
46 | flash[:notice] = l(:notice_successful_update) |
|
46 | flash[:notice] = l(:notice_successful_update) | |
47 | redirect_to :action => 'list' |
|
47 | redirect_to :action => 'list' | |
48 | end |
|
48 | end | |
49 | end |
|
49 | end | |
50 |
|
50 | |||
51 | def destroy |
|
51 | def destroy | |
52 | @tracker = Tracker.find(params[:id]) |
|
52 | @tracker = Tracker.find(params[:id]) | |
53 | unless @tracker.issues.empty? |
|
53 | unless @tracker.issues.empty? | |
54 | flash[:notice] = "This tracker contains issues and can\'t be deleted." |
|
54 | flash[:notice] = "This tracker contains issues and can\'t be deleted." | |
55 | else |
|
55 | else | |
56 | @tracker.destroy |
|
56 | @tracker.destroy | |
57 | end |
|
57 | end | |
58 | redirect_to :action => 'list' |
|
58 | redirect_to :action => 'list' | |
59 | end |
|
59 | end | |
60 |
|
||||
61 | end |
|
60 | end |
General Comments 0
You need to be logged in to leave comments.
Login now