diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-03-05 13:44:08 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-03-05 13:44:08 +0000 |
commit | bbe8ea29e8d3e6de60b96c08d60de9447bcceca9 (patch) | |
tree | 759b4deb14fe8c0476e042f18168f912cf461377 /app/controllers | |
parent | fbcdfee622729792ab58648228209bbd3c2142b6 (diff) | |
download | redmine-bbe8ea29e8d3e6de60b96c08d60de9447bcceca9.tar.gz redmine-bbe8ea29e8d3e6de60b96c08d60de9447bcceca9.zip |
Display the last 30 days on the activity view rather than the current month.
Number of days can be configured in the application settings.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1196 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects_controller.rb | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index f9d6d0f0b..b9758c810 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -218,25 +218,14 @@ class ProjectsController < ApplicationController end def activity - if params[:year] and params[:year].to_i > 1900 - @year = params[:year].to_i - if params[:month] and params[:month].to_i > 0 and params[:month].to_i < 13 - @month = params[:month].to_i - end + @days = Setting.activity_days_default.to_i + + if params[:from] + begin; @date_to = params[:from].to_date; rescue; end end - @year ||= Date.today.year - @month ||= Date.today.month - case params[:format] - when 'atom' - # 30 last days - @date_from = Date.today - 30 - @date_to = Date.today + 1 - else - # current month - @date_from = Date.civil(@year, @month, 1) - @date_to = @date_from >> 1 - end + @date_to ||= Date.today + 1 + @date_from = @date_to - @days @event_types = %w(issues news files documents changesets wiki_pages messages) @event_types.delete('wiki_pages') unless @project.wiki |