# HG changeset patch # User olivier # Date 1461852921 -7200 # Thu Apr 28 16:15:21 2016 +0200 # Branch 3.2-stable # Node ID 7b81492385c89026a2a21d09d1b2c02665a85d91 # Parent f08efbab6e60b29d6cc587db91992220711b7f6f Fix suggestion for not showing any totalable column when global options indicate some but the user deselected all. diff -r f08efbab6e60 -r 7b81492385c8 app/helpers/queries_helper.rb --- a/app/helpers/queries_helper.rb Sun Mar 13 17:17:27 2016 +0000 +++ b/app/helpers/queries_helper.rb Thu Apr 28 16:15:21 2016 +0200 @@ -87,7 +87,7 @@ def available_totalable_columns_tags(query) tags = ''.html_safe query.available_totalable_columns.each do |column| - tags << content_tag('label', check_box_tag('t[]', column.name.to_s, query.totalable_columns.include?(column), :id => nil) + " #{column.caption}", :class => 'inline') + tags << content_tag('label', check_box_tag('t[]', column.name.to_s, query.totalable_columns.include?(column), :id => nil) + " #{column.caption}", :class => 'inline', :onchange => 'document.getElementById(\'include_totals\').value=$(\'input[name="t[]"]\').is(\':checked\');') end tags end diff -r f08efbab6e60 -r 7b81492385c8 app/models/query.rb --- a/app/models/query.rb Sun Mar 13 17:17:27 2016 +0000 +++ b/app/models/query.rb Thu Apr 28 16:15:21 2016 +0200 @@ -250,6 +250,7 @@ end self.group_by = params[:group_by] || (params[:query] && params[:query][:group_by]) self.column_names = params[:c] || (params[:query] && params[:query][:column_names]) + options[:include_totals] = params[:include_totals].present? ? params[:include_totals].match(/false/).nil? : true self.totalable_names = params[:t] || (params[:query] && params[:query][:totalable_names]) self end @@ -511,7 +512,8 @@ end def totalable_names - options[:totalable_names] || Setting.issue_list_default_totals.map(&:to_sym) || [] + options[:include_totals] = true unless !options[:include_totals].nil? + options[:totalable_names] || options[:include_totals] && Setting.issue_list_default_totals.map(&:to_sym) || [] end def sort_criteria=(arg) diff -r f08efbab6e60 -r 7b81492385c8 app/views/issues/index.html.erb --- a/app/views/issues/index.html.erb Sun Mar 13 17:17:27 2016 +0000 +++ b/app/views/issues/index.html.erb Thu Apr 28 16:15:21 2016 +0200 @@ -41,7 +41,8 @@