summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/timelog_controller.rb2
-rw-r--r--app/models/time_entry_query.rb5
-rw-r--r--app/views/settings/_timelog.html.erb2
3 files changed, 4 insertions, 5 deletions
diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb
index 50fcab2f7..47dc7c4f5 100644
--- a/app/controllers/timelog_controller.rb
+++ b/app/controllers/timelog_controller.rb
@@ -283,6 +283,6 @@ private
end
def retrieve_time_entry_query
- retrieve_query(TimeEntryQuery, false, :defaults => Setting.time_entry_list_defaults.symbolize_keys)
+ retrieve_query(TimeEntryQuery, false, :defaults => @default_columns_names)
end
end
diff --git a/app/models/time_entry_query.rb b/app/models/time_entry_query.rb
index 1a938c5bf..260800078 100644
--- a/app/models/time_entry_query.rb
+++ b/app/models/time_entry_query.rb
@@ -103,14 +103,13 @@ class TimeEntryQuery < Query
def default_columns_names
@default_columns_names ||= begin
- default_columns = [:spent_on, :user, :activity, :issue, :comments, :hours]
-
+ default_columns = Setting.time_entry_list_defaults.symbolize_keys[:column_names].map(&:to_sym)
project.present? ? default_columns : [:project] | default_columns
end
end
def default_totalable_names
- [:hours]
+ Setting.time_entry_list_defaults.symbolize_keys[:totalable_names].map(&:to_sym)
end
def default_sort_criteria
diff --git a/app/views/settings/_timelog.html.erb b/app/views/settings/_timelog.html.erb
index e3c0a5657..bc5f054c2 100644
--- a/app/views/settings/_timelog.html.erb
+++ b/app/views/settings/_timelog.html.erb
@@ -13,9 +13,9 @@
<legend><%= l(:setting_time_entry_list_defaults) %></legend>
<% query = TimeEntryQuery.new(Setting.time_entry_list_defaults) %>
+ <%= hidden_field_tag('settings[time_entry_list_defaults][column_names][]', '') %>
<%= render_query_columns_selection(query,
:name => 'settings[time_entry_list_defaults][column_names]') %>
-
<p>
<label><%= l(:label_total_plural) %></label>
<%= available_totalable_columns_tags(query,