comparison app/controllers/issues_controller.rb @ 110:4e2245195548 live

* Patch across changeset b0086cb55640 from luisf branch -- backing out initial fix for Feature #31 because it made it impossible to update the status of an issue
author Chris Cannam
date Mon, 20 Dec 2010 12:11:34 +0000
parents 7c828d63cb06
children ab75f33dcc6f
comparison
equal deleted inserted replaced
101:2248a45897a0 110:4e2245195548
134 flash[:notice] = l(:notice_successful_create) 134 flash[:notice] = l(:notice_successful_create)
135 135
136 call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue}) 136 call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue})
137 137
138 # Adds user to watcher's list 138 # Adds user to watcher's list
139 @issue.add_watcher(User.current) 139 # @issue.add_watcher(User.current)
140 140
141 # Also adds the assignee to the watcher's list 141 # Also adds the assignee to the watcher's list
142 if params[:issue][:assigned_to_id] && !params[:issue][:assigned_to_id].empty?: 142 # if params[:issue][:assigned_to_id] && !params[:issue][:assigned_to_id].empty?:
143 unless @issue.watcher_ids.include?(params[:issue][:assigned_to_id]): 143 # unless @issue.watcher_ids.include?(params[:issue][:assigned_to_id]):
144 @issue.add_watcher(User.find(params[:issue][:assigned_to_id])) 144 # @issue.add_watcher(User.find(params[:issue][:assigned_to_id]))
145 end 145 # end
146 end 146 # end
147 147
148 respond_to do |format| 148 respond_to do |format|
149 format.html { 149 format.html {
150 redirect_to(params[:continue] ? { :action => 'new', :project_id => @project, :issue => {:tracker_id => @issue.tracker, :parent_issue_id => @issue.parent_issue_id}.reject {|k,v| v.nil?} } : 150 redirect_to(params[:continue] ? { :action => 'new', :project_id => @project, :issue => {:tracker_id => @issue.tracker, :parent_issue_id => @issue.parent_issue_id}.reject {|k,v| v.nil?} } :
151 { :action => 'show', :id => @issue }) 151 { :action => 'show', :id => @issue })
289 289
290 # tests if the the user assigned_to_id 290 # tests if the the user assigned_to_id
291 # is in this issues watcher's list 291 # is in this issues watcher's list
292 # if not, adds it. 292 # if not, adds it.
293 293
294 if params[:issue][:assigned_to_id] && !params[:issue][:assigned_to_id].empty?: 294 # if params[:issue][:assigned_to_id] && !params[:issue][:assigned_to_id].empty?:
295 unless @issue.watcher_ids.include?(params[:issue][:assigned_to_id]): 295 # unless @issue.watcher_ids.include?(params[:issue][:assigned_to_id]):
296 @issue.add_watcher(User.find(params[:issue][:assigned_to_id])) 296 # @issue.add_watcher(User.find(params[:issue][:assigned_to_id]))
297 end 297 # end
298 end 298 # end
299 299
300 300
301 end 301 end
302 302
303 # TODO: Refactor, lots of extra code in here 303 # TODO: Refactor, lots of extra code in here