diff --git a/assets/javascripts/reporting/filters.js b/assets/javascripts/reporting/filters.js index 88932ff2d9..0a4d483cfe 100644 --- a/assets/javascripts/reporting/filters.js +++ b/assets/javascripts/reporting/filters.js @@ -134,7 +134,7 @@ Reporting.Filters = { return $("filter_table").childElements().first().select('tr').select(function (tr) { return tr.visible() === true; }).collect(function (filter) { - return filter.className; + return filter.getAttribute("data-filter-name"); }); }, diff --git a/assets/javascripts/reporting/restore_query.js b/assets/javascripts/reporting/restore_query.js index dcd3e406af..9107df74c6 100644 --- a/assets/javascripts/reporting/restore_query.js +++ b/assets/javascripts/reporting/restore_query.js @@ -66,7 +66,9 @@ Reporting.RestoreQuery = { // FIXME: rm_xxx values for filters have to be set after re-displaying them $$("tr[data-selected=true]").each(function (e) { var rm_box = e.select("input[id^=rm]").first(); - rm_box.value = rm_box.getAttribute("data-filter-name"); + var filter_name = e.getAttribute("data-filter-name"); + rm_box.value = filter_name; + Reporting.Filters.select_option_enabled($("add_filter_select"), filter_name, false); }); } }; diff --git a/lib/widget/controls/query_name.rb b/lib/widget/controls/query_name.rb index 1ad2829bc7..5cfe51f15e 100644 --- a/lib/widget/controls/query_name.rb +++ b/lib/widget/controls/query_name.rb @@ -2,7 +2,7 @@ class Widget::Controls::QueryName < Widget::Base def render options = { :id => "query_saved_name", "data-translations" => translations } if @query.new_record? - name = l(:label_save_this_query) + name = l(:label_new_report) icon = "" else name = @query.name diff --git a/lib/widget/filters.rb b/lib/widget/filters.rb index 366ba5507a..f55ebcc9f3 100644 --- a/lib/widget/filters.rb +++ b/lib/widget/filters.rb @@ -34,7 +34,9 @@ class Widget::Filters < Widget::Base def render_filters active_filters = @query.filters.select { |f| f.class.display? } engine::Filter.all.collect do |filter| - opts = {:id => "tr_#{filter.underscore_name}", :class => "#{filter.underscore_name} filter"} + opts = {:id => "tr_#{filter.underscore_name}", + :class => "#{filter.underscore_name} filter", + :"data-filter-name" => filter.underscore_name } active_instance = active_filters.detect { |f| f.class == filter } if active_instance opts[:"data-selected"] = true diff --git a/lib/widget/filters/remove_button.rb b/lib/widget/filters/remove_button.rb index 3ba76a5f6a..8820ce0c4d 100644 --- a/lib/widget/filters/remove_button.rb +++ b/lib/widget/filters/remove_button.rb @@ -3,8 +3,7 @@ class Widget::Filters::RemoveButton < Widget::Filters::Base content_tag :td, :width => "25px" do tag :input, :id => "rm_#{filter_class.underscore_name}", :name => "fields[]", :type => "button", :value => "", - :class => "icon filter_rem icon-filter-rem", - :"data-filter-name" => filter_class.underscore_name + :class => "icon filter_rem icon-filter-rem" end end end diff --git a/lib/widget/filters/text_box.rb b/lib/widget/filters/text_box.rb index 56e05aafe7..ae25d29b67 100644 --- a/lib/widget/filters/text_box.rb +++ b/lib/widget/filters/text_box.rb @@ -3,6 +3,7 @@ class Widget::Filters::TextBox < Widget::Filters::Base content_tag :td do content_tag :div, :id => "#{filter_class.underscore_name}_arg_1", :class => "filter_values" do text_field_tag("values[#{filter_class.underscore_name}]", "", + :size => "6", :class => "select-small", :id => "#{filter_class.underscore_name}_arg_1_val", :'data-filter-name' => filter_class.underscore_name)