diff options
author | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-07-06 02:42:57 +0200 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-07-06 02:42:57 +0200 |
commit | ba4585ae8a1c63a49e40461d2e2efc12bc75c58a (patch) | |
tree | 8dc9797b39e698089785eef1e6a2ca55e094934b /Bugzilla/Install.pm | |
parent | 4e7c28de087834ba8fca4350a01798c1f9732f23 (diff) | |
download | bugzilla-ba4585ae8a1c63a49e40461d2e2efc12bc75c58a.tar.gz bugzilla-ba4585ae8a1c63a49e40461d2e2efc12bc75c58a.tar.xz |
Bug 486292: Change the default workflow to UNCONFIRMED, CONFIRMED,
IN_PROGRESS, RESOLVED, VERIFIED.
r=LpSolit, a=mkanat
Diffstat (limited to 'Bugzilla/Install.pm')
-rw-r--r-- | Bugzilla/Install.pm | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Bugzilla/Install.pm b/Bugzilla/Install.pm index e90fe41db..3754c0787 100644 --- a/Bugzilla/Install.pm +++ b/Bugzilla/Install.pm @@ -37,6 +37,24 @@ use Bugzilla::User::Setting; use Bugzilla::Util qw(get_text); use Bugzilla::Version; +use constant STATUS_WORKFLOW => ( + [undef, 'UNCONFIRMED'], + [undef, 'CONFIRMED'], + [undef, 'IN_PROGRESS'], + ['UNCONFIRMED', 'CONFIRMED'], + ['UNCONFIRMED', 'IN_PROGRESS'], + ['UNCONFIRMED', 'RESOLVED'], + ['CONFIRMED', 'IN_PROGRESS'], + ['CONFIRMED', 'RESOLVED'], + ['IN_PROGRESS', 'CONFIRMED'], + ['IN_PROGRESS', 'RESOLVED'], + ['RESOLVED', 'CONFIRMED'], + ['RESOLVED', 'VERIFIED'], + ['VERIFIED', 'CONFIRMED'], + # The RESOLVED/VERIFIED to UNCONFIRMED transition is enabled specially + # in the code for bugs that haven't been confirmed. +); + sub SETTINGS { return { # 2005-03-03 travis@sedsystems.ca -- Bug 41972 @@ -232,6 +250,24 @@ sub create_default_product { } +sub init_workflow { + my $dbh = Bugzilla->dbh; + my $has_workflow = $dbh->selectrow_array('SELECT 1 FROM status_workflow'); + return if $has_workflow; + + print get_text('install_workflow_init'), "\n"; + + my %status_ids = @{ $dbh->selectcol_arrayref( + 'SELECT value, id FROM bug_status', {Columns=>[1,2]}) }; + + foreach my $pair (STATUS_WORKFLOW) { + my $old_id = $pair->[0] ? $status_ids{$pair->[0]} : undef; + my $new_id = $status_ids{$pair->[1]}; + $dbh->do('INSERT INTO status_workflow (old_status, new_status) + VALUES (?,?)', undef, $old_id, $new_id); + } +} + sub create_admin { my ($params) = @_; my $dbh = Bugzilla->dbh; |