diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-04-06 11:11:52 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-04-06 11:11:52 +0000 |
commit | 22b2a1f699279b1b2b11880c77854c25114fc27c (patch) | |
tree | e2c7f3acb6f50fa7068146fdd5b10b04483a8215 /app/helpers | |
parent | 5b8a96472f7148efec03954bb524fa8a10351795 (diff) | |
download | redmine-22b2a1f699279b1b2b11880c77854c25114fc27c.tar.gz redmine-22b2a1f699279b1b2b11880c77854c25114fc27c.zip |
Fixed that Link custom fields are not displayed as links on the issue list (#16496).
git-svn-id: http://svn.redmine.org/redmine/trunk@13054 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/application_helper.rb | 7 | ||||
-rw-r--r-- | app/helpers/queries_helper.rb | 32 |
2 files changed, 19 insertions, 20 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index acb7ba9db..8377d99f2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -158,7 +158,10 @@ module ApplicationHelper end # Helper that formats object for html or text rendering - def format_object(object, html=true) + def format_object(object, html=true, &block) + if block_given? + object = yield object + end case object.class.name when 'Array' object.map {|o| format_object(o, html)}.join(', ').html_safe @@ -188,7 +191,7 @@ module ApplicationHelper if f.nil? || f.is_a?(String) f else - format_object(f, html) + format_object(f, html, &block) end else object.value.to_s diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb index 9324a9d92..ca8d2537b 100644 --- a/app/helpers/queries_helper.rb +++ b/app/helpers/queries_helper.rb @@ -18,6 +18,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. module QueriesHelper + include ApplicationHelper + def filters_options_for_select(query) options_for_select(filters_options(query)) end @@ -81,7 +83,7 @@ module QueriesHelper end def column_content(column, issue) - value = column.value(issue) + value = column.value_object(issue) if value.is_a?(Array) value.collect {|v| column_value(column, issue, v)}.compact.join(', ').html_safe else @@ -110,7 +112,7 @@ module QueriesHelper end def csv_content(column, issue) - value = column.value(issue) + value = column.value_object(issue) if value.is_a?(Array) value.collect {|v| csv_value(column, issue, v)}.compact.join(', ') else @@ -119,22 +121,16 @@ module QueriesHelper end def csv_value(column, issue, value) - case value.class.name - when 'Time' - format_time(value) - when 'Date' - format_date(value) - when 'Float' - sprintf("%.2f", value).gsub('.', l(:general_csv_decimal_separator)) - when 'IssueRelation' - other = value.other_issue(issue) - l(value.label_for(issue)) + " ##{other.id}" - when 'TrueClass' - l(:general_text_Yes) - when 'FalseClass' - l(:general_text_No) - else - value.to_s + format_object(value, false) do |value| + case value.class.name + when 'Float' + sprintf("%.2f", value).gsub('.', l(:general_csv_decimal_separator)) + when 'IssueRelation' + other = value.other_issue(issue) + l(value.label_for(issue)) + " ##{other.id}" + else + value + end end end |