##// END OF EJS Templates
bug fixed in projects/activity due to sql join...
Jean-Philippe Lang -
r81:256eb6250e69
parent child
Show More
@@ -389,7 +389,7 class ProjectsController < ApplicationController
389 end
389 end
390
390
391 unless params[:show_files] == "0"
391 unless params[:show_files] == "0"
392 Attachment.find(:all, :joins => "LEFT JOIN versions ON versions.id = attachments.container_id", :conditions => ["attachments.container_type='Version' and versions.project_id=? and attachments.created_on>=? and attachments.created_on<=?", @project.id, @date_from, @date_to] ).each { |i|
392 Attachment.find(:all, :select => "attachments.*", :joins => "LEFT JOIN versions ON versions.id = attachments.container_id", :conditions => ["attachments.container_type='Version' and versions.project_id=? and attachments.created_on>=? and attachments.created_on<=?", @project.id, @date_from, @date_to] ).each { |i|
393 @events_by_day[i.created_on.to_date] ||= []
393 @events_by_day[i.created_on.to_date] ||= []
394 @events_by_day[i.created_on.to_date] << i
394 @events_by_day[i.created_on.to_date] << i
395 }
395 }
@@ -397,7 +397,11 class ProjectsController < ApplicationController
397 end
397 end
398
398
399 unless params[:show_documents] == "0"
399 unless params[:show_documents] == "0"
400 Attachment.find(:all, :joins => "LEFT JOIN documents ON documents.id = attachments.container_id", :conditions => ["attachments.container_type='Document' and documents.project_id=? and attachments.created_on>=? and attachments.created_on<=?", @project.id, @date_from, @date_to] ).each { |i|
400 @project.documents.find(:all, :conditions => ["documents.created_on>=? and documents.created_on<=?", @date_from, @date_to] ).each { |i|
401 @events_by_day[i.created_on.to_date] ||= []
402 @events_by_day[i.created_on.to_date] << i
403 }
404 Attachment.find(:all, :select => "attachments.*", :joins => "LEFT JOIN documents ON documents.id = attachments.container_id", :conditions => ["attachments.container_type='Document' and documents.project_id=? and attachments.created_on>=? and attachments.created_on<=?", @project.id, @date_from, @date_to] ).each { |i|
401 @events_by_day[i.created_on.to_date] ||= []
405 @events_by_day[i.created_on.to_date] ||= []
402 @events_by_day[i.created_on.to_date] << i
406 @events_by_day[i.created_on.to_date] << i
403 }
407 }
@@ -25,11 +25,13
25 <% unless e.summary.empty? %><%= e.summary %><br /><% end %>
25 <% unless e.summary.empty? %><%= e.summary %><br /><% end %>
26 <i><%= e.author.name %></i>
26 <i><%= e.author.name %></i>
27 <% elsif (e.is_a? Attachment) and (e.container.is_a? Version) %>
27 <% elsif (e.is_a? Attachment) and (e.container.is_a? Version) %>
28 <%= e.created_on.strftime("%H:%M") %> <%=l(:label_attachment)%> (Version <%= e.container.name %>): <%= link_to e.filename, :controller => 'projects', :action => 'list_files', :id => @project %><br />
28 <%= e.created_on.strftime("%H:%M") %> <%=l(:label_attachment)%> (<%= e.container.name %>): <%= link_to e.filename, :controller => 'projects', :action => 'list_files', :id => @project %><br />
29 <i><%= e.author.name %></i>
29 <i><%= e.author.name %></i>
30 <% elsif (e.is_a? Attachment) and (e.container.is_a? Document) %>
30 <% elsif (e.is_a? Attachment) and (e.container.is_a? Document) %>
31 <%= e.created_on.strftime("%H:%M") %> <%=l(:label_document)%>: <%= link_to e.container.title, :controller => 'documents', :action => 'show', :id => e %><br />
31 <%= e.created_on.strftime("%H:%M") %> <%=l(:label_attachment)%>: <%= e.filename %> (<%= link_to e.container.title, :controller => 'documents', :action => 'show', :id => e.container %>)<br />
32 <i><%= e.author.name %></i>
32 <i><%= e.author.name %></i>
33 <% elsif e.is_a? Document %>
34 <%= e.created_on.strftime("%H:%M") %> <%=l(:label_document)%>: <%= link_to e.title, :controller => 'documents', :action => 'show', :id => e %><br />
33 <% end %>
35 <% end %>
34 </p></li>
36 </p></li>
35
37
General Comments 0
You need to be logged in to leave comments. Login now