]> source.dussan.org Git - redmine.git/commitdiff
Roadmap: sort issues by project and prepend project name if different (#4373).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 12 Dec 2009 15:33:31 +0000 (15:33 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 12 Dec 2009 15:33:31 +0000 (15:33 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3163 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/projects_controller.rb
app/helpers/application_helper.rb
app/views/projects/roadmap.rhtml

index ad7ec8ef3211270748452a35702abe9891d48d23..386807f55d5bedab393e0954ae2084d96970d8ed 100644 (file)
@@ -319,9 +319,9 @@ class ProjectsController < ApplicationController
           conditions.merge!(:project_id => project_ids)
         end
         issues = version.fixed_issues.visible.find(:all,
-                                                   :include => [:status, :tracker, :priority],
+                                                   :include => [:project, :status, :tracker, :priority],
                                                    :conditions => conditions,
-                                                   :order => "#{Tracker.table_name}.position, #{Issue.table_name}.id")
+                                                   :order => "#{Project.table_name}.lft, #{Tracker.table_name}.position, #{Issue.table_name}.id")
         @issues_by_version[version] = issues
       end
     end
index cbecb505506c863beb18947e733079eb2dd4e1d1..3e1d6cea81b4129314ad419bcdfb429b3ff215d2 100644 (file)
@@ -64,6 +64,7 @@ module ApplicationHelper
   #   link_to_issue(issue)                        # => Defect #6: This is the subject
   #   link_to_issue(issue, :truncate => 6)        # => Defect #6: This i...
   #   link_to_issue(issue, :subject => false)     # => Defect #6
+  #   link_to_issue(issue, :project => true)      # => Foo - Defect #6
   #
   def link_to_issue(issue, options={})
     title = nil
@@ -80,6 +81,7 @@ module ApplicationHelper
                                                  :class => issue.css_classes,
                                                  :title => title
     s << ": #{h subject}" if subject
+    s = "#{h issue.project} - " + s if options[:project]
     s
   end
 
index 7b0a11dc6a6d49aaed917f9d7e35b9548573f42f..a31b35385bf694850e28a2595755458440d54ea0 100644 (file)
@@ -14,7 +14,7 @@
     <fieldset class="related-issues"><legend><%= l(:label_related_issues) %></legend>
     <ul>
     <%- issues.each do |issue| -%>
-        <li><%= link_to_issue(issue) %></li>
+        <li><%= link_to_issue(issue, :project => (@project != issue.project)) %></li>
     <%- end -%>
     </ul>
     </fieldset>
@@ -29,7 +29,7 @@
 <h3><%= l(:label_roadmap) %></h3>
 <% @trackers.each do |tracker| %>
   <label><%= check_box_tag "tracker_ids[]", tracker.id, (@selected_tracker_ids.include? tracker.id.to_s), :id => nil %>
-  <%= tracker.name %></label><br />
+  <%=h tracker.name %></label><br />
 <% end %>
 <br />
 <label for="completed"><%= check_box_tag "completed", 1, params[:completed] %> <%= l(:label_show_completed_versions) %></label>