summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-04-01 15:00:23 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-04-01 15:00:23 +0000
commita669dfbd7f9408b4d341977a6d9c79bafb11b281 (patch)
treecb0a16063f753a80e8913665f22c81001108edc5 /app
parent25ea0f34a60c3ae59ee4c123865c96213365cca5 (diff)
downloadredmine-a669dfbd7f9408b4d341977a6d9c79bafb11b281.tar.gz
redmine-a669dfbd7f9408b4d341977a6d9c79bafb11b281.zip
Shortens filter param names.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5279 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/controllers/queries_controller.rb4
-rw-r--r--app/helpers/queries_helper.rb8
-rw-r--r--app/views/queries/_filters.rhtml14
3 files changed, 13 insertions, 13 deletions
diff --git a/app/controllers/queries_controller.rb b/app/controllers/queries_controller.rb
index 0b798636c..e54c9befb 100644
--- a/app/controllers/queries_controller.rb
+++ b/app/controllers/queries_controller.rb
@@ -27,7 +27,7 @@ class QueriesController < ApplicationController
@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[:operators], params[:values]) if params[:fields]
+ @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]
if request.post? && params[:confirm] && @query.save
@@ -41,7 +41,7 @@ class QueriesController < ApplicationController
def edit
if request.post?
@query.filters = {}
- @query.add_filters(params[:fields], params[:operators], params[:values]) if params[:fields]
+ @query.add_filters(params[:fields] || params[:f], params[:operators] || params[:op], params[:values] || params[:v]) if params[:fields] || params[:f]
@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?
diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb
index e9ab3769f..b6dc697e3 100644
--- a/app/helpers/queries_helper.rb
+++ b/app/helpers/queries_helper.rb
@@ -1,5 +1,5 @@
-# redMine - project management software
-# Copyright (C) 2006-2007 Jean-Philippe Lang
+# Redmine - project management software
+# Copyright (C) 2006-2011 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -78,9 +78,9 @@ module QueriesHelper
# Give it a name, required to be valid
@query = Query.new(:name => "_")
@query.project = @project
- if params[:fields]
+ if params[:fields] || params[:f]
@query.filters = {}
- @query.add_filters(params[:fields], params[:operators], params[:values])
+ @query.add_filters(params[:fields] || params[:f], params[:operators] || params[:op], params[:values] || params[:v])
else
@query.available_filters.keys.each do |field|
@query.add_short_filter(field, params[field]) if params[field]
diff --git a/app/views/queries/_filters.rhtml b/app/views/queries/_filters.rhtml
index d6d3db7f5..c0b79bfeb 100644
--- a/app/views/queries/_filters.rhtml
+++ b/app/views/queries/_filters.rhtml
@@ -83,26 +83,26 @@ Event.observe(document,"dom:loaded", apply_filters_observer);
options = filter[1] %>
<tr <%= 'style="display:none;"' unless query.has_filter?(field) %> id="tr_<%= field %>" class="filter">
<td style="width:200px;">
- <%= check_box_tag 'fields[]', field, query.has_filter?(field), :onclick => "toggle_filter('#{field}');", :id => "cb_#{field}" %>
+ <%= check_box_tag 'f[]', field, query.has_filter?(field), :onclick => "toggle_filter('#{field}');", :id => "cb_#{field}" %>
<label for="cb_<%= field %>"><%= filter[1][:name] || l(("field_"+field.to_s.gsub(/\_id$/, "")).to_sym) %></label>
</td>
<td style="width:150px;">
- <%= select_tag "operators[#{field}]", options_for_select(operators_for_select(options[:type]), query.operator_for(field)), :id => "operators_#{field}", :onchange => "toggle_operator('#{field}');", :class => "select-small", :style => "vertical-align: top;" %>
+ <%= select_tag "op[#{field}]", options_for_select(operators_for_select(options[:type]), query.operator_for(field)), :id => "operators_#{field}", :onchange => "toggle_operator('#{field}');", :class => "select-small", :style => "vertical-align: top;" %>
</td>
<td>
<div id="div_values_<%= field %>" style="display:none;">
<% case options[:type]
when :list, :list_optional, :list_status, :list_subprojects %>
- <select <%= "multiple=true" if query.values_for(field) and query.values_for(field).length > 1 %> name="values[<%= field %>][]" id="values_<%= field %>" class="select-small" style="vertical-align: top;">
+ <select <%= "multiple=true" if query.values_for(field) and query.values_for(field).length > 1 %> name="v[<%= field %>][]" id="values_<%= field %>" class="select-small" style="vertical-align: top;">
<%= options_for_select options[:values], query.values_for(field) %>
</select>
<%= link_to_function image_tag('bullet_toggle_plus.png'), "toggle_multi_select('#{field}');", :style => "vertical-align: bottom;" %>
<% when :date, :date_past %>
- <%= text_field_tag "values[#{field}][]", query.values_for(field), :id => "values_#{field}", :size => 3, :class => "select-small" %> <%= l(:label_day_plural) %>
+ <%= text_field_tag "v[#{field}][]", query.values_for(field), :id => "values_#{field}", :size => 3, :class => "select-small" %> <%= l(:label_day_plural) %>
<% when :string, :text %>
- <%= text_field_tag "values[#{field}][]", query.values_for(field), :id => "values_#{field}", :size => 30, :class => "select-small" %>
+ <%= text_field_tag "v[#{field}][]", query.values_for(field), :id => "values_#{field}", :size => 30, :class => "select-small" %>
<% when :integer %>
- <%= text_field_tag "values[#{field}][]", query.values_for(field), :id => "values_#{field}", :size => 3, :class => "select-small" %>
+ <%= text_field_tag "v[#{field}][]", query.values_for(field), :id => "values_#{field}", :size => 3, :class => "select-small" %>
<% end %>
</div>
<script type="text/javascript">toggle_filter('<%= field %>');</script>
@@ -120,4 +120,4 @@ Event.observe(document,"dom:loaded", apply_filters_observer);
</td>
</tr>
</table>
-<%= hidden_field_tag 'fields[]', '' %>
+<%= hidden_field_tag 'f[]', '' %>