diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-07-14 13:41:30 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-07-14 13:41:30 +0000 |
commit | 010bfc56e15f442e4e597ddc9c436361c61b1e7a (patch) | |
tree | 498f9a9cea5fac71c0f63c1a2f92ad02ed6f6470 /app/controllers/queries_controller.rb | |
parent | 3c9263221d3d914b3e6b5f0b8c66ebd859d75403 (diff) | |
download | redmine-010bfc56e15f442e4e597ddc9c436361c61b1e7a.tar.gz redmine-010bfc56e15f442e4e597ddc9c436361c61b1e7a.zip |
Ability to save Gantt query filters (#7836).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12020 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/queries_controller.rb')
-rw-r--r-- | app/controllers/queries_controller.rb | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/app/controllers/queries_controller.rb b/app/controllers/queries_controller.rb index cd1ec87a2..8c53f76ef 100644 --- a/app/controllers/queries_controller.rb +++ b/app/controllers/queries_controller.rb @@ -59,7 +59,7 @@ class QueriesController < ApplicationController if @query.save flash[:notice] = l(:notice_successful_create) - redirect_to _project_issues_path(@project, :query_id => @query) + redirect_to_issues(:query_id => @query) else render :action => 'new', :layout => !request.xhr? end @@ -77,7 +77,7 @@ class QueriesController < ApplicationController if @query.save flash[:notice] = l(:notice_successful_update) - redirect_to _project_issues_path(@project, :query_id => @query) + redirect_to_issues(:query_id => @query) else render :action => 'edit' end @@ -85,7 +85,7 @@ class QueriesController < ApplicationController def destroy @query.destroy - redirect_to _project_issues_path(@project, :set_filter => 1) + redirect_to_issues(:set_filter => 1) end private @@ -103,4 +103,16 @@ private rescue ActiveRecord::RecordNotFound render_404 end + + def redirect_to_issues(options) + if params[:gantt] + if @project + redirect_to project_gantt_path(@project, options) + else + redirect_to issues_gantt_path(options) + end + else + redirect_to _project_issues_path(@project, options) + end + end end |