summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-05-08 12:46:15 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-05-08 12:46:15 +0000
commitdf0a49ff14474dd2230a823f57e95aa9d3b1cd71 (patch)
tree8cf5eff97f9ae378cccdf041135d5b0d1f364392 /app/controllers
parent50429d0819e41ea01837fccb7a878f0d878e5f6c (diff)
downloadredmine-df0a49ff14474dd2230a823f57e95aa9d3b1cd71.tar.gz
redmine-df0a49ff14474dd2230a823f57e95aa9d3b1cd71.zip
"me" value is now available in queries for "assigned to" and "author" filters.
When executing the query, it is replaced by the currently logged in user. git-svn-id: http://redmine.rubyforge.org/svn/trunk@520 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/feeds_controller.rb2
-rw-r--r--app/controllers/projects_controller.rb3
-rw-r--r--app/controllers/queries_controller.rb1
3 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/feeds_controller.rb b/app/controllers/feeds_controller.rb
index 9314db5e3..214f80c95 100644
--- a/app/controllers/feeds_controller.rb
+++ b/app/controllers/feeds_controller.rb
@@ -37,6 +37,7 @@ class FeedsController < ApplicationController
def issues
if @project && params[:query_id]
query = Query.find(params[:query_id])
+ query.executed_by = @user
# ignore query if it's not valid
query = nil unless query.valid?
# override with query conditions
@@ -56,6 +57,7 @@ class FeedsController < ApplicationController
def history
if @project && params[:query_id]
query = Query.find(params[:query_id])
+ query.executed_by = @user
# ignore query if it's not valid
query = nil unless query.valid?
# override with query conditions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 82468c21a..e90196495 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -647,11 +647,12 @@ private
def retrieve_query
if params[:query_id]
@query = @project.queries.find(params[:query_id])
+ @query.executed_by = logged_in_user
session[:query] = @query
else
if params[:set_filter] or !session[:query] or session[:query].project_id != @project.id
# Give it a name, required to be valid
- @query = Query.new(:name => "_")
+ @query = Query.new(:name => "_", :executed_by => logged_in_user)
@query.project = @project
if params[:fields] and params[:fields].is_a? Array
params[:fields].each do |field|
diff --git a/app/controllers/queries_controller.rb b/app/controllers/queries_controller.rb
index 7f7f01fd3..abafd19d4 100644
--- a/app/controllers/queries_controller.rb
+++ b/app/controllers/queries_controller.rb
@@ -42,6 +42,7 @@ class QueriesController < ApplicationController
private
def find_query
@query = Query.find(params[:id])
+ @query.executed_by = logged_in_user
@project = @query.project
# check if user is allowed to manage queries (same permission as add_query)
authorize('projects', 'add_query')