feedback.patch

Brad Beattie, 2009-04-30 01:52

Download (3.19 KB)

View differences:

.project (revision 0)
1
<?xml version="1.0" encoding="UTF-8"?>
2
<projectDescription>
3
	<name>Redmine</name>
4
	<comment></comment>
5
	<projects>
6
	</projects>
7
	<buildSpec>
8
	</buildSpec>
9
	<natures>
10
	</natures>
11
</projectDescription>
app/models/query.rb (working copy)
175 175
    if User.current.logged?
176 176
      @available_filters["watcher_id"] = { :type => :list, :order => 15, :values => [["<< #{l(:label_me)} >>", "me"]] }
177 177
    end
178
  
178
    
179
    @available_filters["relation_blocked_issues"] = { :type => :integer, :order => 51 }
180
    @available_filters["relation_blocking_issues"] = { :type => :integer, :order => 52 }
181
    @available_filters["relation_preceded_issues"] = { :type => :integer, :order => 53 }
182
    @available_filters["relation_preceding_issues"] = { :type => :integer, :order => 54 }
183
    
179 184
    if project
180 185
      # project specific filters
181 186
      unless @project.issue_categories.empty?
......
365 370
        db_field = 'user_id'
366 371
        sql << "#{Issue.table_name}.id #{ operator == '=' ? 'IN' : 'NOT IN' } (SELECT #{db_table}.watchable_id FROM #{db_table} WHERE #{db_table}.watchable_type='Issue' AND "
367 372
        sql << sql_for_field(field, '=', v, db_table, db_field) + ')'
373
      elsif field =~ /^relation_/
374
        v = "1" if operator == "*"
375
        operator = ">=" if operator == "*"
376
        operator = "!*" if operator == "=" && v == 0
377
        count_operator = "=" if operator == "="
378
        count_operator = ">=" if operator == ">="
379
        count_operator = ">" if operator == "<="
380
        
381
        sql << (operator == ">=" || operator == "=" ? "#{Issue.table_name}.id IN (" : "#{Issue.table_name}.id NOT IN (")
382
        sql << (field =~ /ed_issues$/ ? "SELECT ir.issue_to_id" : "SELECT ir.issue_from_id")
383
        sql << " FROM issue_relations AS ir"
384
        sql << " LEFT OUTER JOIN issues AS i2 ON ir.issue_from_id = i2.id"
385
        sql << " LEFT OUTER JOIN issue_statuses AS is2 ON i2.status_id = is2.id"
386
        sql << (field =~ /^relation_block/ ? " WHERE ir.relation_type='blocks'" : " WHERE ir.relation_type='precedes'")
387
        sql << " AND is2.is_closed = FALSE"
388
        sql << " GROUP BY ir.issue_to_id HAVING COUNT(*) #{count_operator} #{v}" unless operator == "!*" 
389
        sql << ")"
368 390
      else
369 391
        # regular field
370 392
        db_table = Issue.table_name
config/locales/en.yml (working copy)
243 243
  field_identity_url: OpenID URL
244 244
  field_content: Content
245 245
  field_group_by: Group results by
246
  field_relation_blocked_issues: Blocked by open issues
247
  field_relation_blocking_issues: Blocking other issues
248
  field_relation_preceded_issues: Preceded by open issues
249
  field_relation_preceding_issues: Preceding other issues
246 250
  
247 251
  setting_app_title: Application title
248 252
  setting_app_subtitle: Application subtitle