Project

General

Profile

Defect #3923 ยป issues_controller_patch.diff

GOYELLO IT Services, 2009-09-25 09:01

View differences:

app/controllers/issues_controller.rb (kopia robocza)
265 265
        flash[:notice] = l(:notice_successful_update) unless @issues.empty?
266 266
      else
267 267
        flash[:error] = l(:notice_failed_to_save_issues, :count => unsaved_issue_ids.size,
268
                                                         :total => @issues.size,
269
                                                         :ids => '#' + unsaved_issue_ids.join(', #'))
268
          :total => @issues.size,
269
          :ids => '#' + unsaved_issue_ids.join(', #'))
270 270
      end
271 271
      redirect_to(params[:back_to] || {:controller => 'issues', :action => 'index', :project_id => @project})
272 272
      return
273 273
    end
274 274
    # Find potential statuses the user could be allowed to switch issues to
275 275
    @available_statuses = Workflow.find(:all, :include => :new_status,
276
                                              :conditions => {:role_id => User.current.roles_for_project(@project).collect(&:id)}).collect(&:new_status).compact.uniq.sort
277
    @custom_fields = @project.issue_custom_fields.select {|f| f.field_format == 'list'}
276
      :conditions => {:role_id => User.current.roles_for_project(@project).collect(&:id)}).collect(&:new_status).compact.uniq.sort
277

  
278
    trackers = @issues.collect(&:tracker).compact.uniq
279
    issue_custom_fields = nil;
280
    trackers.each do |tracker|
281
      if(issue_custom_fields.nil?)
282
        issue_custom_fields = tracker.custom_fields;
283
      else
284
        issue_custom_fields = issue_custom_fields & tracker.custom_fields;
285
      end
286
    end
287

  
288
    issue_custom_fields = [] if issue_custom_fields.nil?
289
    issue_custom_fields &= CustomField.for_all if !issue_custom_fields.empty?;
290
    
291
    @custom_fields = (@project.issue_custom_fields +
292
        issue_custom_fields).select {|f| f.field_format == 'list'}
278 293
  end
279 294

  
280 295
  def move
    (1-1/1)