Feature #4403 » 0100-adstec-copy_and_relate.patch
| redmine/app/controllers/issues_controller.rb 2010-05-05 14:38:11.000000000 +0200 | ||
|---|---|---|
|
@target_project ||= @project
|
||
|
@trackers = @target_project.trackers
|
||
|
@available_statuses = Workflow.available_statuses(@project)
|
||
|
@relations = collection_for_relation_type_select
|
||
|
if request.post?
|
||
|
new_tracker = params[:new_tracker_id].blank? ? nil : @target_project.trackers.find_by_id(params[:new_tracker_id])
|
||
|
new_relation = params[:new_relation_id].blank? ? nil : params[:new_relation_id]
|
||
|
logger.info "new relation:"
|
||
|
logger.info h(new_relation)
|
||
|
unsaved_issue_ids = []
|
||
|
moved_issues = []
|
||
|
@issues.each do |issue|
|
||
| ... | ... | |
|
issue.init_journal(User.current)
|
||
|
if r = issue.move_to(@target_project, new_tracker, {:copy => @copy, :attributes => changed_attributes})
|
||
|
moved_issues << r
|
||
|
if not new_relation.nil?
|
||
|
logger.info "new relation will be generated:"
|
||
|
relation = IssueRelation.new
|
||
|
relation.issue_from = issue
|
||
|
relation.issue_to = r
|
||
|
relation.relation_type = new_relation
|
||
|
relation.save
|
||
|
end
|
||
|
else
|
||
|
unsaved_issue_ids << issue.id
|
||
|
end
|
||
| redmine/app/views/issues/move.rhtml 2010-05-05 14:38:11.000000000 +0200 | ||
|---|---|---|
|
</p>
|
||
|
<p>
|
||
|
<label><%= l(:label_related_issues) %></label>
|
||
|
<%= select_tag('new_relation_id', "<option value=\"\">#{l(:label_no_change_option)}</option>" + options_for_select(@relations)) %>
|
||
|
</p>
|
||
|
<p>
|
||
|
<label><%= l(:field_start_date) %></label>
|
||
|
<%= text_field_tag 'start_date', '', :size => 10 %><%= calendar_for('start_date') %>
|
||
|
</p>
|
||