summaryrefslogtreecommitdiffstats
path: root/app/helpers/issues_helper.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2010-12-04 13:02:14 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2010-12-04 13:02:14 +0000
commit915748204965bb7f9704b55554e30f091934138e (patch)
tree03a0e543b2b68bf885a0f5477ffd55b714ef072f /app/helpers/issues_helper.rb
parent88e593ee027b1fc1bdfa63b6ab76b0ae51ec6295 (diff)
downloadredmine-915748204965bb7f9704b55554e30f091934138e.tar.gz
redmine-915748204965bb7f9704b55554e30f091934138e.zip
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
Diffstat (limited to 'app/helpers/issues_helper.rb')
-rw-r--r--app/helpers/issues_helper.rb14
1 files changed, 14 insertions, 0 deletions
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)