Skip to content

Commit 013c22d

Browse files
committed
#71 integrated patch from @jmfarina for redmine 2 versus redmine 3 switch
1 parent 0193bba commit 013c22d

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,13 @@ You should now be able to see the plugin list in Administration -> Plugins.
4343
4444
1. Set the check for recurrence via Crontab.
4545

46-
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:
46+
"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:
4747
```bash
4848
15 */4 * * * /bin/sh "cd {path_to_redmine} && bundle exec rake RAILS_ENV=production redmine:recur_tasks" >> log/cron_rake.log 2>&1
4949
```
5050

51+
You can also use e.g. cron.daily or cron.hourly to avoid having to figure out the precise cron syntax for the schedule.
52+
5153
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)
5254
* View issue recurrence
5355
* Add issue recurrence

ReleaseNotes.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,14 @@
1313
* Deleting an issue does not provide a warning about deleting associated recurrences
1414
* v1.4 is the stable version to use for Redmine 2.x for now; master will continue to support Redmine 2.x and 3.x but Redmine 2 in master is broken
1515

16-
## Semi-Stable (Master Branch)
17-
* Support for Redmine 3 and rails 4 ([#67](https://github.com/nutso/redmine-plugin-recurring-tasks/issues/67)) and ([#69](https://github.com/nutso/redmine-plugin-recurring-tasks/issues/69))
1816

1917
## Next Version (Develop Branch)
2018

2119
* 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))
2220
* Better documentation of plugin permissions
2321
* Reversible migrations so can uninstall fully ([#53](https://github.com/nutso/redmine-plugin-recurring-tasks/issues/53))
2422
* Highlighting to user that adding recurrence via issues page is the best way ([#52](https://github.com/nutso/redmine-plugin-recurring-tasks/issues/52))
25-
*
23+
* 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))
2624

2725
## Version 1.4.0 (07 Sep 2014)
2826

app/models/recurring_task.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,13 @@ def recur_issue_if_needed!
249249
new_issue.due_date = next_scheduled_recurrence #41 previous_date_for_recurrence + recurrence_pattern
250250
new_issue.start_date = new_issue.due_date
251251
new_issue.done_ratio = 0
252-
new_issue.status = issue.tracker.default_status # issue status is NOT automatically new, default is whatever the default status for new issues is
252+
if issue.tracker.respond_to?(:default_status)
253+
# Redmine 3
254+
new_issue.status = issue.tracker.default_status # issue status is NOT automatically new, default is whatever the default status for new issues is
255+
else
256+
# Redmine 2
257+
new_issue.status = IssueStatus.default
258+
end
253259
new_issue.save!
254260
puts "Recurring #{issue.id}: #{issue.subj_date}, created #{new_issue.id}: #{new_issue.subj_date}"
255261

0 commit comments

Comments
 (0)