Index: app/controllers/projects_controller.rb
===================================================================
--- app/controllers/projects_controller.rb	(revision 1354)
+++ app/controllers/projects_controller.rb	(working copy)
@@ -342,7 +343,7 @@
                            :conditions => ["((start_date BETWEEN ? AND ?) OR (due_date BETWEEN ? AND ?)) AND #{Issue.table_name}.tracker_id IN (#{@selected_tracker_ids.join(',')})", @calendar.startdt, @calendar.enddt, @calendar.startdt, @calendar.enddt]
                            ) unless @selected_tracker_ids.empty?
     end
-    events += @project.versions.find(:all, :conditions => ["effective_date BETWEEN ? AND ?", @calendar.startdt, @calendar.enddt])
+    events += @project.versions_with_subprojects(@with_subprojects, @calendar.startdt, @calendar.enddt)
     @calendar.events = events
     
     render :layout => false if request.xhr?
@@ -387,7 +388,7 @@
                            :conditions => ["(((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?) or (start_date<? and due_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
-    @events += @project.versions.find(:all, :conditions => ["effective_date BETWEEN ? AND ?", @date_from, @date_to])
+    @events += @project.versions_with_subprojects(@with_subprojects, @date_from, @date_to)
     @events.sort! {|x,y| x.start_date <=> y.start_date }
     
     if params[:format]=='pdf'
Index: app/models/project.rb
===================================================================
--- app/models/project.rb	(revision 1354)
+++ app/models/project.rb	(working copy)
@@ -83,6 +83,20 @@
       yield
     end 
   end
+  
+  def versions_with_subprojects(include_subprojects=false, startdt=nil, enddt=nil)
+    conditions = nil
+    if include_subprojects && !active_children.empty?
+      ids = [id] + active_children.collect {|c| c.id}
+      conditions = ["project_id IN (#{ids.join(',')})"] if not (startdt and enddt)
+      conditions ||= ["project_id IN (#{ids.join(',')}) AND effective_date BETWEEN ? AND ?", startdt, enddt]
+    else
+      conditions = ["project_id = #{id}"] if not (startdt and enddt)
+      conditions ||= ["project_id = #{id} AND effective_date BETWEEN ? AND ?", startdt, enddt]
+    end
+
+    Version.find :all, :conditions => conditions
+  end
 
   # returns latest created projects
   # non public projects will be returned only if user is a member of those
Index: app/views/common/_calendar.rhtml
===================================================================
--- app/views/common/_calendar.rhtml	(revision 1354)
+++ app/views/common/_calendar.rhtml	(working copy)
@@ -24,7 +24,10 @@
   <span class="tip"><%= render_issue_tooltip i %></span>
   </div>
   <% else %>
-  <%= link_to_version i, :class => "icon icon-package" %>
+  <span class="icon icon-package">  
+    <%= h("#{i.project.name} -") unless @project && @project == i.project %>
+    <%= link_to_version i%>
+  </span>
   <% end %>
 <% end %>
 </td>
Index: app/views/projects/gantt.rhtml
===================================================================
--- app/views/projects/gantt.rhtml	(revision 1354)
+++ app/views/projects/gantt.rhtml	(working copy)
@@ -73,7 +73,10 @@
       	<%= h("#{i.project.name} -") unless @project && @project == i.project %>
       	<%= link_to_issue i %>:	<%=h i.subject %>
   	<% else %>
-      	<%= link_to_version i, :class => "icon icon-package" %>
+		<span class="icon icon-package">
+	      	<%= h("#{i.project.name} -") unless @project && @project == i.project %>
+	      	<%= link_to_version i %>
+		</span>
   	<% end %>  	
   	</small></div>
     <% top = top + 20
@@ -197,7 +200,8 @@
     %>
     <div style="top:<%= top %>px;left:<%= i_left %>px;width:15px;" class="task milestone">&nbsp;</div>
 	<div style="top:<%= top %>px;left:<%= i_left + 12 %>px;background:#fff;" class="task">
-	<strong><%= i.name %></strong>
+		<%= h("#{i.project.name} -") unless @project && @project == i.project %>
+		<strong><%= i.name %></strong>
 	</div>
 <% end %>
 	<% top = top + 20
