From 915748204965bb7f9704b55554e30f091934138e Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 4 Dec 2010 13:02:14 +0000 Subject: Adds subtasks to GET /issues/:id API (#5338). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4465 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/issues_helper.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'app/helpers') diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 321041b7c..ce23668ef 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -189,6 +189,20 @@ module IssuesHelper end end + # Renders issue children recursively + def render_api_issue_children(issue, api) + return if issue.leaf? + api.array :children do + issue.children.each do |child| + api.issue(:id => child.id) do + api.tracker(:id => child.tracker_id, :name => child.tracker.name) unless child.tracker.nil? + api.subject child.subject + render_api_issue_children(child, api) + end + end + end + end + def issues_to_csv(issues, project = nil) ic = Iconv.new(l(:general_csv_encoding), 'UTF-8') decimal_separator = l(:general_csv_decimal_separator) -- cgit v1.2.3