From c1a18a28898fcac9fa6038bf42b67df43c2e728d Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 27 Apr 2007 16:21:53 +0000 Subject: [PATCH] Subproject name displayed on issue list, calendar and gantt (only for issues that belong to a subproject). git-svn-id: http://redmine.rubyforge.org/svn/trunk@484 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/projects_controller.rb | 4 ++-- app/views/projects/calendar.rhtml | 2 +- app/views/projects/gantt.rhtml | 2 +- app/views/projects/list_issues.rhtml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index c94810aa87..a471260528 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -559,7 +559,7 @@ class ProjectsController < ApplicationController @events = [] @project.issues_with_subprojects(params[:with_subprojects]) do @events += Issue.find(:all, - :include => [:tracker, :status, :assigned_to, :priority], + :include => [:tracker, :status, :assigned_to, :priority, :project], :conditions => ["((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?)) and #{Issue.table_name}.tracker_id in (#{@selected_tracker_ids.join(',')})", @date_from, @date_to, @date_from, @date_to] ) unless @selected_tracker_ids.empty? end @@ -597,7 +597,7 @@ class ProjectsController < ApplicationController @project.issues_with_subprojects(params[:with_subprojects]) do @events += Issue.find(:all, :order => "start_date, due_date", - :include => [:tracker, :status, :assigned_to, :priority], + :include => [:tracker, :status, :assigned_to, :priority, :project], :conditions => ["(((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?) or (start_date?)) and start_date is not null and due_date is not null and #{Issue.table_name}.tracker_id in (#{@selected_tracker_ids.join(',')}))", @date_from, @date_to, @date_from, @date_to, @date_from, @date_to] ) unless @selected_tracker_ids.empty? end diff --git a/app/views/projects/calendar.rhtml b/app/views/projects/calendar.rhtml index 4f4b5ab719..c63365b6c8 100644 --- a/app/views/projects/calendar.rhtml +++ b/app/views/projects/calendar.rhtml @@ -67,7 +67,7 @@ while day <= @date_to elsif day == i.due_date image_tag('arrow_to.png') end %> - <%= link_to_issue i %>: <%=h i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %> + <%= link_to_issue i %><%= " (#{i.project.name})" unless @project && @project == i.project %>: <%=h i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %> <%= render :partial => "issues/tooltip", :locals => { :issue => i }%> diff --git a/app/views/projects/gantt.rhtml b/app/views/projects/gantt.rhtml index c8490fd1ac..1b51b4a6e2 100644 --- a/app/views/projects/gantt.rhtml +++ b/app/views/projects/gantt.rhtml @@ -86,7 +86,7 @@ top = headers_height + 8 @events.each do |i| %>
<% if i.is_a? Issue %> - <%= link_to_issue i %>: + <%= link_to_issue i %><%= " (#{i.project.name})" unless @project && @project == i.project %>: <%=h i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %> <% else %> <%= "#{l(:label_version)}: #{i.name}" %> diff --git a/app/views/projects/list_issues.rhtml b/app/views/projects/list_issues.rhtml index 3f650ea5ef..8169e9753a 100644 --- a/app/views/projects/list_issues.rhtml +++ b/app/views/projects/list_issues.rhtml @@ -59,7 +59,7 @@ "> <%= check_box_tag "issue_ids[]", issue.id, false, :id => "issue_#{issue.id}" %> <%= link_to issue.id, :controller => 'issues', :action => 'show', :id => issue %> - <%= issue.tracker.name %> + <%= issue.tracker.name %> <%= "(#{issue.project.name})" unless @project && @project == issue.project %>
<%= issue.status.name %> <%= issue.priority.name %> <%= link_to h(issue.subject), :controller => 'issues', :action => 'show', :id => issue %>