comparison app/helpers/custom_fields_helper.rb @ 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 513646585e45
children cbce1fd3b1b7
comparison
equal deleted inserted replaced
39:150ceac17a8d 117:af80e5618e9b
102 102
103 # Return an array of custom field formats which can be used in select_tag 103 # Return an array of custom field formats which can be used in select_tag
104 def custom_field_formats_for_select 104 def custom_field_formats_for_select
105 Redmine::CustomFieldFormat.as_select 105 Redmine::CustomFieldFormat.as_select
106 end 106 end
107
108 # Renders the custom_values in api views
109 def render_api_custom_values(custom_values, api)
110 api.array :custom_fields do
111 custom_values.each do |custom_value|
112 api.custom_field :id => custom_value.custom_field_id, :name => custom_value.custom_field.name do
113 api.value custom_value.value
114 end
115 end
116 end unless custom_values.empty?
117 end
107 end 118 end