Skip to content

Commit

Permalink
Merge pull request #19 from nutso/develop
Browse files Browse the repository at this point in the history
checking for nil due date on fixed schedule recurrence
  • Loading branch information
teresan committed Dec 31, 2013
2 parents 641cf9c + cc95016 commit 3eb7538
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/models/recurring_task.rb
Expand Up @@ -48,7 +48,7 @@ def next_scheduled_recurrence

# whether a recurrence needs to be added
def need_to_recur?
if(fixed_schedule and (issue.due_date + recurrence_pattern) <= (Time.now.to_date + 1.day)) then true else issue.closed? end
if(fixed_schedule and (previous_date_for_recurrence + recurrence_pattern) <= (Time.now.to_date + 1.day)) then true else issue.closed? end
end

# check whether a recurrence is needed, and add one if not
Expand Down Expand Up @@ -94,6 +94,6 @@ def self.add_recurrences!
# for a fixed schedule, this is the due date
# for a relative schedule, this is the date closed
def previous_date_for_recurrence
if fixed_schedule then issue.due_date else issue.closed_on end
if fixed_schedule and !issue.due_date.nil? then issue.due_date else issue.closed_on end
end
end
2 changes: 1 addition & 1 deletion init.rb
Expand Up @@ -10,7 +10,7 @@
author_url 'https://github.com/nutso/'
url 'https://github.com/nutso/redmine-plugin-recurring-tasks'
description 'Allows you to set a task to recur on a regular schedule, or when marked complete, regenerate a new task due in the future. Plugin is based -- very loosely -- on the periodic tasks plugin published by Tanguy de Courson'
version '1.2'
version '1.2.5'

Redmine::MenuManager.map :top_menu do |menu|
menu.push :recurring_tasks, { :controller => 'recurring_tasks', :action => 'index' }, :caption => 'Recurring Issues', :if => Proc.new { User.current.admin? } # TODO localize string
Expand Down

0 comments on commit 3eb7538

Please sign in to comment.