diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index c140ce338..0cdcc1c30 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -88,13 +88,17 @@ class UsersController < ApplicationController # 获取我的任务 # order 排序条件 + # subject 主题:搜索用 + # 搜索和列表调用同一方法 def user_issues - # Issues = Issue.visible.open.where("assigned_to_id = #{assigned_to_id} or author_id = #{User.current.id} er_course_ids.join(',')}) and container_type = 'Course')"+ - # "or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) - # and is_publish = 1 and container_id is not null)" ).order("#{order.nil? ? 'created_on' : order} #{score}") - # - # @issues = @Issues= Issue.visible.open. - # where(:assigned_to_id => User.current.id) + subject = params[:subject] + author_id = params[:author_id] + @issues = Issue.find(:all, :conditions => ["author_id = ? and assigned_to_id =? AND subject like ?", (author_id ? author_id : User.current.id) , User.current.id, "%#{subject}%"]) + respond_to do |format| + format.html + format.api + format.js + end end diff --git a/app/views/users/user_issues.html.erb b/app/views/users/user_issues.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/config/routes.rb b/config/routes.rb index 704ca9363..17f9e6353 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -638,6 +638,7 @@ RedmineApp::Application.routes.draw do get 'edit_brief_introduction' get "user_resource" + get "user_issues" get "import_resources" get "import_resources_search" post "import_into_container"