aboutsummaryrefslogtreecommitdiffstats
path: root/editcomponents.cgi
diff options
context:
space:
mode:
authorgerv%gerv.net <>2003-06-26 06:22:50 +0000
committergerv%gerv.net <>2003-06-26 06:22:50 +0000
commit4f6b75a65628b0d86c760309dd81dd03f5c6d308 (patch)
tree5363459b06e75bc620ceab9dfd045b0f66b6c27c /editcomponents.cgi
parentda6143f4aae6af35f60b8230b82f649b3b0cbd05 (diff)
downloadbugs-4f6b75a65628b0d86c760309dd81dd03f5c6d308.tar
bugs-4f6b75a65628b0d86c760309dd81dd03f5c6d308.tar.gz
bugs-4f6b75a65628b0d86c760309dd81dd03f5c6d308.tar.bz2
bugs-4f6b75a65628b0d86c760309dd81dd03f5c6d308.tar.xz
bugs-4f6b75a65628b0d86c760309dd81dd03f5c6d308.zip
Bug 16009 - generic charting. Patch by gerv; r,a=justdave.
Diffstat (limited to 'editcomponents.cgi')
-rwxr-xr-xeditcomponents.cgi30
1 files changed, 30 insertions, 0 deletions
diff --git a/editcomponents.cgi b/editcomponents.cgi
index 74e0debe8..018c89cdf 100755
--- a/editcomponents.cgi
+++ b/editcomponents.cgi
@@ -31,6 +31,8 @@ use lib ".";
require "CGI.pl";
require "globals.pl";
+use Bugzilla::Series;
+
# Shut up misguided -w warnings about "used only once". For some reason,
# "use vars" chokes on me when I try it here.
@@ -352,6 +354,8 @@ if ($action eq 'add') {
print "</TR></TABLE>\n<HR>\n";
print "<INPUT TYPE=SUBMIT VALUE=\"Add\">\n";
print "<INPUT TYPE=HIDDEN NAME=\"action\" VALUE=\"new\">\n";
+ print "<INPUT TYPE=HIDDEN NAME='open_name' VALUE='All Open'>\n";
+ print "<INPUT TYPE=HIDDEN NAME='closed_name' VALUE='All Closed'>\n";
print "</FORM>";
my $other = $localtrailer;
@@ -440,6 +444,32 @@ if ($action eq 'new') {
SqlQuote($initialownerid) . "," .
SqlQuote($initialqacontactid) . ")");
+ # Insert default charting queries for this product.
+ # If they aren't using charting, this won't do any harm.
+ GetVersionTable();
+
+ my @series;
+ my $prodcomp = "&product=$product&component=$component";
+
+ # For localisation reasons, we get the title of the queries from the
+ # submitted form.
+ my @openedstatuses = ("UNCONFIRMED", "NEW", "ASSIGNED", "REOPENED");
+ my $statuses = join("&", map { "bug_status=$_" } @openedstatuses);
+ push(@series, [$::FORM{'open_name'}, $statuses . $prodcomp]);
+
+ my $resolved = "field0-0-0=resolution&type0-0-0=notequals&value0-0-0=---";
+ push(@series, [$::FORM{'closed_name'}, $resolved . $prodcomp]);
+
+ foreach my $sdata (@series) {
+ # We create the series with an nonsensical series_id, which is
+ # guaranteed not to exist. This is OK, because we immediately call
+ # createInDatabase().
+ my $series = new Bugzilla::Series(-1, $product, $component,
+ $sdata->[0], $::userid, 1,
+ $sdata->[1]);
+ $series->createInDatabase();
+ }
+
# Make versioncache flush
unlink "data/versioncache";