summaryrefslogtreecommitdiffstats
path: root/editmilestones.cgi
diff options
context:
space:
mode:
authorterry%mozilla.org <>2000-03-24 03:22:34 +0100
committerterry%mozilla.org <>2000-03-24 03:22:34 +0100
commit4aa03da5994e4e138734f518ab3f85471a6031c8 (patch)
tree9ec5578bb9c85842be24a1c8a5a059ab10608edd /editmilestones.cgi
parent71eef1691521b26b1554d9b647bee684e02e47e7 (diff)
downloadbugzilla-4aa03da5994e4e138734f518ab3f85471a6031c8.tar.gz
bugzilla-4aa03da5994e4e138734f518ab3f85471a6031c8.tar.xz
Added the concept of a "default milstone" for products, and make sure
that all products have at least that milestone defined.
Diffstat (limited to 'editmilestones.cgi')
-rwxr-xr-xeditmilestones.cgi18
1 files changed, 17 insertions, 1 deletions
diff --git a/editmilestones.cgi b/editmilestones.cgi
index b2c67e571..fcd81ea09 100755
--- a/editmilestones.cgi
+++ b/editmilestones.cgi
@@ -336,6 +336,10 @@ if ($action eq 'del') {
AND target_milestone=" . SqlQuote($milestone));
my $bugs = FetchOneColumn();
+ SendSQL("SELECT defaultmilestone FROM products " .
+ "WHERE product=" . SqlQuote($product));
+ my $defaultmilestone = FetchOneColumn();
+
print "<TABLE BORDER=1 CELLPADDING=4 CELLSPACING=0>\n";
print "<TR BGCOLOR=\"#6666FF\">\n";
print " <TH VALIGN=\"top\" ALIGN=\"left\">Part</TH>\n";
@@ -369,6 +373,13 @@ one.";
"</TD></TR></TABLE>\n";
}
+ if ($defaultmilestone eq $milestone) {
+ print "Sorry; this is the default milestone for this product, and " .
+ "so it can not be deleted.";
+ PutTrailer($localtrailer);
+ exit;
+ }
+
print "<P>Do you really want to delete this milestone?<P>\n";
print "<FORM METHOD=POST ACTION=editmilestones.cgi>\n";
print "<INPUT TYPE=SUBMIT VALUE=\"Yes, delete\">\n";
@@ -499,7 +510,8 @@ if ($action eq 'update') {
CheckMilestone($product,$milestoneold);
SendSQL("LOCK TABLES bugs WRITE,
- milestones WRITE");
+ milestones WRITE,
+ products WRITE");
if ($milestone ne $milestoneold) {
unless ($milestone) {
@@ -522,6 +534,10 @@ if ($action eq 'update') {
SET value=" . SqlQuote($milestone) . "
WHERE product=" . SqlQuote($product) . "
AND value=" . SqlQuote($milestoneold));
+ SendSQL("UPDATE products " .
+ "SET defaultmilestone = " . SqlQuote($milestone) .
+ "WHERE product = " . SqlQuote($product) .
+ " AND defaultmilestone = " . SqlQuote($milestoneold));
unlink "data/versioncache";
print "Updated milestone.<BR>\n";
}