@@ -92,6 +92,8 module QueriesHelper | |||||
92 | progress_bar(value, :width => '80px') |
|
92 | progress_bar(value, :width => '80px') | |
93 | elsif column.name == :spent_hours |
|
93 | elsif column.name == :spent_hours | |
94 | sprintf "%.2f", value |
|
94 | sprintf "%.2f", value | |
|
95 | elsif column.name == :hours | |||
|
96 | html_hours("%.2f" % value) | |||
95 | else |
|
97 | else | |
96 | h(value.to_s) |
|
98 | h(value.to_s) | |
97 | end |
|
99 | end | |
@@ -106,7 +108,7 module QueriesHelper | |||||
106 | when 'FalseClass' |
|
108 | when 'FalseClass' | |
107 | l(:general_text_No) |
|
109 | l(:general_text_No) | |
108 | when 'Issue' |
|
110 | when 'Issue' | |
109 | link_to_issue(value, :subject => false) |
|
111 | value.visible? ? link_to_issue(value) : "##{value.id}" | |
110 | when 'IssueRelation' |
|
112 | when 'IssueRelation' | |
111 | other = value.other_issue(issue) |
|
113 | other = value.other_issue(issue) | |
112 | content_tag('span', |
|
114 | content_tag('span', |
@@ -21,7 +21,7 class TimeEntryQuery < Query | |||||
21 |
|
21 | |||
22 | self.available_columns = [ |
|
22 | self.available_columns = [ | |
23 | QueryColumn.new(:project, :sortable => "#{Project.table_name}.name", :groupable => true), |
|
23 | QueryColumn.new(:project, :sortable => "#{Project.table_name}.name", :groupable => true), | |
24 | QueryColumn.new(:spent_on, :sortable => ["#{TimeEntry.table_name}.spent_on", "#{TimeEntry.table_name}.created_on"]), |
|
24 | QueryColumn.new(:spent_on, :sortable => ["#{TimeEntry.table_name}.spent_on", "#{TimeEntry.table_name}.created_on"], :default_order => 'desc', :groupable => true), | |
25 | QueryColumn.new(:user, :sortable => lambda {User.fields_for_order_statement}, :groupable => true), |
|
25 | QueryColumn.new(:user, :sortable => lambda {User.fields_for_order_statement}, :groupable => true), | |
26 | QueryColumn.new(:activity, :sortable => "#{TimeEntryActivity.table_name}.position", :groupable => true), |
|
26 | QueryColumn.new(:activity, :sortable => "#{TimeEntryActivity.table_name}.position", :groupable => true), | |
27 | QueryColumn.new(:issue, :sortable => "#{Issue.table_name}.id"), |
|
27 | QueryColumn.new(:issue, :sortable => "#{Issue.table_name}.id"), | |
@@ -96,6 +96,13 class TimeEntryQuery < Query | |||||
96 | @available_filters |
|
96 | @available_filters | |
97 | end |
|
97 | end | |
98 |
|
98 | |||
|
99 | def available_columns | |||
|
100 | return @available_columns if @available_columns | |||
|
101 | @available_columns = self.class.available_columns.dup | |||
|
102 | @available_columns += TimeEntryCustomField.all.map {|cf| QueryCustomFieldColumn.new(cf) } | |||
|
103 | @available_columns | |||
|
104 | end | |||
|
105 | ||||
99 | def default_columns_names |
|
106 | def default_columns_names | |
100 | @default_columns_names ||= [:project, :spent_on, :user, :activity, :issue, :comments, :hours] |
|
107 | @default_columns_names ||= [:project, :spent_on, :user, :activity, :issue, :comments, :hours] | |
101 | end |
|
108 | end |
@@ -1,14 +1,25 | |||||
1 | <div id="query_form_content" class="hide-when-print"> |
|
1 | <div id="query_form_content" class="hide-when-print"> | |
2 | <fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>"> |
|
2 | <fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>"> | |
3 | <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend> |
|
3 | <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend> | |
4 | <div style="<%= @query.new_record? ? "" : "display: none;" %>"> |
|
4 | <div style="<%= @query.new_record? ? "" : "display: none;" %>"> | |
5 | <%= render :partial => 'queries/filters', :locals => {:query => @query} %> |
|
5 | <%= render :partial => 'queries/filters', :locals => {:query => @query} %> | |
6 | </div> |
|
6 | </div> | |
7 | </fieldset> |
|
7 | </fieldset> | |
|
8 | <fieldset class="collapsible collapsed"> | |||
|
9 | <legend onclick="toggleFieldset(this);"><%= l(:label_options) %></legend> | |||
|
10 | <div style="display: none;"> | |||
|
11 | <table> | |||
|
12 | <tr> | |||
|
13 | <td><%= l(:field_column_names) %></td> | |||
|
14 | <td><%= render :partial => 'queries/columns', :locals => {:query => @query} %></td> | |||
|
15 | </tr> | |||
|
16 | </table> | |||
|
17 | </div> | |||
|
18 | </fieldset> | |||
8 | </div> |
|
19 | </div> | |
9 |
|
20 | |||
10 | <p class="buttons hide-when-print"> |
|
21 | <p class="buttons hide-when-print"> | |
11 |
<%= link_to_function l(:button_apply), ' |
|
22 | <%= link_to_function l(:button_apply), 'submit_query_form("query_form")', :class => 'icon icon-checked' %> | |
12 | <%= link_to l(:button_clear), {:project_id => @project, :issue_id => @issue}, :class => 'icon icon-reload' %> |
|
23 | <%= link_to l(:button_clear), {:project_id => @project, :issue_id => @issue}, :class => 'icon icon-reload' %> | |
13 | </p> |
|
24 | </p> | |
14 |
|
25 |
@@ -3,49 +3,35 | |||||
3 | <div class="autoscroll"> |
|
3 | <div class="autoscroll"> | |
4 | <table class="list time-entries"> |
|
4 | <table class="list time-entries"> | |
5 | <thead> |
|
5 | <thead> | |
6 | <tr> |
|
6 | <tr> | |
7 | <th class="checkbox hide-when-print"> |
|
7 | <th class="checkbox hide-when-print"> | |
8 | <%= link_to image_tag('toggle_check.png'), |
|
8 | <%= link_to image_tag('toggle_check.png'), | |
9 | {}, |
|
9 | {}, | |
10 | :onclick => 'toggleIssuesSelection(this); return false;', |
|
10 | :onclick => 'toggleIssuesSelection(this); return false;', | |
11 | :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %> |
|
11 | :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %> | |
12 | </th> |
|
12 | </th> | |
13 | <%= sort_header_tag('spent_on', :caption => l(:label_date), :default_order => 'desc') %> |
|
13 | <% @query.inline_columns.each do |column| %> | |
14 | <%= sort_header_tag('user', :caption => l(:label_user)) %> |
|
14 | <%= column_header(column) %> | |
15 | <%= sort_header_tag('activity', :caption => l(:label_activity)) %> |
|
15 | <% end %> | |
16 | <%= sort_header_tag('project', :caption => l(:label_project)) %> |
|
16 | <th></th> | |
17 | <%= sort_header_tag('issue', :caption => l(:label_issue), :default_order => 'desc') %> |
|
17 | </tr> | |
18 | <th><%= l(:field_comments) %></th> |
|
|||
19 | <%= sort_header_tag('hours', :caption => l(:field_hours)) %> |
|
|||
20 | <th></th> |
|
|||
21 | </tr> |
|
|||
22 | </thead> |
|
18 | </thead> | |
23 | <tbody> |
|
19 | <tbody> | |
24 | <% entries.each do |entry| -%> |
|
20 | <% entries.each do |entry| -%> | |
25 | <tr class="time-entry <%= cycle("odd", "even") %> hascontextmenu"> |
|
21 | <tr class="time-entry <%= cycle("odd", "even") %> hascontextmenu"> | |
26 | <td class="checkbox hide-when-print"><%= check_box_tag("ids[]", entry.id, false, :id => nil) %></td> |
|
22 | <td class="checkbox hide-when-print"><%= check_box_tag("ids[]", entry.id, false, :id => nil) %></td> | |
27 | <td class="spent_on"><%= format_date(entry.spent_on) %></td> |
|
23 | <%= raw @query.inline_columns.map {|column| "<td class=\"#{column.css_classes}\">#{column_content(column, entry)}</td>"}.join %> | |
28 | <td class="user"><%= link_to_user(entry.user) %></td> |
|
24 | <td align="center"> | |
29 | <td class="activity"><%=h entry.activity %></td> |
|
25 | <% if entry.editable_by?(User.current) -%> | |
30 | <td class="project"><%= link_to_project(entry.project) %></td> |
|
26 | <%= link_to image_tag('edit.png'), edit_time_entry_path(entry), | |
31 | <td class="subject"> |
|
27 | :title => l(:button_edit) %> | |
32 | <% if entry.issue -%> |
|
28 | <%= link_to image_tag('delete.png'), time_entry_path(entry), | |
33 | <%= entry.issue.visible? ? link_to_issue(entry.issue, :truncate => 50) : "##{entry.issue.id}" -%> |
|
29 | :data => {:confirm => l(:text_are_you_sure)}, | |
34 | <% end -%> |
|
30 | :method => :delete, | |
35 | </td> |
|
31 | :title => l(:button_delete) %> | |
36 | <td class="comments"><%=h entry.comments %></td> |
|
32 | <% end -%> | |
37 | <td class="hours"><%= html_hours("%.2f" % entry.hours) %></td> |
|
33 | </td> | |
38 | <td align="center"> |
|
34 | </tr> | |
39 | <% if entry.editable_by?(User.current) -%> |
|
|||
40 | <%= link_to image_tag('edit.png'), edit_time_entry_path(entry), |
|
|||
41 | :title => l(:button_edit) %> |
|
|||
42 | <%= link_to image_tag('delete.png'), time_entry_path(entry), |
|
|||
43 | :data => {:confirm => l(:text_are_you_sure)}, |
|
|||
44 | :method => :delete, |
|
|||
45 | :title => l(:button_delete) %> |
|
|||
46 | <% end -%> |
|
|||
47 | </td> |
|
|||
48 | </tr> |
|
|||
49 | <% end -%> |
|
35 | <% end -%> | |
50 | </tbody> |
|
36 | </tbody> | |
51 | </table> |
|
37 | </table> |
@@ -211,7 +211,7 table.permissions td.role {color:#999;font-size:90%;font-weight:normal !importan | |||||
211 | tr.wiki-page-version td.updated_on, tr.wiki-page-version td.author {text-align:center;} |
|
211 | tr.wiki-page-version td.updated_on, tr.wiki-page-version td.author {text-align:center;} | |
212 |
|
212 | |||
213 | tr.time-entry { text-align: center; white-space: nowrap; } |
|
213 | tr.time-entry { text-align: center; white-space: nowrap; } | |
214 |
tr.time-entry td.su |
|
214 | tr.time-entry td.issue, tr.time-entry td.comments { text-align: left; white-space: normal; } | |
215 | td.hours { text-align: right; font-weight: bold; padding-right: 0.5em; } |
|
215 | td.hours { text-align: right; font-weight: bold; padding-right: 0.5em; } | |
216 | td.hours .hours-dec { font-size: 0.9em; } |
|
216 | td.hours .hours-dec { font-size: 0.9em; } | |
217 |
|
217 |
General Comments 0
You need to be logged in to leave comments.
Login now