Revision 750:3ee8507c841f vendor/plugins/redmine_tags/lib/redmine_tags/patches
| vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_controller_patch.rb | ||
|---|---|---|
| 56 | 56 |
|
| 57 | 57 |
def calculate_filtered_projects |
| 58 | 58 |
|
| 59 |
@question = (params[:q] || "").strip |
|
| 60 |
@custom_fields = params[:custom_fields] || {}
|
|
| 59 |
@question = (params[:q] || "").strip |
|
| 61 | 60 |
|
| 61 |
if params.has_key?(:project) |
|
| 62 |
@tag_list = (params[:project][:tag_list] || "").strip.split(",")
|
|
| 63 |
else |
|
| 64 |
@tag_list = [] |
|
| 65 |
end |
|
| 66 |
|
|
| 62 | 67 |
@projects = Project.visible |
| 63 | 68 |
|
| 64 |
unless @custom_fields.empty? |
|
| 65 |
@projects = @projects.with_custom_values(params[:custom_fields]) |
|
| 66 |
end |
|
| 67 |
|
|
| 68 | 69 |
@featured_projects = @projects.featured if Project.respond_to? :featured |
| 69 | 70 |
|
| 70 |
@projects = @projects.search_by_question(@question) |
|
| 71 |
debugger |
|
| 71 |
# luisf |
|
| 72 |
@projects = @projects.search_by_question(@question) unless @question == "" |
|
| 73 |
@tagged_projects_ids = Project.tagged_with(@tag_list).collect{ |project| Project.find(project.id) } unless @tag_list.empty?
|
|
| 74 |
|
|
| 75 |
# intersection of both prject groups |
|
| 76 |
@projects = @projects && @tagged_projects_ids unless @tag_list.empty? |
|
| 77 |
|
|
| 78 |
# luisf: what exactly are the featured projects? could they be "my projects"? |
|
| 72 | 79 |
@featured_projects = @featured_projects.search_by_question(@question) if @featured_projects |
| 73 | 80 |
|
| 74 | 81 |
end |
Also available in: Unified diff