Project

General

Profile

RE: Smart issues sort plugin ยป redmine_smart_issues_sort-2.3.patch

Patch for redmine 2.3.x (stripped) - Massimo Rossello, 2013-06-06 16:03

View differences:

lib/issues_helper_patch.rb
14 14
      module InstanceMethods
15 15
        def sidebar_queries_with_category
16 16
          unless @sidebar_queries
17
            if Redmine::VERSION::MAJOR > 2 || 
18
              (Redmine::VERSION::MAJOR == 2 && Redmine::VERSION::MINOR >= 3)  
19
              @sidebar_queries = IssueQuery.visible.all(
20
                :order => "#{IssueQuery.table_name}.name ASC",
21
                # Project specific queries and global queries
22
                :conditions => (@project.nil? ? ["project_id IS NULL"] : ["project_id IS NULL OR project_id = ?", @project.id]),
23
                # Make sure we load category as well
24
                :select => [:name, :category, :is_public]
25
              )
26
            else
17 27
              @sidebar_queries = Query.visible.all(
18 28
                :order => "#{Query.table_name}.name ASC",
19 29
                # Project specific queries and global queries
......
22 32
                :select => [:name, :category, :is_public]
23 33
              )
24 34
            end
35
          end
25 36
          @sidebar_queries
26 37
        end
27 38

  
lib/query_patch.rb
94 94
  end
95 95
end
96 96

  
97
if Redmine::VERSION::MAJOR > 2 || 
98
   (Redmine::VERSION::MAJOR == 2 && Redmine::VERSION::MINOR >= 3) 
99
  unless IssueQuery.included_modules.include? SmartIssuesSort::Patches::QuerySortCriteriaPatch
100
    IssueQuery.send(:include, SmartIssuesSort::Patches::QuerySortCriteriaPatch)
101
  end
102
else
97 103
  unless Query.included_modules.include? SmartIssuesSort::Patches::QuerySortCriteriaPatch
98 104
    Query.send(:include, SmartIssuesSort::Patches::QuerySortCriteriaPatch)
99 105
  end
106
end
100 107

  
101 108
unless Redmine::Helpers::Gantt.included_modules.include? SmartIssuesSort::Patches::GanttChartPatch
102 109
  Redmine::Helpers::Gantt.send(:include, SmartIssuesSort::Patches::GanttChartPatch)
    (1-1/1)