reciprocity/ggrc-core — pull request #2100 by reciprocitylaran (2014-12-12 23:39:05+00:00)
Title: Get workflows to start as soon as possible and not skip the current time period when appropriate.

I corrected the date logic for cycle starts.
I corrected the calculation of the next_cycle_start_date for workflows.

min_start_date = minimum start date for all tasks in all task groups
max_end_date = maximum end date for all tasks in all task groups

Now, when a workflow is activated:
when today < min_start_date < max_end_date
* no cycle is created
* workflow next_cycle_start_date is set to min_start_date
when min_start_date < today < max_end_date
* cycle is created immediately
* workflow next_cycle_start_date is set to min_start_date + 1 cycle period (1 week, month, quarter, year)
when min_start_date < max_end_date < today
* no cycle is created
* workflow next_cycle_start_date is set to min_start_date + 1 cycle period (1 week, month, quarter, year)

All of the logic for calculating these dates has been moved to the backend. The only logic that was on the front end was calculating the base date. But now today is always the base date. So that was not needed. I took it out and that allowed me to consolidate the logic in the backend code.

This checkin also contains some code cleanup. Nothing major.