Commit 9586269a authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

Issues pagination loses project param after applying or clearing filter (#2726).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2459 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent ff9da0ba
...@@ -263,8 +263,8 @@ module ApplicationHelper ...@@ -263,8 +263,8 @@ module ApplicationHelper
def pagination_links_full(paginator, count=nil, options={}) def pagination_links_full(paginator, count=nil, options={})
page_param = options.delete(:page_param) || :page page_param = options.delete(:page_param) || :page
url_param = params.dup url_param = params.dup
# don't reuse params if filters are present # don't reuse query params if filters are present
url_param.clear if url_param.has_key?(:set_filter) url_param.merge!(:fields => nil, :values => nil, :operators => nil) if url_param.delete(:set_filter)
html = '' html = ''
if paginator.current.previous if paginator.current.previous
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<% html_title(l(:label_issue_plural)) %> <% html_title(l(:label_issue_plural)) %>
<% form_tag({ :controller => 'queries', :action => 'new' }, :id => 'query_form') do %> <% form_tag({ :controller => 'queries', :action => 'new' }, :id => 'query_form') do %>
<%= hidden_field_tag('project_id', @project.id) if @project %> <%= hidden_field_tag('project_id', @project.to_param) if @project %>
<fieldset id="filters"><legend><%= l(:label_filter_plural) %></legend> <fieldset id="filters"><legend><%= l(:label_filter_plural) %></legend>
<%= render :partial => 'queries/filters', :locals => {:query => @query} %> <%= render :partial => 'queries/filters', :locals => {:query => @query} %>
<p class="buttons"> <p class="buttons">
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
}, :class => 'icon icon-checked' %> }, :class => 'icon icon-checked' %>
<%= link_to_remote l(:button_clear), <%= link_to_remote l(:button_clear),
{ :url => { :set_filter => 1, :project_id => (@project.nil? ? nil : @project.id) }, { :url => { :set_filter => 1, :project_id => @project },
:method => :get, :method => :get,
:update => "content", :update => "content",
}, :class => 'icon icon-reload' %> }, :class => 'icon icon-reload' %>
......
...@@ -95,7 +95,10 @@ function toggle_multi_select(field) { ...@@ -95,7 +95,10 @@ function toggle_multi_select(field) {
</td> </td>
<td class="add-filter"> <td class="add-filter">
<%= l(:label_filter_add) %>: <%= l(:label_filter_add) %>:
<%= select_tag 'add_filter_select', options_for_select([["",""]] + query.available_filters.sort{|a,b| a[1][:order]<=>b[1][:order]}.collect{|field| [ field[1][:name] || l(("field_"+field[0].to_s.gsub(/\_id$/, "")).to_sym), field[0]] unless query.has_filter?(field[0])}.compact), :onchange => "add_filter();", :class => "select-small" %> <%= select_tag 'add_filter_select', options_for_select([["",""]] + query.available_filters.sort{|a,b| a[1][:order]<=>b[1][:order]}.collect{|field| [ field[1][:name] || l(("field_"+field[0].to_s.gsub(/_id$/, "")).to_sym), field[0]] unless query.has_filter?(field[0])}.compact),
:onchange => "add_filter();",
:class => "select-small",
:name => nil %>
</td> </td>
</tr> </tr>
</table> </table>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment