diff app/helpers/issues_helper.rb @ 119:8661b858af72

* Update to Redmine trunk rev 4705
author Chris Cannam
date Thu, 13 Jan 2011 14:12:06 +0000
parents 94944d00e43c
children 051f544170fe
line wrap: on
line diff
--- a/app/helpers/issues_helper.rb	Fri Nov 19 14:05:24 2010 +0000
+++ b/app/helpers/issues_helper.rb	Thu Jan 13 14:12:06 2011 +0000
@@ -189,6 +189,20 @@
     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)