@@ -1,53 +1,55 | |||
|
1 | 1 | # redMine - project management software |
|
2 | 2 | # Copyright (C) 2006-2007 Jean-Philippe Lang |
|
3 | 3 | # |
|
4 | 4 | # This program is free software; you can redistribute it and/or |
|
5 | 5 | # modify it under the terms of the GNU General Public License |
|
6 | 6 | # as published by the Free Software Foundation; either version 2 |
|
7 | 7 | # of the License, or (at your option) any later version. |
|
8 | 8 | # |
|
9 | 9 | # This program is distributed in the hope that it will be useful, |
|
10 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | 12 | # GNU General Public License for more details. |
|
13 | 13 | # |
|
14 | 14 | # You should have received a copy of the GNU General Public License |
|
15 | 15 | # along with this program; if not, write to the Free Software |
|
16 | 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
17 | 17 | |
|
18 | 18 | module QueriesHelper |
|
19 | 19 | |
|
20 | 20 | def operators_for_select(filter_type) |
|
21 | 21 | Query.operators_by_filter_type[filter_type].collect {|o| [l(Query.operators[o]), o]} |
|
22 | 22 | end |
|
23 | 23 | |
|
24 | 24 | def column_header(column) |
|
25 | 25 | column.sortable ? sort_header_tag(column.sortable, :caption => column.caption, |
|
26 | 26 | :default_order => column.default_order) : |
|
27 | 27 | content_tag('th', column.caption) |
|
28 | 28 | end |
|
29 | 29 | |
|
30 | 30 | def column_content(column, issue) |
|
31 | 31 | if column.is_a?(QueryCustomFieldColumn) |
|
32 | 32 | cv = issue.custom_values.detect {|v| v.custom_field_id == column.custom_field.id} |
|
33 | 33 | show_value(cv) |
|
34 | 34 | else |
|
35 | 35 | value = issue.send(column.name) |
|
36 | 36 | if value.is_a?(Date) |
|
37 | 37 | format_date(value) |
|
38 | 38 | elsif value.is_a?(Time) |
|
39 | 39 | format_time(value) |
|
40 | 40 | else |
|
41 | 41 | case column.name |
|
42 | 42 | when :subject |
|
43 | 43 | h((@project.nil? || @project != issue.project) ? "#{issue.project.name} - " : '') + |
|
44 | 44 | link_to(h(value), :controller => 'issues', :action => 'show', :id => issue) |
|
45 | 45 | when :done_ratio |
|
46 | 46 | progress_bar(value, :width => '80px') |
|
47 | when :fixed_version | |
|
48 | link_to(h(value), { :controller => 'versions', :action => 'show', :id => issue.fixed_version_id }) | |
|
47 | 49 | else |
|
48 | 50 | h(value) |
|
49 | 51 | end |
|
50 | 52 | end |
|
51 | 53 | end |
|
52 | 54 | end |
|
53 | 55 | end |
General Comments 0
You need to be logged in to leave comments.
Login now