Revision 729:291c4d7dc0b6 vendor/plugins

View differences:

vendor/plugins/redmine_tags/lib/redmine_tags/hooks/views_projects_hook.rb
1 1
module RedmineTags
2 2
  module Hooks
3 3
    class ViewsProjectsHook < Redmine::Hook::ViewListener
4
      render_on :view_projects_form, :partial => 'projects/tags_form'
4 5
      render_on :view_projects_show_left, :partial => 'projects/tags'
5
#      render_on :view_issues_form_details_bottom, :partial => 'issues/tags_form'
6 6
#      render_on :view_issues_sidebar_planning_bottom, :partial => 'issues/tags_sidebar'
7 7
    end
8 8
  end
vendor/plugins/redmine_tags/lib/redmine_tags/patches/auto_completes_controller_patch.rb
32 32
          @tags = Issue.available_tags :project_id => @project, :name_like => @name
33 33
          render :layout => false, :partial => 'tag_list'
34 34
        end
35

  
36
        def project_tags
37
          @name = params[:q].to_s
38
          @tags = Project.available_tags :project_id => @project, :name_like => @name
39
          render :layout => false, :partial => 'tag_list'
40
        end
35 41
      end
36 42
    end
37 43
  end
vendor/plugins/redmine_tags/lib/redmine_tags/patches/project_patch.rb
5 5
module RedmineTags
6 6
  module Patches
7 7
    module ProjectPatch
8
      def self.included(base)
8
      def self.included(base) # :nodoc:
9 9
        base.extend(ClassMethods)
10 10

  
11 11
        base.class_eval do
12 12
          unloadable
13 13
          acts_as_taggable
14
          alias_method_chain :before_save, :save_tags
14 15
        end
15 16
      end
16 17

  
18
      def before_save_with_save_tags(context={})
19

  
20
        logger.error { "GONNA SAVE TAG LIST" }
21
        logger.error { @project.name }
22

  
23
    #    if params && params[:project] && !params[:project][:tag_list].nil?
24
    #      old_tags = context[:project].tag_list.to_s
25
    #      context[:project].tag_list = params[:project][:tag_list]
26
    #      new_tags = context[:project].tag_list.to_s
27
    #
28
    #      unless (old_tags == new_tags || context[:project].current_journal.blank?)
29
    #        context[:project].current_journal.details << JournalDetail.new(:property => 'attr',
30
    #                                                                     :prop_key => 'tag_list',
31
    #                                                                     :old_value => old_tags,
32
    #                                                                     :value => new_tags)
33
    #      end
34
    #    end
35
      end
36
      
37

  
38

  
17 39
      module ClassMethods
18 40
        # Returns available issue tags
19 41
        # === Parameters
......
34 56
          end
35 57

  
36 58
          if open_only
37
            visible << ["#{Issue.table_name}.status_id IN " +
59
            visible << ["#{Project.table_name}.status_id IN " +
38 60
                        "( SELECT issue_status.id " + 
39 61
                        "    FROM #{IssueStatus.table_name} issue_status " +
40 62
                        "   WHERE issue_status.is_closed = ? )", false]

Also available in: Unified diff