[Patch] Show % complete for a milestone
|Reported by:||rjollos||Owned by:||ChrisNelson|
The % complete measure shown for a milestone on Trac's roadmap page is calculated as (num closed tickets) / (num total tickets) * 100. This seems like a reasonable starting point for estimating % complete for a milestone, with the potential for more sophisticated calculations to be done in the future, such as using the %complete info for all tickets associated with a milestone.
Therefore I've modified the chart to show in the % complete column for milestones, the value calculated by (num closed tickets) / ( num total tickets) * 100.
In the future, the private method __get_milestone_percent_complete could be extended to support other calculations of % completion for a milestone.
This patch satisfies my needs, but if you want me to add options to control this behavior or make some other modifications, please let me know.
This patch also goes well with another patch I intend to make - determine the start and end dates for a milestone using the earliest start date and latest due date of any tickets associated with the milestone. Or perhaps, just make this change for the start date and continue to use the due date for a milestone. I still need to look more closely at this to work out a proposed plan.
Note: I also removed the comment FIXME - perhaps a closed ticket should always be 100% done. because it looked like this had already been implemented.
This change also ties in with #8947. If there is an option to group tickets under milestones, then especially in that case it make sense to show % complete for that milestone.