summaryrefslogtreecommitdiffstats
path: root/app/helpers/queries_helper.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-11-07 20:42:28 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-11-07 20:42:28 +0000
commit63ceea2e218367f4043580c15288c54ddc225114 (patch)
treeafedaf8e1b6a4086fb1682a441940bf2f938ff37 /app/helpers/queries_helper.rb
parentad68a82be19f44c8e9ab895075a4e932133ad6ee (diff)
downloadredmine-63ceea2e218367f4043580c15288c54ddc225114.tar.gz
redmine-63ceea2e218367f4043580c15288c54ddc225114.zip
Custom fields can now be displayed as columns on the issue list.
Custom fields marked as "for all projects" can be added to the default columns of the issue list (in application settings). Project specific custom fields can be displayed on custom queries. git-svn-id: http://redmine.rubyforge.org/svn/trunk@889 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/queries_helper.rb')
-rw-r--r--app/helpers/queries_helper.rb29
1 files changed, 15 insertions, 14 deletions
diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb
index 786932855..6e5511f08 100644
--- a/app/helpers/queries_helper.rb
+++ b/app/helpers/queries_helper.rb
@@ -22,24 +22,25 @@ module QueriesHelper
end
def column_header(column)
- if column.sortable
- sort_header_tag(column.sortable, :caption => l("field_#{column.name}"))
- else
- content_tag('th', l("field_#{column.name}"))
- end
+ column.sortable ? sort_header_tag(column.sortable, :caption => column.caption) : content_tag('th', column.caption)
end
def column_content(column, issue)
- value = issue.send(column.name)
- if value.is_a?(Date)
- format_date(value)
- elsif value.is_a?(Time)
- format_time(value)
- elsif column.name == :subject
- ((@project.nil? || @project != issue.project) ? "#{issue.project.name} - " : '') +
- link_to(h(value), :controller => 'issues', :action => 'show', :id => issue)
+ if column.is_a?(QueryCustomFieldColumn)
+ cv = issue.custom_values.detect {|v| v.custom_field_id == column.custom_field.id}
+ show_value(cv)
else
- h(value)
+ value = issue.send(column.name)
+ if value.is_a?(Date)
+ format_date(value)
+ elsif value.is_a?(Time)
+ format_time(value)
+ elsif column.name == :subject
+ ((@project.nil? || @project != issue.project) ? "#{issue.project.name} - " : '') +
+ link_to(h(value), :controller => 'issues', :action => 'show', :id => issue)
+ else
+ h(value)
+ end
end
end
end