diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-11-02 19:45:14 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-11-02 19:45:14 +0000 |
commit | dfc594c33702a123674dcae1d6b4bfe3a2f32fd3 (patch) | |
tree | 42f8653451b35f54db68bf914e1d963bfaf13418 /lib | |
parent | 32b79b6fd4e3a523ee393d7a3e2bb60dbeed77c3 (diff) | |
download | redmine-dfc594c33702a123674dcae1d6b4bfe3a2f32fd3.tar.gz redmine-dfc594c33702a123674dcae1d6b4bfe3a2f32fd3.zip |
Default status per tracker (#5991).
git-svn-id: http://svn.redmine.org/redmine/trunk@13535 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redmine/default_data/loader.rb | 22 | ||||
-rw-r--r-- | lib/tasks/migrate_from_mantis.rake | 10 | ||||
-rw-r--r-- | lib/tasks/migrate_from_trac.rake | 6 |
3 files changed, 19 insertions, 19 deletions
diff --git a/lib/redmine/default_data/loader.rb b/lib/redmine/default_data/loader.rb index 231a59175..9358795d5 100644 --- a/lib/redmine/default_data/loader.rb +++ b/lib/redmine/default_data/loader.rb @@ -125,18 +125,18 @@ module Redmine :browse_repository, :view_changesets] - # Trackers - Tracker.create!(:name => l(:default_tracker_bug), :is_in_chlog => true, :is_in_roadmap => false, :position => 1) - Tracker.create!(:name => l(:default_tracker_feature), :is_in_chlog => true, :is_in_roadmap => true, :position => 2) - Tracker.create!(:name => l(:default_tracker_support), :is_in_chlog => false, :is_in_roadmap => false, :position => 3) - # Issue statuses - new = IssueStatus.create!(:name => l(:default_issue_status_new), :is_closed => false, :is_default => true, :position => 1) - in_progress = IssueStatus.create!(:name => l(:default_issue_status_in_progress), :is_closed => false, :is_default => false, :position => 2) - resolved = IssueStatus.create!(:name => l(:default_issue_status_resolved), :is_closed => false, :is_default => false, :position => 3) - feedback = IssueStatus.create!(:name => l(:default_issue_status_feedback), :is_closed => false, :is_default => false, :position => 4) - closed = IssueStatus.create!(:name => l(:default_issue_status_closed), :is_closed => true, :is_default => false, :position => 5) - rejected = IssueStatus.create!(:name => l(:default_issue_status_rejected), :is_closed => true, :is_default => false, :position => 6) + new = IssueStatus.create!(:name => l(:default_issue_status_new), :is_closed => false, :position => 1) + in_progress = IssueStatus.create!(:name => l(:default_issue_status_in_progress), :is_closed => false, :position => 2) + resolved = IssueStatus.create!(:name => l(:default_issue_status_resolved), :is_closed => false, :position => 3) + feedback = IssueStatus.create!(:name => l(:default_issue_status_feedback), :is_closed => false, :position => 4) + closed = IssueStatus.create!(:name => l(:default_issue_status_closed), :is_closed => true, :position => 5) + rejected = IssueStatus.create!(:name => l(:default_issue_status_rejected), :is_closed => true, :position => 6) + + # Trackers + Tracker.create!(:name => l(:default_tracker_bug), :default_status_id => new.id, :is_in_chlog => true, :is_in_roadmap => false, :position => 1) + Tracker.create!(:name => l(:default_tracker_feature), :default_status_id => new.id, :is_in_chlog => true, :is_in_roadmap => true, :position => 2) + Tracker.create!(:name => l(:default_tracker_support), :default_status_id => new.id, :is_in_chlog => false, :is_in_roadmap => false, :position => 3) # Workflow Tracker.all.each { |t| diff --git a/lib/tasks/migrate_from_mantis.rake b/lib/tasks/migrate_from_mantis.rake index 1040dbb0a..d312238c0 100644 --- a/lib/tasks/migrate_from_mantis.rake +++ b/lib/tasks/migrate_from_mantis.rake @@ -25,15 +25,15 @@ task :migrate_from_mantis => :environment do module MantisMigrate - DEFAULT_STATUS = IssueStatus.default + new_status = IssueStatus.find_by_position(1) assigned_status = IssueStatus.find_by_position(2) resolved_status = IssueStatus.find_by_position(3) feedback_status = IssueStatus.find_by_position(4) closed_status = IssueStatus.where(:is_closed => true).first - STATUS_MAPPING = {10 => DEFAULT_STATUS, # new + STATUS_MAPPING = {10 => new_status, # new 20 => feedback_status, # feedback - 30 => DEFAULT_STATUS, # acknowledged - 40 => DEFAULT_STATUS, # confirmed + 30 => new_status, # acknowledged + 40 => new_status, # confirmed 50 => assigned_status, # assigned 80 => resolved_status, # resolved 90 => closed_status # closed @@ -317,8 +317,8 @@ task :migrate_from_mantis => :environment do i.author = User.find_by_id(users_map[bug.reporter_id]) i.category = IssueCategory.find_by_project_id_and_name(i.project_id, bug.category[0,30]) unless bug.category.blank? i.fixed_version = Version.find_by_project_id_and_name(i.project_id, bug.fixed_in_version) unless bug.fixed_in_version.blank? - i.status = STATUS_MAPPING[bug.status] || DEFAULT_STATUS i.tracker = (bug.severity == 10 ? TRACKER_FEATURE : TRACKER_BUG) + i.status = STATUS_MAPPING[bug.status] || i.status i.id = bug.id if keep_bug_ids next unless i.save issues_map[bug.id] = i.id diff --git a/lib/tasks/migrate_from_trac.rake b/lib/tasks/migrate_from_trac.rake index d1a3873f5..f3be605c1 100644 --- a/lib/tasks/migrate_from_trac.rake +++ b/lib/tasks/migrate_from_trac.rake @@ -25,12 +25,12 @@ namespace :redmine do module TracMigrate TICKET_MAP = [] - DEFAULT_STATUS = IssueStatus.default + new_status = IssueStatus.find_by_position(1) assigned_status = IssueStatus.find_by_position(2) resolved_status = IssueStatus.find_by_position(3) feedback_status = IssueStatus.find_by_position(4) closed_status = IssueStatus.where(:is_closed => true).first - STATUS_MAPPING = {'new' => DEFAULT_STATUS, + STATUS_MAPPING = {'new' => new_status, 'reopened' => feedback_status, 'assigned' => assigned_status, 'closed' => closed_status @@ -476,8 +476,8 @@ namespace :redmine do i.author = find_or_create_user(ticket.reporter) i.category = issues_category_map[ticket.component] unless ticket.component.blank? i.fixed_version = version_map[ticket.milestone] unless ticket.milestone.blank? - i.status = STATUS_MAPPING[ticket.status] || DEFAULT_STATUS i.tracker = TRACKER_MAPPING[ticket.ticket_type] || DEFAULT_TRACKER + i.status = STATUS_MAPPING[ticket.status] || i.default_status i.id = ticket.id unless Issue.exists?(ticket.id) next unless Time.fake(ticket.changetime) { i.save } TICKET_MAP[ticket.id] = i.id |