Project

General

Profile

Defect #16260 » parent_task.patch

This patch is based on 2.4.1.stable. - Domingo Galdos, 2014-03-06 19:57

View differences:

app/helpers/issues_helper.rb (revision 13612)
110 110

  
111 111
  # Returns a link for adding a new subtask to the given issue
112 112
  def link_to_new_subtask(issue)
113
    subtask_tracker = issue.tracker
114
    # try to use a tracker that actually allows being a subtask
115
    if !subtask_tracker.core_fields.include?("parent_issue_id")
116
        subtask_tracker = issue.project.trackers.select{ |t| t.core_fields.include?("parent_issue_id") }.first
117
        subtask_tracker ||= issue.tracker
118
    end
113 119
    attrs = {
114
      :tracker_id => issue.tracker,
120
      :tracker_id => subtask_tracker,
115 121
      :parent_issue_id => issue
116 122
    }
117 123
    link_to(l(:button_add), new_project_issue_path(issue.project, :issue => attrs))
(1-1/3)