To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / vendor / plugins / redmine_tags / lib / redmine_tags / patches / queries_helper_patch.rb @ 798:829052890acb

History | View | Annotate | Download (1.44 KB)

1
# This file is a part of redmine_tags
2
# redMine plugin, that adds tagging support.
3
#
4
# Copyright (c) 2010 Aleksey V Zapparov AKA ixti
5
#
6
# redmine_tags is free software: you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation, either version 3 of the License, or
9
# (at your option) any later version.
10
#
11
# redmine_tags is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
# GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License
17
# along with redmine_tags.  If not, see <http://www.gnu.org/licenses/>.
18

    
19
require_dependency 'queries_helper'
20

    
21
module RedmineTags
22
  module Patches
23
    module QueriesHelperPatch
24
      def self.included(base)
25
        base.send(:include, InstanceMethods)
26

    
27
        base.class_eval do
28
          alias_method :column_content_original, :column_content
29
          alias_method :column_content, :column_content_extended
30
        end
31
      end
32

    
33

    
34
      module InstanceMethods
35
        include TagsHelper
36

    
37

    
38
        def column_content_extended(column, issue)
39
          if column.name.eql? :tags
40
            column.value(issue).collect{ |t| render_tag_link(t) }.join(', ')
41
          else
42
            column_content_original(column, issue)
43
          end
44
        end
45
      end
46
    end
47
  end
48
end