Project

General

Profile

Feature #9364 » limit_sub_issues-redmine-1.2-stable.diff

Gilles Ballanger, 2011-10-02 11:26

View differences:

app/models/query.rb (working copy)
193 193
                           "start_date" => { :type => :date, :order => 11 },
194 194
                           "due_date" => { :type => :date, :order => 12 },
195 195
                           "estimated_hours" => { :type => :integer, :order => 13 },
196
                           "done_ratio" =>  { :type => :integer, :order => 14 }}
196
                           "done_ratio" =>  { :type => :integer, :order => 14 },
197
                           "limit_sub_level" => { :type => :list, :order => 16, :values => ["0","1","2"]}}
197 198

  
198 199
    user_values = []
199 200
    user_values << ["<< #{l(:label_me)} >>", "me"] if User.current.logged?
......
503 504
        }.sort.collect(&:to_s)
504 505

  
505 506
        sql << '(' + sql_for_field("assigned_to_id", operator, members_of_roles, Issue.table_name, "assigned_to_id", false) + ')'
507
      elsif field == "limit_sub_level" # limit sub issues
508
        sql = "("
509
        v = v.to_s.to_i
510
        if v >= 0
511
          sql << "#{Issue.table_name}.parent_id IS NULL "
512
        end
513
        if v >= 1
514
          sql << "OR #{Issue.table_name}.parent_id IN" 
515
          sql << "( "
516
          sql << "SELECT #{Issue.table_name}.id "
517
          sql << "FROM #{Issue.table_name} "
518
          sql << "WHERE #{Issue.table_name}.parent_id IS NULL"
519
          sql << ")"
520
        end
521
        if v >= 2
522
          sql << "OR #{Issue.table_name}.parent_id IN" 
523
          sql << "( "
524
          sql << "SELECT #{Issue.table_name}.id "
525
          sql << "FROM #{Issue.table_name} "
526
          sql << "WHERE #{Issue.table_name}.parent_id IN"
527
          sql << "( "
528
          sql << "SELECT #{Issue.table_name}.id "
529
          sql << "FROM #{Issue.table_name} "
530
          sql << "WHERE #{Issue.table_name}.parent_id IS NULL"
531
          sql << ")"
532
          sql << ")"
533
        end
534
        sql << ")"
506 535
      else
507 536
        # regular field
508 537
        db_table = Issue.table_name
config/locales/en-GB.yml (working copy)
311 311
  field_text: Text field
312 312
  field_visible: Visible
313 313
  field_warn_on_leaving_unsaved: "Warn me when leaving a page with unsaved text"
314
  field_limit_sub_level: Sub issues limit
314 315
  
315 316
  setting_app_title: Application title
316 317
  setting_app_subtitle: Application subtitle
config/locales/en.yml (working copy)
315 315
  field_root_directory: Root directory
316 316
  field_cvsroot: CVSROOT
317 317
  field_cvs_module: Module
318
  field_limit_sub_level: Sub issues limit
318 319

  
319 320
  setting_app_title: Application title
320 321
  setting_app_subtitle: Application subtitle
config/locales/fr.yml (working copy)
314 314
  field_issues_visibility: Visibilité des demandes
315 315
  field_is_private: Privée
316 316
  field_commit_logs_encoding: Encodage des messages de commit
317

  
317
  field_limit_sub_level: Limite de sous tâche
318
  
318 319
  setting_app_title: Titre de l'application
319 320
  setting_app_subtitle: Sous-titre de l'application
320 321
  setting_welcome_text: Texte d'accueil
(1-1/2)