1 # redMine - project management software
2 # Copyright (C) 2006-2007 Jean-Philippe Lang
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 def operators_for_select(filter_type)
21 Query.operators_by_filter_type[filter_type].collect {|o| [l(Query.operators[o]), o]}
24 def column_header(column)
25 column.sortable ? sort_header_tag(column.sortable, :caption => column.caption) : content_tag('th', column.caption)
28 def column_content(column, issue)
29 if column.is_a?(QueryCustomFieldColumn)
30 cv = issue.custom_values.detect {|v| v.custom_field_id == column.custom_field.id}
33 value = issue.send(column.name)
36 elsif value.is_a?(Time)
38 elsif column.name == :subject
39 ((@project.nil? || @project != issue.project) ? "#{issue.project.name} - " : '') +
40 link_to(h(value), :controller => 'issues', :action => 'show', :id => issue)