create_related_r4802_trunk_v2.diff

Denis Malinovsky, 2011-02-09 11:42

Download (2.07 KB)

View differences:

app/controllers/issue_moves_controller.rb Wed Feb 09 16:41:53 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 16:41:53 2011 +0600
53 53
  <label><%= l(:field_due_date) %></label>
54 54
  <%= text_field_tag 'due_date', '', :size => 10 %><%= calendar_for('due_date') %>
55 55
</p>
56

  
57
<% if @copy %>
58
<p>
59
  <label><%= l(:label_create_related) %></label>
60
  <%= check_box_tag 'create_related', '1', true %>
61
</p>
62
<% end %>
63

  
56 64
</div>
57 65

  
58 66
</fieldset>
config/locales/en.yml Wed Feb 09 16:41:53 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