Mercurial > hg > soundsoftware-site
comparison app/helpers/.svn/text-base/issues_helper.rb.svn-base @ 117:af80e5618e9b redmine-1.1
* Update to Redmine 1.1-stable branch (Redmine SVN rev 4707)
author | Chris Cannam |
---|---|
date | Thu, 13 Jan 2011 12:53:21 +0000 |
parents | 94944d00e43c |
children | 051f544170fe |
comparison
equal
deleted
inserted
replaced
39:150ceac17a8d | 117:af80e5618e9b |
---|---|
184 def find_name_by_reflection(field, id) | 184 def find_name_by_reflection(field, id) |
185 association = Issue.reflect_on_association(field.to_sym) | 185 association = Issue.reflect_on_association(field.to_sym) |
186 if association | 186 if association |
187 record = association.class_name.constantize.find_by_id(id) | 187 record = association.class_name.constantize.find_by_id(id) |
188 return record.name if record | 188 return record.name if record |
189 end | |
190 end | |
191 | |
192 # Renders issue children recursively | |
193 def render_api_issue_children(issue, api) | |
194 return if issue.leaf? | |
195 api.array :children do | |
196 issue.children.each do |child| | |
197 api.issue(:id => child.id) do | |
198 api.tracker(:id => child.tracker_id, :name => child.tracker.name) unless child.tracker.nil? | |
199 api.subject child.subject | |
200 render_api_issue_children(child, api) | |
201 end | |
202 end | |
189 end | 203 end |
190 end | 204 end |
191 | 205 |
192 def issues_to_csv(issues, project = nil) | 206 def issues_to_csv(issues, project = nil) |
193 ic = Iconv.new(l(:general_csv_encoding), 'UTF-8') | 207 ic = Iconv.new(l(:general_csv_encoding), 'UTF-8') |