Skip to content

Commit

Permalink
Merge pull request #79 from nutso/develop
Browse files Browse the repository at this point in the history
merge to v1.5
  • Loading branch information
nutso committed Jun 14, 2015
2 parents 2a41fee + d65ec9e commit f66b0dd
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 9 deletions.
10 changes: 8 additions & 2 deletions README.md
Expand Up @@ -28,6 +28,8 @@ Follow standard Redmine plugin installation -- (barely) modified from http://www
1. Copy or clone the plugin directory into #{RAILS_ROOT}/plugins/recurring_tasks -- note the folder name 'recurring_tasks' must be verbatim.

e.g. git clone https://github.com/nutso/redmine-plugin-recurring-tasks.git recurring_tasks

NOTE! This particular clone will tie you to the master branch, which is not recommended for production systems (faster updates and features but less well-tested). Recommend using a specific version of the plugin which will provide a more stable baseline.

2. Rake the database migration (make a db backup before)

Expand All @@ -39,13 +41,17 @@ You should now be able to see the plugin list in Administration -> Plugins.

## Configuration
1. Set the check for recurrence via Crontab.
1. Set the check for recurrence via Crontab or similar.

Crontab example (running the check for recurrence every 6 hours on the 15s) -- replace {path_to_redmine} with your actual path, e.g. /var/www/redmine:
"Pure" crontab example (running the check for recurrence every 6 hours on the 15s) -- replace {path_to_redmine} with your actual path, e.g. /var/www/redmine:
```bash
15 */4 * * * /bin/sh "cd {path_to_redmine} && bundle exec rake RAILS_ENV=production redmine:recur_tasks" >> log/cron_rake.log 2>&1
```

You can also use e.g. cron.daily or cron.hourly to avoid having to figure out the precise cron syntax for the schedule; Ruby gems Rufus Scheduler and Whenever can also be used; the key point is that something needs to call recur_tasks on a regular basis.

More information on Rufus Scheduler config at [#72](https://github.com/nutso/redmine-plugin-recurring-tasks/issues/72)

2. Decide which role(s) should have the ability to view/add/edit/delete issue recurrence and configure accordingly in Redmine's permission manager (Administration > Roles and Permissions)
* View issue recurrence
* Add issue recurrence
Expand Down
6 changes: 5 additions & 1 deletion ReleaseNotes.md
Expand Up @@ -3,8 +3,9 @@
## Features Requested

* Option to 'predict' recurrences on calendar -- perhaps ghost the projected recurrences in ([#38](https://github.com/nutso/redmine-plugin-recurring-tasks/issues/38))
* Option to re-open recurring issue instead of creating a new issue, so all comments/information are stored in a single place ([#45](https://github.com/nutso/redmine-plugin-recurring-tasks/issues/45))
* Option to re-open recurring issue instead of creating a new issue, so all comments/information are stored in a single place ([#45](https://github.com/nutso/redmine-plugin-recurring-tasks/issues/45)); ([#45](https://github.com/nutso/redmine-plugin-recurring-tasks/issues/74))
* Option to enable recurrence on a per-project basis ([#36](https://github.com/nutso/redmine-plugin-recurring-tasks/issues/36))
* Configurable option to hide the "Recurring issues" link in the admin menu ([#54](https://github.com/nutso/redmine-plugin-recurring-tasks/issues/54))

## Known Issues

Expand All @@ -13,12 +14,15 @@

## Next Version (Develop Branch)

## Version 1.5.0 (13 June 2015)

* Backwards-compatibility to Redmine 2.2 by testing if issue.closed_on? method exists ([#49](https://github.com/nutso/redmine-plugin-recurring-tasks/issues/36))
* Redmine 3.0 support contributed by @lammel ([#65](https://github.com/nutso/redmine-plugin-recurring-tasks/pull/65))
* French translation updated by @jbeauvois ([#66](https://github.com/nutso/redmine-plugin-recurring-tasks/issues/66)
* Better documentation of plugin permissions
* Reversible migrations so can uninstall fully ([#53](https://github.com/nutso/redmine-plugin-recurring-tasks/issues/53))
* Highlighting to user that adding recurrence via issues page is the best way ([#52](https://github.com/nutso/redmine-plugin-recurring-tasks/issues/52))
* Stable support for both Redmine 2.x and Redmine 3.x ([#71](https://github.com/nutso/redmine-plugin-recurring-tasks/issues/71)); ([#67](https://github.com/nutso/redmine-plugin-recurring-tasks/issues/67)) and ([#69](https://github.com/nutso/redmine-plugin-recurring-tasks/issues/69))

## Version 1.4.0 (07 Sep 2014)

Expand Down
8 changes: 7 additions & 1 deletion app/models/recurring_task.rb
Expand Up @@ -249,7 +249,13 @@ def recur_issue_if_needed!
new_issue.due_date = next_scheduled_recurrence #41 previous_date_for_recurrence + recurrence_pattern
new_issue.start_date = new_issue.due_date
new_issue.done_ratio = 0
new_issue.status = issue.tracker.default_status # issue status is NOT automatically new, default is whatever the default status for new issues is
if issue.tracker.respond_to?(:default_status)
# Redmine 3
new_issue.status = issue.tracker.default_status # issue status is NOT automatically new, default is whatever the default status for new issues is
else
# Redmine 2
new_issue.status = IssueStatus.default
end
new_issue.save!
puts "Recurring #{issue.id}: #{issue.subj_date}, created #{new_issue.id}: #{new_issue.subj_date}"

Expand Down
4 changes: 2 additions & 2 deletions config/routes.rb
Expand Up @@ -9,5 +9,5 @@
match 'projects/:project_id/recurring_tasks/create', :to => 'recurring_tasks#create', :via => 'post'
match 'projects/:project_id/recurring_tasks/:id', :to => 'recurring_tasks#show', :as => :recurring_task, :via => 'get'
match 'projects/:project_id/recurring_tasks/:id/edit', :to => 'recurring_tasks#edit', :as => :edit_recurring_task, :via => 'get'
match 'projects/:project_id/recurring_tasks/:id/update', :to => 'recurring_tasks#update', :via => [:get, :post, :patch]
match 'projects/:project_id/recurring_tasks/:id/destroy', :to => 'recurring_tasks#destroy', :as => :destroy_recurring_task, :via => [:post, :delete]
match 'projects/:project_id/recurring_tasks/:id/update', :to => 'recurring_tasks#update', :via => [:put, :patch]
match 'projects/:project_id/recurring_tasks/:id/destroy', :to => 'recurring_tasks#destroy', :as => :destroy_recurring_task, :via => [:delete]
Expand Up @@ -2,7 +2,9 @@
# default modifier for existing issues. Otherwise validation error will occur.
class SetDefaultModifierForExistingMonthlyIssues < ActiveRecord::Migration
def up
RecurringTask.find_all_by_interval_unit(RecurringTask::INTERVAL_MONTH).each do |rt|
# find_all_by... deprecated for Rails 4/Redmine 3
# RecurringTask.find_all_by_interval_unit(RecurringTask::INTERVAL_MONTH).each do |rt|
RecurringTask.where(:interval_unit => RecurringTask::INTERVAL_MONTH).each do |rt|
begin
logger.info "Migrating task ##{rt.id}, interval unit #{rt.interval_unit}"
rt.interval_modifier = RecurringTask::MONTH_MODIFIER_DAY_FROM_FIRST
Expand Down
4 changes: 2 additions & 2 deletions init.rb
Expand Up @@ -9,8 +9,8 @@
author 'Teresa N.'
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.4.0'
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. Supports Redmine 2.x and 3.x'
version '1.5.0'

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

0 comments on commit f66b0dd

Please sign in to comment.