From a206a850ffdeda7e740dba54e45317ab094c7e03 Mon Sep 17 00:00:00 2001 From: Michal Hrusecky Date: Sat, 19 Dec 2009 13:00:49 +0100 Subject: [PATCH 3/4] Stories follow goal to the new sprint in agile_pm Goal can be edited and moved to the new sprint when it wasn't accomplished in previous one. With this patch all unfinished stories belonging to this goal will follow the goal to the new sprint. --- extensions/agile_pm/lib/goals_controller.rb | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/extensions/agile_pm/lib/goals_controller.rb b/extensions/agile_pm/lib/goals_controller.rb index 75ccc19..49936dd 100644 --- a/extensions/agile_pm/lib/goals_controller.rb +++ b/extensions/agile_pm/lib/goals_controller.rb @@ -84,6 +84,15 @@ class GoalsController < ProjectAreaController respond_to do |format| if @goal.update_attributes(params[:goal]) flash[:notice] = _('Goal was successfully updated.') + sprint_id = params[:goal][:sprint_id] || 0 + if sprint_id.to_i > 0; then + @goal.story.each do |story| + if ! story.completed_at; then + story.sprint_id = sprint_id + story.save + end + end + end format.html { redirect_to sprint_location } format.xml { head :ok } else -- 1.6.6.rc3