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
This commit is contained in:
Jean-Philippe Lang 2007-10-03 17:38:18 +00:00
parent 20b4e226fe
commit cb8bee3a4e
3 changed files with 4 additions and 8 deletions

View File

@ -37,7 +37,7 @@ class QueriesController < ApplicationController
@query.add_filter(field, params[:operators][field], params[:values][field]) @query.add_filter(field, params[:operators][field], params[:values][field])
end if params[:fields] end if params[:fields]
if request.post? and @query.save if request.post? && params[:confirm] && @query.save
flash[:notice] = l(:notice_successful_create) flash[:notice] = l(:notice_successful_create)
redirect_to :controller => 'projects', :action => 'list_issues', :id => @project, :query_id => @query redirect_to :controller => 'projects', :action => 'list_issues', :id => @project, :query_id => @query
return return

View File

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

View File

@ -1,4 +1,5 @@
<%= error_messages_for 'query' %> <%= error_messages_for 'query' %>
<%= hidden_field_tag 'confirm', 1 %>
<div class="box"> <div class="box">
<div class="tabular"> <div class="tabular">