Resourcified trackers.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7888 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang committed 2011-11-22 21:32:45 +00:00
1 parent 33f7f5a00d
commit 6577f37fc3
7 files changed
+59 -35

No files matched your search

+17 -6
View File
@@ -22,8 +22,6 @@ class TrackersController < ApplicationController
before_filter :require_admin_or_api_request, :only => :index
accept_api_auth :index
verify :method => :post, :only => :destroy, :redirect_to => { :action => :index }
def index
respond_to do |format|
format.html {
@@ -37,6 +35,12 @@ class TrackersController < ApplicationController
end
def new
@tracker ||= Tracker.new(params[:tracker])
@trackers = Tracker.find :all, :order => 'position'
@projects = Project.find(:all)
end
def create
@tracker = Tracker.new(params[:tracker])
if request.post? and @tracker.save
# workflow copy
@@ -47,20 +51,27 @@ class TrackersController < ApplicationController
redirect_to :action => 'index'
return
end
@trackers = Tracker.find :all, :order => 'position'
@projects = Project.find(:all)
new
render :action => 'new'
end
def edit
@tracker ||= Tracker.find(params[:id])
@projects = Project.find(:all)
end
def update
@tracker = Tracker.find(params[:id])
if request.post? and @tracker.update_attributes(params[:tracker])
if request.put? and @tracker.update_attributes(params[:tracker])
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'index'
return
end
@projects = Project.find(:all)
edit
render :action => 'edit'
end
verify :method => :delete, :only => :destroy, :redirect_to => { :action => :index }
def destroy
@tracker = Tracker.find(params[:id])
unless @tracker.issues.empty?