diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2019-10-19 11:42:20 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2019-10-19 11:42:20 +0000 |
commit | 45f039187df03e8925cb0d08ccc1838c9ea2d5c2 (patch) | |
tree | 3bbb8958c71b24e65123c0e8f29d6f15726424d5 /app/models/query.rb | |
parent | ecd9d9ba2f43f2f5a88c1d34d34d07dae40dfe4e (diff) | |
download | redmine-45f039187df03e8925cb0d08ccc1838c9ea2d5c2.tar.gz redmine-45f039187df03e8925cb0d08ccc1838c9ea2d5c2.zip |
Option to switch between table list and board list (#29482).
Patch by Marius BALTEANU.
git-svn-id: http://svn.redmine.org/redmine/trunk@18765 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/query.rb')
-rw-r--r-- | app/models/query.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/models/query.rb b/app/models/query.rb index 7372f712e..19db899d8 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -409,6 +409,7 @@ class Query < ActiveRecord::Base self.column_names = params[:c] || query_params[:column_names] || self.column_names self.totalable_names = params[:t] || query_params[:totalable_names] || self.totalable_names self.sort_criteria = params[:sort] || query_params[:sort_criteria] || self.sort_criteria + self.display_type = params[:display_type] || query_params[:display_type] || self.display_type self end @@ -983,6 +984,21 @@ class Query < ActiveRecord::Base end end + def display_type + options[:display_type] || self.available_display_types.first + end + + def display_type=(type) + unless type || self.available_display_types.include?(type) + type = self.available_display_types.first + end + options[:display_type] = type + end + + def available_display_types + ['list'] + end + private def grouped_query(&block) |