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/tasks | |
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/tasks')
-rw-r--r-- | lib/tasks/migrate_from_mantis.rake | 10 | ||||
-rw-r--r-- | lib/tasks/migrate_from_trac.rake | 6 |
2 files changed, 8 insertions, 8 deletions
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 |