RSS

(root)/bugzilla/4.2 : 7271 : Bugzilla/Install.pm

To get this branch, use:
bzr branch /bugzilla/4.2

« back to all changes in this revision

Viewing changes to Bugzilla/Install.pm

Max Kanat-Alexander
2010-07-05 17:42:57
Revision ID: mkanat@bugzilla.org-20100706004257-9wg4e8f3s52lbqhi
Bug 486292: Change the default workflow to UNCONFIRMED, CONFIRMED,
IN_PROGRESS, RESOLVED, VERIFIED.
r=LpSolit, a=mkanat

Show diffs side-by-side

added added

removed removed

37
37
use Bugzilla::Util qw(get_text);
38
38
use Bugzilla::Version;
39
39
 
 
40
use constant STATUS_WORKFLOW => (
 
41
    [undef, 'UNCONFIRMED'],
 
42
    [undef, 'CONFIRMED'],
 
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.
 
56
);
 
57
 
40
58
sub SETTINGS {
41
59
    return {
42
60
    # 2005-03-03 travis@sedsystems.ca -- Bug 41972
232
250
 
233
251
}
234
252
 
 
253
sub init_workflow {
 
254
    my $dbh = Bugzilla->dbh;
 
255
    my $has_workflow = $dbh->selectrow_array('SELECT 1 FROM status_workflow');
 
256
    return if $has_workflow;
 
257
 
 
258
    print get_text('install_workflow_init'), "\n";
 
259
 
 
260
    my %status_ids = @{ $dbh->selectcol_arrayref(
 
261
        'SELECT value, id FROM bug_status', {Columns=>[1,2]}) };
 
262
 
 
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);
 
268
    }
 
269
}
 
270
 
235
271
sub create_admin {
236
272
    my ($params) = @_;
237
273
    my $dbh      = Bugzilla->dbh;

Loggerhead 1.18.1 is a web-based interface for Bazaar branches