Adding "create chart datasets" after product creation

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding "create chart datasets" after product creation

Jeff Jensen
Hi,

If someone creates a product without checking on "Create chart datasets for
this product:", how to update that setting after the fact?

This was missed in a few product creations, and collectstats.pl ignores
them.

Is it as simple as adding a row to the series_category table?

Also, it seems this begins to fail when renaming a product too - the entry
in the series_category table isn't renamed.  Must they match?


The manual talks of the need for the nightly script to run (which it is),
and I can't find info on this in the archives.  If it exists, please give me
some better search criteria!  :-)


_______________________________________________
mozilla-webtools mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-webtools
Reply | Threaded
Open this post in threaded view
|

RE: Adding "create chart datasets" after product creation

Jeff Jensen
I have been looking at the editproducts.cgi script that processes the
"create series" checkbox.  Not fully understanding it, having never worked
in Perl before.

Has anyone taken the basis of this code from editproducts.cgi and made a
little standalone script to create these series entries when someone forgets
to check the "create series" checkbox?  Or have some other solution?


    if ($::FORM{createseries}) {
        # Insert default charting queries for this product.
        # If they aren't using charting, this won't do any harm.
        GetVersionTable();

        # $::FORM{'open_name'} and $product are sqlquoted by the series
        # code and never used again here, so we can trick_taint them.
        trick_taint($::FORM{'open_name'});
        trick_taint($product);

        my @series;

        # We do every status, every resolution, and an "opened" one as well.
        foreach my $bug_status (@::legal_bug_status) {
            push(@series, [$bug_status,
                           "bug_status=" . url_quote($bug_status)]);
        }

        foreach my $resolution (@::legal_resolution) {
            next if !$resolution;
            push(@series, [$resolution, "resolution="
.url_quote($resolution)]);
        }

        # For localisation reasons, we get the name of the "global"
subcategory
        # and the title of the "open" query from the submitted form.
        my @openedstatuses = OpenStates();
        my $query =
               join("&", map { "bug_status=" . url_quote($_) }
@openedstatuses);
        push(@series, [$::FORM{'open_name'}, $query]);

        foreach my $sdata (@series) {
            my $series = new Bugzilla::Series(undef, $product,
                            $::FORM{'subcategory'},
                            $sdata->[0], $::userid, 1,
                            $sdata->[1] . "&product=" . url_quote($product),
1);
            $series->writeToDatabase();
        }
    }


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Jeff Jensen
Sent: Sunday, June 19, 2005 12:51 PM
To: [hidden email]
Subject: Adding "create chart datasets" after product creation

Hi,

If someone creates a product without checking on "Create chart datasets for
this product:", how to update that setting after the fact?

This was missed in a few product creations, and collectstats.pl ignores
them.

Is it as simple as adding a row to the series_category table?

Also, it seems this begins to fail when renaming a product too - the entry
in the series_category table isn't renamed.  Must they match?


The manual talks of the need for the nightly script to run (which it is),
and I can't find info on this in the archives.  If it exists, please give me
some better search criteria!  :-)


_______________________________________________
mozilla-webtools mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-webtools

_______________________________________________
mozilla-webtools mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-webtools
Reply | Threaded
Open this post in threaded view
|

RE: Adding "create chart datasets" after product creation

Jeff Jensen
Hmmm, is no one using the charts?

How does one get series data generating for bugs after the product is
created?  Either "ya don't" or it is so simple am I am completely ignorant
to it!?

I have been looking into manually manipulating the tables, but am a little
hesitant and hope for a more simple, "proper" solution.  Does one exist?



-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Jeff Jensen
Sent: Monday, June 20, 2005 10:58 PM
To: [hidden email]
Subject: RE: Adding "create chart datasets" after product creation

I have been looking at the editproducts.cgi script that processes the
"create series" checkbox.  Not fully understanding it, having never worked
in Perl before.

Has anyone taken the basis of this code from editproducts.cgi and made a
little standalone script to create these series entries when someone forgets
to check the "create series" checkbox?  Or have some other solution?


    if ($::FORM{createseries}) {
        # Insert default charting queries for this product.
        # If they aren't using charting, this won't do any harm.
        GetVersionTable();

        # $::FORM{'open_name'} and $product are sqlquoted by the series
        # code and never used again here, so we can trick_taint them.
        trick_taint($::FORM{'open_name'});
        trick_taint($product);

        my @series;

        # We do every status, every resolution, and an "opened" one as well.
        foreach my $bug_status (@::legal_bug_status) {
            push(@series, [$bug_status,
                           "bug_status=" . url_quote($bug_status)]);
        }

        foreach my $resolution (@::legal_resolution) {
            next if !$resolution;
            push(@series, [$resolution, "resolution="
.url_quote($resolution)]);
        }

        # For localisation reasons, we get the name of the "global"
subcategory
        # and the title of the "open" query from the submitted form.
        my @openedstatuses = OpenStates();
        my $query =
               join("&", map { "bug_status=" . url_quote($_) }
@openedstatuses);
        push(@series, [$::FORM{'open_name'}, $query]);

        foreach my $sdata (@series) {
            my $series = new Bugzilla::Series(undef, $product,
                            $::FORM{'subcategory'},
                            $sdata->[0], $::userid, 1,
                            $sdata->[1] . "&product=" . url_quote($product),
1);
            $series->writeToDatabase();
        }
    }


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Jeff Jensen
Sent: Sunday, June 19, 2005 12:51 PM
To: [hidden email]
Subject: Adding "create chart datasets" after product creation

Hi,

If someone creates a product without checking on "Create chart datasets for
this product:", how to update that setting after the fact?

This was missed in a few product creations, and collectstats.pl ignores
them.

Is it as simple as adding a row to the series_category table?

Also, it seems this begins to fail when renaming a product too - the entry
in the series_category table isn't renamed.  Must they match?


The manual talks of the need for the nightly script to run (which it is),
and I can't find info on this in the archives.  If it exists, please give me
some better search criteria!  :-)


_______________________________________________
mozilla-webtools mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-webtools

_______________________________________________
mozilla-webtools mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-webtools

_______________________________________________
mozilla-webtools mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-webtools
Reply | Threaded
Open this post in threaded view
|

Re: Adding "create chart datasets" after product creation

Gervase Markham
In reply to this post by Jeff Jensen
Jeff Jensen wrote:
> How does one get series data generating for bugs after the product is
> created?  Either "ya don't" or it is so simple am I am completely ignorant
> to it!?

You don't - you have to set it all up manually. I agree, this isn't ideal.

Gerv
_______________________________________________
mozilla-webtools mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-webtools