Revision 755:bde9c5bfb559 vendor/plugins/redmine_tags/lib

View differences:

vendor/plugins/redmine_tags/lib/redmine_project_filtering.rb
3 3
  # transforms a question and a list of custom fields into something that Project.search can process
4 4
  def self.calculate_tokens(question, custom_fields=nil)
5 5
    list = []
6
    list << custom_fields.values if custom_fields.present?
7 6
    list << question if question.present?
8 7

  
9 8
    tokens = list.join(' ').scan(%r{((\s|^)"[\s\w]+"(\s|$)|\S+)})
vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_controller_patch.rb
25 25
          end
26 26
        end
27 27

  
28
        # luisf - TO BE REMOVED?
29
        def calculate_project_filtering_settings
30
          @project_filtering_settings = Setting[:plugin_redmine_project_filtering]
31
        end
28
        # # luisf - TO BE REMOVED?
29
        # def calculate_project_filtering_settings
30
        #   @project_filtering_settings = Setting[:plugin_redmine_project_filtering]
31
        # end
32 32

  
33 33
        def filter_projects
34 34
          @project = Project.new
......
53 53

  
54 54
        private
55 55

  
56
        def calculate_filtered_projects
56
        def calculate_filtered_projects                  
57 57
          @question = (params[:q] || "").strip     
58 58

  
59 59
          if params.has_key?(:project)
......
70 70
          @projects = @projects.search_by_question(@question) unless @question == ""
71 71
          @tagged_projects_ids = Project.tagged_with(@tag_list).collect{ |project| Project.find(project.id) } unless @tag_list.empty?
72 72

  
73
          debugger
74

  
73 75
          # intersection of both prject groups            
74 76
          @projects = @projects && @tagged_projects_ids unless @tag_list.empty?
75

  
76
          # luisf: what exactly are the featured projects? could they be "my projects"?
77
          #        if not should remove this code…
78
          @featured_projects = @featured_projects.search_by_question(@question) if @featured_projects
79

  
77
          
78
          @filtered_projects = @projects
80 79
        end
81 80
      end
82 81
    end
vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_helper_patch.rb
19 19
        # general activity level, whether there is anything actually hosted
20 20
        # here for the project, etc.
21 21
        def render_project_table_with_filtering(projects, question)
22
          debugger
23
          
22 24
          custom_fields = ""
23 25
          s = ""
24 26
          if projects.any?

Also available in: Unified diff