Reverted removal of project assignment to query (#9108).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7656 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
856b777362
commit
a47979bcc2
|
@ -71,6 +71,7 @@ module QueriesHelper
|
|||
cond << " OR project_id = #{@project.id}" if @project
|
||||
@query = Query.find(params[:query_id], :conditions => cond)
|
||||
raise ::Unauthorized unless @query.visible?
|
||||
@query.project = @project
|
||||
session[:query] = {:id => @query.id, :project_id => @query.project_id}
|
||||
sort_clear
|
||||
elsif api_request? || params[:set_filter] || session[:query].nil? || session[:query][:project_id] != (@project ? @project.id : nil)
|
||||
|
@ -82,7 +83,7 @@ module QueriesHelper
|
|||
else
|
||||
# retrieve from session
|
||||
@query = Query.find_by_id(session[:query][:id]) if session[:query][:id]
|
||||
@query ||= Query.new(:name => "_", :project_id => session[:project_id] || @project, :filters => session[:query][:filters], :group_by => session[:query][:group_by], :column_names => session[:query][:column_names])
|
||||
@query ||= Query.new(:name => "_", :project => @project, :filters => session[:query][:filters], :group_by => session[:query][:group_by], :column_names => session[:query][:column_names])
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue