diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-03-23 15:58:02 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-03-23 15:58:02 +0000 |
commit | 724ca74f51e01e5f5d43fc8b9264de285f163713 (patch) | |
tree | 72f47da847a4454919137c1bec79a8f25a43dd0f /app/controllers/projects_controller.rb | |
parent | 76d4ac17a2aa449b59f0dbd38de7f94bafce8fde (diff) | |
download | redmine-724ca74f51e01e5f5d43fc8b9264de285f163713.tar.gz redmine-724ca74f51e01e5f5d43fc8b9264de285f163713.zip |
patch #9429 Display Wiki edits in activity log (Nick Read)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@370 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/projects_controller.rb')
-rw-r--r-- | app/controllers/projects_controller.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 8feb5f5de..129355851 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -499,6 +499,26 @@ class ProjectsController < ApplicationController @show_documents = 1 end + unless params[:show_wiki_edits] == "0" + select = "#{WikiContent.versioned_table_name}.updated_on, #{WikiContent.versioned_table_name}.comment, " + + "#{WikiContent.versioned_table_name}.#{WikiContent.version_column}, #{WikiPage.table_name}.title" + joins = "LEFT JOIN #{WikiPage.table_name} ON #{WikiPage.table_name}.id = #{WikiContent.versioned_table_name}.page_id " + + "LEFT JOIN #{Wiki.table_name} ON #{Wiki.table_name}.id = #{WikiPage.table_name}.wiki_id " + conditions = ["#{Wiki.table_name}.project_id = ? AND #{WikiContent.versioned_table_name}.updated_on BETWEEN ? AND ?", + @project.id, @date_from, @date_to] + + WikiContent.versioned_class.find(:all, :select => select, :joins => joins, :conditions => conditions).each { |i| + # We provide this alias so all events can be treated in the same manner + def i.created_on + self.updated_on + end + + @events_by_day[i.created_on.to_date] ||= [] + @events_by_day[i.created_on.to_date] << i + } + @show_wiki_edits = 1 + end + render :layout => false if request.xhr? end |