37
37
use Bugzilla::Util qw(get_text);
38
38
use Bugzilla::Version;
40
use constant STATUS_WORKFLOW => (
41
[undef, 'UNCONFIRMED'],
43
[undef, 'IN_PROGRESS'],
44
['UNCONFIRMED', 'CONFIRMED'],
45
['UNCONFIRMED', 'IN_PROGRESS'],
46
['UNCONFIRMED', 'RESOLVED'],
47
['CONFIRMED', 'IN_PROGRESS'],
48
['CONFIRMED', 'RESOLVED'],
49
['IN_PROGRESS', 'CONFIRMED'],
50
['IN_PROGRESS', 'RESOLVED'],
51
['RESOLVED', 'CONFIRMED'],
52
['RESOLVED', 'VERIFIED'],
53
['VERIFIED', 'CONFIRMED'],
54
# The RESOLVED/VERIFIED to UNCONFIRMED transition is enabled specially
55
# in the code for bugs that haven't been confirmed.
42
60
# 2005-03-03 travis@sedsystems.ca -- Bug 41972
254
my $dbh = Bugzilla->dbh;
255
my $has_workflow = $dbh->selectrow_array('SELECT 1 FROM status_workflow');
256
return if $has_workflow;
258
print get_text('install_workflow_init'), "\n";
260
my %status_ids = @{ $dbh->selectcol_arrayref(
261
'SELECT value, id FROM bug_status', {Columns=>[1,2]}) };
263
foreach my $pair (STATUS_WORKFLOW) {
264
my $old_id = $pair->[0] ? $status_ids{$pair->[0]} : undef;
265
my $new_id = $status_ids{$pair->[1]};
266
$dbh->do('INSERT INTO status_workflow (old_status, new_status)
267
VALUES (?,?)', undef, $old_id, $new_id);
235
271
sub create_admin {
236
272
my ($params) = @_;
237
273
my $dbh = Bugzilla->dbh;