Index: app/controllers/issues_controller.rb =================================================================== --- app/controllers/issues_controller.rb (revision 1617) +++ app/controllers/issues_controller.rb (working copy) @@ -53,6 +53,7 @@ limit = per_page_option respond_to do |format| format.html { } + format.xml { } format.atom { } format.csv { limit = Setting.issues_export_limit.to_i } format.pdf { limit = Setting.issues_export_limit.to_i } @@ -66,13 +67,7 @@ :offset => @issue_pages.current.offset respond_to do |format| format.html { render :template => 'issues/index.rhtml', :layout => !request.xhr? } + format.xml { render :xml => @issues.to_xml } format.atom { render_feed(@issues, :title => l(:label_issue_plural)) } format.csv { send_data(issues_to_csv(@issues, @project).read, :type => 'text/csv; header=present', :filename => 'export.csv') } format.pdf { send_data(render(:template => 'issues/index.rfpdf', :layout => false), :type => 'application/pdf', :filename => 'export.pdf') } @@ -104,11 +106,17 @@ @time_entry = TimeEntry.new respond_to do |format| format.html { render :template => 'issues/show.rhtml' } + format.xml { render :xml => @journals.to_xml } format.atom { render :action => 'changes', :layout => false, :content_type => 'application/atom+xml' } format.pdf { send_data(render(:template => 'issues/show.rfpdf', :layout => false), :type => 'application/pdf', :filename => "#{@project.identifier}-#{@issue.id}.pdf") } end end def new @@ -171,7 +174,7 @@ @issue.attributes = attrs end - if request.post? + if request.post? || request.put? @time_entry = TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => Date.today) @time_entry.attributes = params[:time_entry] attachments = attach_files(@issue, params[:attachments]) @@ -216,7 +224,7 @@ # Bulk edit a set of issues def bulk_edit - if request.post? + if request.post? || request.put? status = params[:status_id].blank? ? nil : IssueStatus.find_by_id(params[:status_id]) priority = params[:priority_id].blank? ? nil : Enumeration.find_by_id(params[:priority_id]) assigned_to = (params[:assigned_to_id].blank? || params[:assigned_to_id] == 'none') ? nil : User.find_by_id(params[:assigned_to_id]) @@ -267,7 +275,7 @@ @target_project = @allowed_projects.detect {|p| p.id.to_s == params[:new_project_id]} if params[:new_project_id] @target_project ||= @project @trackers = @target_project.trackers - if request.post? + if request.post? || request.put? new_tracker = params[:new_tracker_id].blank? ? nil : @target_project.trackers.find_by_id(params[:new_tracker_id]) unsaved_issue_ids = [] @issues.each do |issue| Index: app/controllers/messages_controller.rb =================================================================== --- app/controllers/messages_controller.rb (revision 1617) +++ app/controllers/messages_controller.rb (working copy) @@ -64,7 +64,7 @@ # Edit a message def edit - if params[:message] && User.current.allowed_to?(:edit_messages, @project) + if params[:message] && User.current.allowed_to?(:edit_messages, @project)) @message.locked = params[:message]['locked'] @message.sticky = params[:message]['sticky'] end Index: app/controllers/admin_controller.rb =================================================================== --- app/controllers/admin_controller.rb (revision 1617) +++ app/controllers/admin_controller.rb (working copy) @@ -23,7 +23,14 @@ include SortHelper def index - @no_configuration_data = Redmine::DefaultData::Loader::no_data? + if request.delete? and User.current.admin + @project.destroy + respond_to do |format| + format.xml { head :ok } + end + else + @no_configuration_data = Redmine::DefaultData::Loader::no_data? + end end def projects @@ -58,6 +62,7 @@ render_feed(projects.sort_by(&:created_on).reverse.slice(0, Setting.feeds_limit.to_i), :title => "#{Setting.app_title}: #{l(:label_project_latest)}") } + format.xml { render :xml => projects.to_xml } end end @@ -77,8 +82,11 @@ @project.enabled_module_names = params[:enabled_modules] if @project.save flash[:notice] = l(:notice_successful_create) - redirect_to :controller => 'admin', :action => 'projects' - end + respond_to do |format| + format.html { redirect_to :controller => 'admin', :action => 'projects' } + format.xml { head :ok } + end + end end end @@ -104,6 +112,11 @@ :conditions => cond).to_f end @key = User.current.rss_key + + respond_to do |format| + format.html + format.xml { render :xml => @project.to_xml } + end end def settings @@ -130,6 +143,11 @@ render :action => 'settings' end end + + respond_to do |format| + format.html + format.xml { render :xml => @project.to_xml } + end end def modules @@ -150,9 +168,13 @@ # Delete @project def destroy @project_to_destroy = @project - if request.post? and params[:confirm] + if request.delete? and params[:confirm] @project_to_destroy.destroy - redirect_to :controller => 'admin', :action => 'projects' + respond_to do |format| + format.html { redirect_to :controller => 'admin', :action => 'projects' } + format.xml { head :ok } + end + #redirect_to :controller => 'admin', :action => 'projects' end # hide project in layout @project = nil @@ -161,7 +183,7 @@ # Add a new issue category to @project def add_issue_category @category = @project.issue_categories.build(params[:category]) - if request.post? and @category.save + if request.delete? and @category.save respond_to do |format| format.html do flash[:notice] = l(:notice_successful_create)