Project

General

Profile

Patch #4850 ยป extract_updatable_attrs_on_move.patch

Holger Just, 2010-02-15 18:10

View differences:

app/controllers/issues_controller.rb (working copy)
@target_project ||= @project
@trackers = @target_project.trackers
@available_statuses = Workflow.available_statuses(@project)
call_hook(:controller_issues_edit_before_change, { :params => params, :issue => @issue, :target_project => @target_project})
if request.post?
new_tracker = params[:new_tracker_id].blank? ? nil : @target_project.trackers.find_by_id(params[:new_tracker_id])
unsaved_issue_ids = []
moved_issues = []
@issues.each do |issue|
changed_attributes = {}
[:assigned_to_id, :status_id, :start_date, :due_date].each do |valid_attribute|
self.updatable_attrs_on_move.each do |valid_attribute|
unless params[valid_attribute].blank?
changed_attributes[valid_attribute] = (params[valid_attribute] == 'none' ? nil : params[valid_attribute])
end
......
sort_clear
render_error "An error occurred while executing the query and has been logged. Please report this error to your Redmine administrator."
end
# Attributes that can be updated on issue move
def updatable_attrs_on_move
[:assigned_to_id, :status_id, :start_date, :due_date]
end
end
app/views/issues/move.rhtml (working copy)
<label><%= l(:field_due_date) %></label>
<%= text_field_tag 'due_date', '', :size => 10 %><%= calendar_for('due_date') %>
</p>
<%= call_hook(:view_issues_move_bottom, :issue => @issue) %>
</div>
<% if @copy %>
    (1-1/1)