diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb index 9b0943aa7..0a263dd8a 100644 --- a/app/helpers/queries_helper.rb +++ b/app/helpers/queries_helper.rb @@ -92,6 +92,8 @@ module QueriesHelper progress_bar(value, :width => '80px') elsif column.name == :spent_hours sprintf "%.2f", value + elsif column.name == :hours + html_hours("%.2f" % value) else h(value.to_s) end @@ -106,7 +108,7 @@ module QueriesHelper when 'FalseClass' l(:general_text_No) when 'Issue' - link_to_issue(value, :subject => false) + value.visible? ? link_to_issue(value) : "##{value.id}" when 'IssueRelation' other = value.other_issue(issue) content_tag('span', diff --git a/app/models/time_entry_query.rb b/app/models/time_entry_query.rb index 60fc84312..9a2cd5af6 100644 --- a/app/models/time_entry_query.rb +++ b/app/models/time_entry_query.rb @@ -21,7 +21,7 @@ class TimeEntryQuery < Query self.available_columns = [ QueryColumn.new(:project, :sortable => "#{Project.table_name}.name", :groupable => true), - QueryColumn.new(:spent_on, :sortable => ["#{TimeEntry.table_name}.spent_on", "#{TimeEntry.table_name}.created_on"]), + QueryColumn.new(:spent_on, :sortable => ["#{TimeEntry.table_name}.spent_on", "#{TimeEntry.table_name}.created_on"], :default_order => 'desc', :groupable => true), QueryColumn.new(:user, :sortable => lambda {User.fields_for_order_statement}, :groupable => true), QueryColumn.new(:activity, :sortable => "#{TimeEntryActivity.table_name}.position", :groupable => true), QueryColumn.new(:issue, :sortable => "#{Issue.table_name}.id"), @@ -96,6 +96,13 @@ class TimeEntryQuery < Query @available_filters end + def available_columns + return @available_columns if @available_columns + @available_columns = self.class.available_columns.dup + @available_columns += TimeEntryCustomField.all.map {|cf| QueryCustomFieldColumn.new(cf) } + @available_columns + end + def default_columns_names @default_columns_names ||= [:project, :spent_on, :user, :activity, :issue, :comments, :hours] end diff --git a/app/views/timelog/_date_range.html.erb b/app/views/timelog/_date_range.html.erb index a0c180fc8..295be910e 100644 --- a/app/views/timelog/_date_range.html.erb +++ b/app/views/timelog/_date_range.html.erb @@ -1,14 +1,25 @@
diff --git a/app/views/timelog/_list.html.erb b/app/views/timelog/_list.html.erb index d311d10f7..522b13032 100644 --- a/app/views/timelog/_list.html.erb +++ b/app/views/timelog/_list.html.erb @@ -3,49 +3,35 @@<%= l(:field_comments) %> | -<%= sort_header_tag('hours', :caption => l(:field_hours)) %> -- | ||||||
---|---|---|---|---|---|---|---|
+ | |||||||
<%= format_date(entry.spent_on) %> | -<%= link_to_user(entry.user) %> | -<%=h entry.activity %> | -<%= link_to_project(entry.project) %> | --<% if entry.issue -%> -<%= entry.issue.visible? ? link_to_issue(entry.issue, :truncate => 50) : "##{entry.issue.id}" -%> -<% end -%> - | -<%=h entry.comments %> | -<%= html_hours("%.2f" % entry.hours) %> | --<% if entry.editable_by?(User.current) -%> - <%= link_to image_tag('edit.png'), edit_time_entry_path(entry), - :title => l(:button_edit) %> - <%= link_to image_tag('delete.png'), time_entry_path(entry), - :data => {:confirm => l(:text_are_you_sure)}, - :method => :delete, - :title => l(:button_delete) %> -<% end -%> - | -
#{column_content(column, entry)} | "}.join %> ++ <% if entry.editable_by?(User.current) -%> + <%= link_to image_tag('edit.png'), edit_time_entry_path(entry), + :title => l(:button_edit) %> + <%= link_to image_tag('delete.png'), time_entry_path(entry), + :data => {:confirm => l(:text_are_you_sure)}, + :method => :delete, + :title => l(:button_delete) %> + <% end -%> + | +