Project

General

Profile

Defect #8359 ยป issue_8359.patch

Alexander Kriventsov, 2012-05-05 16:29

View differences:

app/controllers/issue_moves_controller.rb 2012-05-05 14:18:06.000000000 +0000
@allowed_projects = Issue.allowed_target_projects_on_move
@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
@available_statuses = Workflow.available_statuses(@project)
same_trackers = 1
same_statuses = 1
if (@issues.size > 1)
@issues.each do |issue|
if (issue.tracker.name != @issues.first.tracker.name)
same_trackers = 0
break
end
if (issue.status.name != @issues.first.status.name)
same_statuses = 0
break
end
end
end
if (same_trackers == 1)
@trackers = @target_project.trackers
@target_tracker = @target_project.trackers.find_by_id(params[:new_tracker_id]) if params[:new_tracker_id]
@target_tracker ||= @issues.first.tracker
@target_tracker_id = params[:new_tracker_id]
@target_tracker_id ||= @target_tracker.id
else
@target_tracker = []
end
if ( (same_statuses == 1) and (@target_tracker != nil) )
@available_statuses = @issues.first.status.find_new_statuses_allowed_to(User.current.roles_for_project(@target_project), @target_tracker)
else
@available_statuses = []
end
@notes = params[:notes]
@notes ||= ''
end
-- app/views/issue_moves/new.html.erb.orig 2012-05-05 11:08:58.000000000 +0000
++ app/views/issue_moves/new.html.erb 2012-05-05 13:56:02.000000000 +0000
......
:with => "Form.serialize('move_form')") %></p>
<p><label for="new_tracker_id"><%=l(:field_tracker)%>:</label>
<%= select_tag "new_tracker_id", "<option value=\"\">#{l(:label_no_change_option)}</option>" + options_from_collection_for_select(@trackers, "id", "name") %></p>
<% if @trackers.nil? %>
<%= select_tag('status_id', "<option value=\"\">#{l(:label_no_change_option)}</option>") %></p>
<% else %>
<%= select_tag "new_tracker_id",
options_from_collection_for_select(@trackers, "id", "name", Integer(@target_tracker_id)),
:onchange => remote_function(:url => { :action => 'new' },
:method => :get,
:update => 'content',
:with => "Form.serialize('move_form')") %></p>
<% end %>
<p>
<label for='status_id'><%= l(:field_status) %></label>
<% if @available_statuses.nil? %>
<%= select_tag('status_id', "<option value=\"\">#{l(:label_no_change_option)}</option>") %>
<% else %>
<%= select_tag('status_id', "<option value=\"\">#{l(:label_no_change_option)}</option>" + options_from_collection_for_select(@available_statuses, :id, :name)) %>
<% end %>
</p>
<p>
    (1-1/1)