summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-04-03 14:31:32 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-04-03 14:31:32 +0000
commit3c06f66d716cb7abba98f5efec203afb0e3578e8 (patch)
treecdd6ad515364936a7cb69e5297c80856e210b691 /app
parent87bcb215630263f7ccb6480d2a44cf8901ea84d5 (diff)
downloadredmine-3c06f66d716cb7abba98f5efec203afb0e3578e8.tar.gz
redmine-3c06f66d716cb7abba98f5efec203afb0e3578e8.zip
Shorten query[column_names] param name.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5304 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/controllers/queries_controller.rb5
-rw-r--r--app/helpers/queries_helper.rb2
-rw-r--r--app/views/queries/_columns.rhtml2
3 files changed, 6 insertions, 3 deletions
diff --git a/app/controllers/queries_controller.rb b/app/controllers/queries_controller.rb
index e54c9befb..60f3b445f 100644
--- a/app/controllers/queries_controller.rb
+++ b/app/controllers/queries_controller.rb
@@ -25,10 +25,11 @@ class QueriesController < ApplicationController
@query.project = params[:query_is_for_all] ? nil : @project
@query.user = User.current
@query.is_public = false unless User.current.allowed_to?(:manage_public_queries, @project) || User.current.admin?
- @query.column_names = nil if params[:default_columns]
@query.add_filters(params[:fields] || params[:f], params[:operators] || params[:op], params[:values] || params[:v]) if params[:fields] || params[:f]
@query.group_by ||= params[:group_by]
+ @query.column_names = params[:c] if params[:c]
+ @query.column_names = nil if params[:default_columns]
if request.post? && params[:confirm] && @query.save
flash[:notice] = l(:notice_successful_create)
@@ -45,6 +46,8 @@ class QueriesController < ApplicationController
@query.attributes = params[:query]
@query.project = nil if params[:query_is_for_all]
@query.is_public = false unless User.current.allowed_to?(:manage_public_queries, @project) || User.current.admin?
+ @query.group_by ||= params[:group_by]
+ @query.column_names = params[:c] if params[:c]
@query.column_names = nil if params[:default_columns]
if @query.save
diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb
index b6dc697e3..61a1846d8 100644
--- a/app/helpers/queries_helper.rb
+++ b/app/helpers/queries_helper.rb
@@ -87,7 +87,7 @@ module QueriesHelper
end
end
@query.group_by = params[:group_by]
- @query.column_names = params[:query] && params[:query][:column_names]
+ @query.column_names = params[:c] || (params[:query] && params[:query][:column_names])
session[:query] = {:project_id => @query.project_id, :filters => @query.filters, :group_by => @query.group_by, :column_names => @query.column_names}
else
@query = Query.find_by_id(session[:query][:id]) if session[:query][:id]
diff --git a/app/views/queries/_columns.rhtml b/app/views/queries/_columns.rhtml
index 91ee627b2..f96d87b0a 100644
--- a/app/views/queries/_columns.rhtml
+++ b/app/views/queries/_columns.rhtml
@@ -10,7 +10,7 @@
<input type="button" value="&#8592;"
onclick="moveOptions(this.form.selected_columns, this.form.available_columns);" />
</td>
- <td><%= select_tag 'query[column_names][]',
+ <td><%= select_tag 'c[]',
options_for_select(query.columns.collect {|column| [column.caption, column.name]}),
:id => 'selected_columns', :multiple => true, :size => 10, :style => "width:150px" %>
</td>