create_related_r4802_trunk.diff

Denis Malinovsky, 2011-02-09 10:24

Download (2.09 KB)

View differences:

app/controllers/issue_moves_controller.rb Wed Feb 09 15:16:06 2011 +0600
16 16
      unsaved_issue_ids = []
17 17
      moved_issues = []
18 18
      @issues.each do |issue|
19
        issue_orig_id = issue.id
19 20
        issue.reload
20 21
        issue.init_journal(User.current)
21 22
        issue.current_journal.notes = @notes if @notes.present?
22 23
        call_hook(:controller_issues_move_before_save, { :params => params, :issue => issue, :target_project => @target_project, :copy => !!@copy })
23 24
        if r = issue.move_to_project(@target_project, new_tracker, {:copy => @copy, :attributes => extract_changed_attributes_for_move(params)})
24 25
          moved_issues << r
26
          if @copy and params[:create_related] == '1'
27
            relation = IssueRelation.new(:relation_type => 'relates')
28
            relation.issue_from = r
29
            relation.issue_to = issue
30
            relation.save
31
          end
25 32
        else
26 33
          unsaved_issue_ids << issue.id
27 34
        end
app/views/issue_moves/new.rhtml Wed Feb 09 15:16:06 2011 +0600
62 62
<%= wikitoolbar_for 'notes' %>
63 63
</fieldset>
64 64

  
65
<% if @copy %>
66
<p>
67
	<label class="inline"><%= l(:label_create_related) %></label>
68
	<%= check_box_tag 'create_related' %>
69
</p>
70
<% end %>
71

  
65 72
<%= call_hook(:view_issues_move_bottom, :issues => @issues, :target_project => @target_project, :copy => !!@copy) %>
66 73
</div>
67 74

  
config/locales/en.yml Wed Feb 09 15:16:06 2011 +0600
794 794
  label_project_copy_notifications: Send email notifications during the project copy
795 795
  label_principal_search: "Search for user or group:"
796 796
  label_user_search: "Search for user:"
797
  label_create_related: Make target ticket related to source one
797 798
  
798 799
  button_login: Login
799 800
  button_submit: Submit