Defect #24473 ยป fix_cache_issues.patch
| app/helpers/application_helper.rb | ||
|---|---|---|
|
end
|
||
|
# Helper that formats object for html or text rendering
|
||
|
def format_object(object, html=true, &block)
|
||
|
def format_object(object, html=true, originator=nil, &block)
|
||
|
if block_given?
|
||
|
object = yield object
|
||
|
end
|
||
| ... | ... | |
|
object.visible? && html ? link_to_issue(object) : "##{object.id}"
|
||
|
when 'CustomValue', 'CustomFieldValue'
|
||
|
if object.custom_field
|
||
|
f = object.custom_field.format.formatted_custom_value(self, object, html)
|
||
|
f = object.custom_field.format.formatted_custom_value(self, object, html, originator)
|
||
|
if f.nil? || f.is_a?(String)
|
||
|
f
|
||
|
else
|
||
| app/helpers/custom_fields_helper.rb | ||
|---|---|---|
|
end
|
||
|
# Return a string used to display a custom value
|
||
|
def show_value(custom_value, html=true)
|
||
|
format_object(custom_value, html)
|
||
|
def show_value(custom_value, html=true, originator=nil)
|
||
|
format_object(custom_value, html, originator)
|
||
|
end
|
||
|
# Return a string used to display a custom value
|
||
| ... | ... | |
|
# displayed, with the custom field and the formatted value as arguments
|
||
|
def render_custom_field_values(object, &block)
|
||
|
object.visible_custom_field_values.each do |custom_value|
|
||
|
formatted = show_value(custom_value)
|
||
|
formatted = show_value(custom_value, true, object)
|
||
|
if formatted.present?
|
||
|
yield custom_value.custom_field, formatted
|
||
|
end
|
||
| app/helpers/issues_helper.rb | ||
|---|---|---|
|
values.each_with_index do |value, i|
|
||
|
css = "cf_#{value.custom_field.id}"
|
||
|
m = (i < half ? :left : :right)
|
||
|
rows.send m, custom_field_name_tag(value.custom_field), show_value(value), :class => css
|
||
|
rows.send m, custom_field_name_tag(value.custom_field), show_value(value, true, issue), :class => css
|
||
|
end
|
||
|
end
|
||
|
end
|
||
| ... | ... | |
|
end
|
||
|
end
|
||
|
issue.visible_custom_field_values(user).each do |value|
|
||
|
items << "#{value.custom_field.name}: #{show_value(value, false)}"
|
||
|
items << "#{value.custom_field.name}: #{show_value(value, false, issue)}"
|
||
|
end
|
||
|
items
|
||
|
end
|
||
| app/helpers/queries_helper.rb | ||
|---|---|---|
|
value.to_s(issue) {|other| link_to_issue(other, :subject => false, :tracker => false)}.html_safe,
|
||
|
:class => value.css_classes_for(issue))
|
||
|
else
|
||
|
format_object(value)
|
||
|
format_object(value, true, issue)
|
||
|
end
|
||
|
end
|
||
| ... | ... | |
|
end
|
||
|
def csv_value(column, object, value)
|
||
|
format_object(value, false) do |value|
|
||
|
format_object(value, false, object) do |value|
|
||
|
case value.class.name
|
||
|
when 'Float'
|
||
|
sprintf("%.2f", value).gsub('.', l(:general_csv_decimal_separator))
|
||
| app/views/users/show.html.erb | ||
|---|---|---|
|
<% end %>
|
||
|
<% @user.visible_custom_field_values.each do |custom_value| %>
|
||
|
<% if !custom_value.value.blank? %>
|
||
|
<li><%= custom_value.custom_field.name %>: <%= show_value(custom_value) %></li>
|
||
|
<li><%= custom_value.custom_field.name %>: <%= show_value(custom_value, true, @user) %></li>
|
||
|
<% end %>
|
||
|
<% end %>
|
||
|
<li><%=l(:label_registered_on)%>: <%= format_date(@user.created_on) %></li>
|
||
| lib/redmine/export/pdf/issues_pdf_helper.rb | ||
|---|---|---|
|
|
||
|
half = (issue.visible_custom_field_values.size / 2.0).ceil
|
||
|
issue.visible_custom_field_values.each_with_index do |custom_value, i|
|
||
|
(i < half ? left : right) << [custom_value.custom_field.name, show_value(custom_value, false)]
|
||
|
(i < half ? left : right) << [custom_value.custom_field.name, show_value(custom_value, false, issue)]
|
||
|
end
|
||
|
|
||
|
if pdf.get_rtl
|
||
| ... | ... | |
|
query.inline_columns.collect do |column|
|
||
|
s = if column.is_a?(QueryCustomFieldColumn)
|
||
|
cv = issue.visible_custom_field_values.detect {|v| v.custom_field_id == column.custom_field.id}
|
||
|
show_value(cv, false)
|
||
|
show_value(cv, false, issue)
|
||
|
else
|
||
|
value = issue.send(column.name)
|
||
|
if column.name == :subject
|
||
| lib/redmine/field_format.rb | ||
|---|---|---|
|
[]
|
||
|
end
|
||
|
def formatted_custom_value(view, custom_value, html=false)
|
||
|
formatted_value(view, custom_value.custom_field, custom_value.value, custom_value.customized, html)
|
||
|
def formatted_custom_value(view, custom_value, html=false, originator=nil)
|
||
|
customized_obj = originator || custom_value.customized
|
||
|
formatted_value(view, custom_value.custom_field, custom_value.value, customized_obj, html)
|
||
|
end
|
||
|
def formatted_value(view, custom_field, value, customized=nil, html=false)
|
||