From: Jean-Philippe Lang Date: Sat, 3 Dec 2016 08:29:44 +0000 (+0000) Subject: Don't show project column by default when inside a project. X-Git-Tag: 3.4.0~529 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=af1182c8ba64f5b55b52da298ff602f76b0806af;p=redmine.git Don't show project column by default when inside a project. git-svn-id: http://svn.redmine.org/redmine/trunk@16042 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/time_entry_query.rb b/app/models/time_entry_query.rb index 74263ba9c..620847da0 100644 --- a/app/models/time_entry_query.rb +++ b/app/models/time_entry_query.rb @@ -122,7 +122,11 @@ class TimeEntryQuery < Query end def default_columns_names - @default_columns_names ||= [:project, :spent_on, :user, :activity, :issue, :comments, :hours] + @default_columns_names ||= begin + default_columns = [:spent_on, :user, :activity, :issue, :comments, :hours] + + project.present? ? default_columns : [:project] | default_columns + end end def default_totalable_names