Project

General

Profile

Patch for Redmine to persist form state when adding multi... ยป redmine-issue-inspire_on.patch

Henrique Bastos, 2009-03-26 05:00

View differences:

app/controllers/issues_controller.rb
if request.get? || request.xhr?
@issue.start_date ||= Date.today
@issue.inspire_on(params[:inspire_on]) if params[:inspire_on]
else
requested_status = IssueStatus.find_by_id(params[:issue][:status_id])
# Check that the user is allowed to apply the requested status
......
attach_files(@issue, params[:attachments])
flash[:notice] = l(:notice_successful_create)
Mailer.deliver_issue_add(@issue) if Setting.notified_events.include?('issue_added')
redirect_to(params[:continue] ? { :action => 'new', :tracker_id => @issue.tracker } :
redirect_to(params[:continue] ? { :action => 'new', :tracker_id => @issue.tracker,
:inspire_on => @issue.id } :
{ :action => 'show', :id => @issue })
return
end
app/models/issue.rb
self.custom_values = issue.custom_values.collect {|v| v.clone}
self
end
def inspire_on(arg)
issue = arg.is_a?(Issue) ? arg : Issue.find(arg)
self.attributes = issue.attributes.dup.slice!("category_id",
"status_id",
"assigned_to_id",
"priority_id",
"fixed_version_id")
self.custom_values = issue.custom_values.collect {|v| v.clone}
self.watcher_user_ids = issue.watcher_user_ids.clone
self
end
# Move an issue to a new project and tracker
def move_to(new_project, new_tracker = nil)
    (1-1/1)