Defect #16260 » parent_task.patch
| app/helpers/issues_helper.rb (revision 13612) | ||
|---|---|---|
|
# Returns a link for adding a new subtask to the given issue
|
||
|
def link_to_new_subtask(issue)
|
||
|
subtask_tracker = issue.tracker
|
||
|
# try to use a tracker that actually allows being a subtask
|
||
|
if !subtask_tracker.core_fields.include?("parent_issue_id")
|
||
|
subtask_tracker = issue.project.trackers.select{ |t| t.core_fields.include?("parent_issue_id") }.first
|
||
|
subtask_tracker ||= issue.tracker
|
||
|
end
|
||
|
attrs = {
|
||
|
:tracker_id => issue.tracker,
|
||
|
:tracker_id => subtask_tracker,
|
||
|
:parent_issue_id => issue
|
||
|
}
|
||
|
link_to(l(:button_add), new_project_issue_path(issue.project, :issue => attrs))
|
||