|
1 | NO CONTENT: modified file |
@@ -1,69 +1,67 | |||
|
1 | 1 | # redMine - project management software |
|
2 | 2 | # Copyright (C) 2006 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 IssueStatusesController < ApplicationController |
|
19 | 19 |
|
|
20 | 20 |
|
|
21 | 21 | |
|
22 | 22 | def index |
|
23 | 23 | list |
|
24 | 24 | render :action => 'list' unless request.xhr? |
|
25 | 25 | end |
|
26 | 26 | |
|
27 | 27 | def list |
|
28 | 28 | @issue_status_pages, @issue_statuses = paginate :issue_statuses, :per_page => 10 |
|
29 | 29 | render :action => "list", :layout => false if request.xhr? |
|
30 | 30 | end |
|
31 | 31 | |
|
32 | 32 | def new |
|
33 | 33 | @issue_status = IssueStatus.new |
|
34 | 34 | end |
|
35 | 35 | |
|
36 | 36 | def create |
|
37 | 37 | @issue_status = IssueStatus.new(params[:issue_status]) |
|
38 | 38 | if @issue_status.save |
|
39 | 39 | flash[:notice] = l(:notice_successful_create) |
|
40 | 40 | redirect_to :action => 'list' |
|
41 | 41 | else |
|
42 | 42 | render :action => 'new' |
|
43 | 43 | end |
|
44 | 44 | end |
|
45 | 45 | |
|
46 | 46 | def edit |
|
47 | 47 | @issue_status = IssueStatus.find(params[:id]) |
|
48 | 48 | end |
|
49 | 49 | |
|
50 | 50 | def update |
|
51 | 51 | @issue_status = IssueStatus.find(params[:id]) |
|
52 | 52 | if @issue_status.update_attributes(params[:issue_status]) |
|
53 | 53 | flash[:notice] = l(:notice_successful_update) |
|
54 | 54 | redirect_to :action => 'list' |
|
55 | 55 | else |
|
56 | 56 | render :action => 'edit' |
|
57 | 57 | end |
|
58 | 58 | end |
|
59 | 59 | |
|
60 | 60 | def destroy |
|
61 | 61 | IssueStatus.find(params[:id]).destroy |
|
62 | 62 | redirect_to :action => 'list' |
|
63 | 63 | rescue |
|
64 | 64 | flash[:notice] = "Unable to delete issue status" |
|
65 | 65 | redirect_to :action => 'list' |
|
66 | 66 | end |
|
67 | ||
|
68 | ||
|
69 | 67 | end |
@@ -1,43 +1,42 | |||
|
1 | 1 | # redMine - project management software |
|
2 | 2 | # Copyright (C) 2006 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 MembersController < ApplicationController |
|
19 | 19 | layout 'base' |
|
20 | 20 | before_filter :find_project, :authorize |
|
21 | 21 | |
|
22 | 22 | def edit |
|
23 | 23 | if request.post? and @member.update_attributes(params[:member]) |
|
24 | 24 | flash[:notice] = l(:notice_successful_update) |
|
25 | 25 | redirect_to :controller => 'projects', :action => 'settings', :tab => 'members', :id => @project |
|
26 | 26 | end |
|
27 | 27 | end |
|
28 | 28 | |
|
29 | 29 | def destroy |
|
30 | 30 | @member.destroy |
|
31 | 31 | flash[:notice] = l(:notice_successful_delete) |
|
32 | 32 | redirect_to :controller => 'projects', :action => 'settings', :tab => 'members', :id => @project |
|
33 | 33 | end |
|
34 | 34 | |
|
35 | 35 | private |
|
36 | 36 | def find_project |
|
37 | 37 | @member = Member.find(params[:id]) |
|
38 | 38 | @project = @member.project |
|
39 | 39 | rescue ActiveRecord::RecordNotFound |
|
40 | 40 | render_404 |
|
41 | 41 |
end |
|
42 | ||
|
43 | 42 | end |
|
1 | NO CONTENT: modified file |
|
1 | NO CONTENT: modified file |
|
1 | NO CONTENT: modified file |
@@ -1,61 +1,60 | |||
|
1 | 1 | # redMine - project management software |
|
2 | 2 | # Copyright (C) 2006 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 TrackersController < ApplicationController |
|
19 | 19 | layout 'base' |
|
20 | 20 | before_filter :require_admin |
|
21 | 21 | |
|
22 | 22 | def index |
|
23 | 23 | list |
|
24 | 24 | render :action => 'list' unless request.xhr? |
|
25 | 25 | end |
|
26 | 26 | |
|
27 | 27 | # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html) |
|
28 | 28 | verify :method => :post, :only => [ :destroy ], :redirect_to => { :action => :list } |
|
29 | 29 | |
|
30 | 30 | def list |
|
31 | 31 | @tracker_pages, @trackers = paginate :trackers, :per_page => 10 |
|
32 | 32 | render :action => "list", :layout => false if request.xhr? |
|
33 | 33 | end |
|
34 | 34 | |
|
35 | 35 | def new |
|
36 | 36 | @tracker = Tracker.new(params[:tracker]) |
|
37 | 37 | if request.post? and @tracker.save |
|
38 | 38 | flash[:notice] = l(:notice_successful_create) |
|
39 | 39 | redirect_to :action => 'list' |
|
40 | 40 | end |
|
41 | 41 | end |
|
42 | 42 | |
|
43 | 43 | def edit |
|
44 | 44 | @tracker = Tracker.find(params[:id]) |
|
45 | 45 | if request.post? and @tracker.update_attributes(params[:tracker]) |
|
46 | 46 | flash[:notice] = l(:notice_successful_update) |
|
47 | 47 | redirect_to :action => 'list' |
|
48 | 48 | end |
|
49 | 49 | end |
|
50 | 50 | |
|
51 | 51 | def destroy |
|
52 | 52 | @tracker = Tracker.find(params[:id]) |
|
53 | 53 | unless @tracker.issues.empty? |
|
54 | 54 | flash[:notice] = "This tracker contains issues and can\'t be deleted." |
|
55 | 55 | else |
|
56 | 56 | @tracker.destroy |
|
57 | 57 | end |
|
58 | 58 | redirect_to :action => 'list' |
|
59 | 59 | end |
|
60 | ||
|
61 | 60 | end |
General Comments 0
You need to be logged in to leave comments.
Login now