diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-12-02 18:57:17 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-12-02 18:57:17 +0000 |
commit | 346c569f98f53f266f6ab6dffe02cc27a21c33e4 (patch) | |
tree | 4c61adb9eb9150b1af69abfa1d04652bc5a5df18 /app/helpers/queries_helper.rb | |
parent | 8b8c24e61f37cee0904ad8d44184da58a2f8ca43 (diff) | |
download | redmine-346c569f98f53f266f6ab6dffe02cc27a21c33e4.tar.gz redmine-346c569f98f53f266f6ab6dffe02cc27a21c33e4.zip |
Fixed: "None" category issue count is empty while grouping by category (#4308).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3112 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/queries_helper.rb')
-rw-r--r-- | app/helpers/queries_helper.rb | 64 |
1 files changed, 29 insertions, 35 deletions
diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb index 518226c8f..ecfac55ad 100644 --- a/app/helpers/queries_helper.rb +++ b/app/helpers/queries_helper.rb @@ -27,44 +27,38 @@ module QueriesHelper content_tag('th', column.caption) end - def column_value(column, issue) - if column.is_a?(QueryCustomFieldColumn) - cv = issue.custom_values.detect {|v| v.custom_field_id == column.custom_field.id} - show_value(cv) - else - value = issue.send(column.name) - end - end - def column_content(column, issue) - if column.is_a?(QueryCustomFieldColumn) - cv = issue.custom_values.detect {|v| v.custom_field_id == column.custom_field.id} - show_value(cv) - else - value = issue.send(column.name) - if value.is_a?(Date) - format_date(value) - elsif value.is_a?(Time) - format_time(value) + value = column.value(issue) + + case value.class.name + when 'String' + if column.name == :subject + link_to(h(value), :controller => 'issues', :action => 'show', :id => issue) + else + h(value) + end + when 'Time' + format_time(value) + when 'Date' + format_date(value) + when 'Fixnum', 'Float' + if column.name == :done_ratio + progress_bar(value, :width => '80px') else - case column.name - when :subject - h((!@project.nil? && @project != issue.project) ? "#{issue.project.name} - " : '') + - link_to(h(value), :controller => 'issues', :action => 'show', :id => issue) - when :project - link_to(h(value), :controller => 'projects', :action => 'show', :id => value) - when :assigned_to - link_to_user value - when :author - link_to_user value - when :done_ratio - progress_bar(value, :width => '80px') - when :fixed_version - link_to(h(value), { :controller => 'versions', :action => 'show', :id => issue.fixed_version_id }) - else - h(value) - end + value.to_s end + when 'User' + link_to_user value + when 'Project' + link_to(h(value), :controller => 'projects', :action => 'show', :id => value) + when 'Version' + link_to(h(value), :controller => 'versions', :action => 'show', :id => value) + when 'TrueClass' + l(:general_text_Yes) + when 'FalseClass' + l(:general_text_No) + else + h(value) end end end |