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 / plugins / redmine_tags / lib / redmine_tags / patches / queries_helper_patch.rb @ 1248:1b44eeb49c5a

History | View | Annotate | Download (1.46 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
          unloadable
29
          alias_method :column_content_original, :column_content
30
          alias_method :column_content, :column_content_extended
31
        end
32
      end
33

    
34

    
35
      module InstanceMethods
36
        include TagsHelper
37

    
38

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