Project

General

Profile

Feature #10912 ยป search_by_watcher.patch

Alexander Kriventsov, 2012-05-14 11:35

View differences:

app/models/query.rb 2012-05-14 09:32:32.000000000 +0000
264 264
    role_values = Role.givable.collect {|r| [r.name, r.id.to_s] }
265 265
    @available_filters["assigned_to_role"] = { :type => :list_optional, :order => 7, :values => role_values } unless role_values.empty?
266 266

  
267
    if User.current.logged?
268
      @available_filters["watcher_id"] = { :type => :list, :order => 15, :values => [["<< #{l(:label_me)} >>", "me"]] }
269
    end
267
    watcher_values = []
268
    watcher_values << ["<< #{l(:label_me)} >>", "me"] if User.current.logged?
269
    watcher_values += users.sort.collect{|s| [s.name, s.id.to_s] }
270
    @available_filters["watcher_id"] = { :type => :list, :order => 15, :values => watcher_values} unless watcher_values.empty?
270 271

  
271 272
    if project
272 273
      # project specific filters
    (1-1/1)