Feature #296 » rest.diff
| app/controllers/issues_controller.rb (working copy) | ||
|---|---|---|
|
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 }
|
||
| ... | ... | |
|
: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') }
|
||
| ... | ... | |
|
@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
|
||
| ... | ... | |
|
@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])
|
||
| ... | ... | |
|
|
||
|
# 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])
|
||
| ... | ... | |
|
@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|
|
||
| app/controllers/messages_controller.rb (working copy) | ||
|---|---|---|
|
# 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
|
||
| app/controllers/admin_controller.rb (working copy) | ||
|---|---|---|
|
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
|
||
| ... | ... | |
|
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
|
||
|
|
||
| ... | ... | |
|
@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
|
||
|
|
||
| ... | ... | |
|
: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
|
||
| ... | ... | |
|
render :action => 'settings'
|
||
|
end
|
||
|
end
|
||
|
respond_to do |format|
|
||
|
format.html
|
||
|
format.xml { render :xml => @project.to_xml }
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def modules
|
||
| ... | ... | |
|
# 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
|
||
| ... | ... | |
|
# 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)
|
||