From cb8bee3a4e5a6fffc094665d8f0107e57a63d103 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 3 Oct 2007 17:38:18 +0000 Subject: [PATCH] Fixed: can't select columns when creating a new query. git-svn-id: http://redmine.rubyforge.org/svn/trunk@795 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/queries_controller.rb | 2 +- app/views/projects/list_issues.rhtml | 9 ++------- app/views/queries/_form.rhtml | 1 + 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/controllers/queries_controller.rb b/app/controllers/queries_controller.rb index 7c8460dd..72819bd6 100644 --- a/app/controllers/queries_controller.rb +++ b/app/controllers/queries_controller.rb @@ -37,7 +37,7 @@ class QueriesController < ApplicationController @query.add_filter(field, params[:operators][field], params[:values][field]) end if params[:fields] - if request.post? and @query.save + if request.post? && params[:confirm] && @query.save flash[:notice] = l(:notice_successful_create) redirect_to :controller => 'projects', :action => 'list_issues', :id => @project, :query_id => @query return diff --git a/app/views/projects/list_issues.rhtml b/app/views/projects/list_issues.rhtml index 3c90c30f..60e8f7be 100644 --- a/app/views/projects/list_issues.rhtml +++ b/app/views/projects/list_issues.rhtml @@ -2,7 +2,7 @@

<%=l(:label_issue_plural)%>

<% set_html_title l(:label_issue_plural) %> - <% form_tag({:action => 'list_issues'}, :id => 'query_form') do %> + <% form_tag({ :controller => 'queries', :action => 'new', :project_id => @project }, :id => 'query_form') do %> <%= render :partial => 'queries/filters', :locals => {:query => @query} %> <% end %>
@@ -18,12 +18,7 @@ }, :class => 'icon icon-reload' %> <% if current_role.allowed_to?(:save_queries) %> - <%= link_to_remote l(:button_save), - { :url => { :controller => 'queries', :action => 'new', :project_id => @project }, - :method => 'get', - :update => "content", - :with => "Form.serialize('query_form')" - }, :class => 'icon icon-save' %> + <%= link_to l(:button_save), {}, :onclick => "$('query_form').submit(); return false;", :class => 'icon icon-save' %> <% end %>

diff --git a/app/views/queries/_form.rhtml b/app/views/queries/_form.rhtml index 627058df..1620d9b0 100644 --- a/app/views/queries/_form.rhtml +++ b/app/views/queries/_form.rhtml @@ -1,4 +1,5 @@ <%= error_messages_for 'query' %> +<%= hidden_field_tag 'confirm', 1 %>