">
<%= link_to_project_settings(project, {}, :title => project.short_description) %> |
<%= checked_image project.is_public? %> |
<%= format_date(project.created_on) %> |
+ <%= format_date(project_activities[project.id]) %> |
<%= link_to(l(:button_archive), archive_project_path(project, :status => params[:status]), :data => {:confirm => l(:text_are_you_sure)}, :method => :post, :class => 'icon icon-lock') unless project.archived? %>
<%= link_to(l(:button_unarchive), unarchive_project_path(project, :status => params[:status]), :method => :post, :class => 'icon icon-unlock') if project.archived? && (project.parent.nil? || !project.parent.archived?) %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 018235a3d..6989d7629 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -258,6 +258,7 @@ en:
field_downloads: Downloads
field_author: Author
field_created_on: Created
+ field_last_activity: Last activity
field_updated_on: Updated
field_closed_on: Closed
field_field_format: Format
diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml
index 830d645d3..08a3247ac 100644
--- a/config/locales/pt-BR.yml
+++ b/config/locales/pt-BR.yml
@@ -224,6 +224,7 @@ pt-BR:
field_downloads: Downloads
field_author: Autor
field_created_on: Criado em
+ field_last_activity: Ăšltima atividade
field_updated_on: Alterado em
field_field_format: Formato
field_is_for_all: Para todos os projetos
diff --git a/lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb b/lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb
index 2bf4b2e8c..6f47ac96d 100644
--- a/lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb
+++ b/lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb
@@ -78,6 +78,10 @@ module Redmine
scope = scope.where(Project.allowed_to_condition(user, "view_#{self.name.underscore.pluralize}".to_sym, options))
end
+ if options[:last_by_project]
+ scope = scope.group("projects.id").maximum(provider_options[:timestamp])
+ end
+
scope.to_a
end
end
diff --git a/lib/redmine/activity/fetcher.rb b/lib/redmine/activity/fetcher.rb
index fccce54eb..c722326f4 100644
--- a/lib/redmine/activity/fetcher.rb
+++ b/lib/redmine/activity/fetcher.rb
@@ -85,6 +85,7 @@ module Redmine
def events(from = nil, to = nil, options={})
e = []
@options[:limit] = options[:limit]
+ @options[:last_by_project] = options[:last_by_project] if options[:last_by_project]
@scope.each do |event_type|
constantized_providers(event_type).each do |provider|
@@ -92,10 +93,14 @@ module Redmine
end
end
- e.sort! {|a,b| b.event_datetime <=> a.event_datetime}
+ if options[:last_by_project]
+ e.sort
+ else
+ e.sort! {|a,b| b.event_datetime <=> a.event_datetime}
- if options[:limit]
- e = e.slice(0, options[:limit])
+ if options[:limit]
+ e = e.slice(0, options[:limit])
+ end
end
e
end
|