Adds autocomplete to issue field on time logging form.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10182 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-08-09 16:58:36 +00:00
parent f82a7a35b0
commit f1650b8ff4
3 changed files with 13 additions and 2 deletions
+4 -2
View File
@@ -22,7 +22,7 @@ class AutoCompletesController < ApplicationController
@issues = []
q = (params[:q] || params[:term]).to_s.strip
if q.present?
scope = (params[:scope] == "all" ? Issue : @project.issues).visible
scope = (params[:scope] == "all" || @project.nil? ? Issue : @project.issues).visible
if q.match(/^\d+$/)
@issues << scope.find_by_id(q.to_i)
end
@@ -35,7 +35,9 @@ class AutoCompletesController < ApplicationController
private
def find_project
@project = Project.find(params[:project_id])
if params[:project_id].present?
@project = Project.find(params[:project_id])
end
rescue ActiveRecord::RecordNotFound
render_404
end