Index: bug_form.pl
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/bug_form.pl,v
retrieving revision 1.64
diff -u -r1.64 bug_form.pl
--- bug_form.pl 2001/04/17 02:26:14 1.64
+++ bug_form.pl 2001/06/06 18:14:25
@@ -304,18 +304,26 @@
};
}
-print "
Attachments: | \n";
-SendSQL("select attach_id, creation_ts, mimetype, description from attachments where bug_id = $id");
-while (MoreSQLData()) {
- my ($attachid, $date, $mimetype, $desc) = (FetchSQLData());
- if ($date =~ /^(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/) {
- $date = "$3/$4/$2 $5:$6";
+# 2001-05-16 myk@mozilla.org: use the attachment manager to display attachments
+# if this installation has enabled use of the attachment manager.
+if (Param('useattachmentmanager')) {
+ print "\n";
+ use Attachment;
+ &Attachment::list($id);
+} else {
+ print "
Attachments: | \n";
+ SendSQL("select attach_id, creation_ts, mimetype, description from attachments where bug_id = $id");
+ while (MoreSQLData()) {
+ my ($attachid, $date, $mimetype, $desc) = (FetchSQLData());
+ if ($date =~ /^(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/) {
+ $date = "$3/$4/$2 $5:$6";
+ }
+ my $link = "showattachment.cgi?attach_id=$attachid";
+ $desc = value_quote($desc);
+ print qq{$date | $desc ($mimetype) |
| };
}
- my $link = "showattachment.cgi?attach_id=$attachid";
- $desc = value_quote($desc);
- print qq{$date | $desc ($mimetype) |
| };
+ print "Create a new attachment (proposed patch, testcase, etc.) |
\n";
}
-print "Create a new attachment (proposed patch, testcase, etc.) | \n";
sub EmitDependList {
Index: buglist.cgi
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/buglist.cgi,v
retrieving revision 1.128
diff -u -r1.128 buglist.cgi
--- buglist.cgi 2001/05/29 04:01:48 1.128
+++ buglist.cgi 2001/06/06 18:14:27
@@ -394,6 +394,19 @@
}
$f = "$table.$field";
},
+ # 2001-05-16 myk@mozilla.org: enable querying against attachment status
+ # if this installation has enabled use of the attachment manager.
+ "^attachstatusdefs.name," => sub {
+ my $attachtable = "attachments_$chartid";
+ my $statustable = "attachstatuses_$chartid";
+ my $statusdefstable = "attachstatusdefs_$chartid";
+ push(@supptables, "LEFT JOIN attachments $attachtable ON bugs.bug_id = $attachtable.bug_id
+ LEFT OUTER JOIN attachstatuses $statustable ON $attachtable.attach_id = $statustable.attach_id
+ LEFT OUTER JOIN attachstatusdefs $statusdefstable ON $statustable.statusid = $statusdefstable.id");
+ my $table = $statusdefstable;
+ my $field = "name";
+ $f = "$table.$field";
+ },
"^changedin," => sub {
$f = "(to_days(now()) - to_days(bugs.delta_ts))";
},
Index: checksetup.pl
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v
retrieving revision 1.76
diff -u -r1.76 checksetup.pl
--- checksetup.pl 2001/05/29 08:10:28 1.76
+++ checksetup.pl 2001/06/06 18:14:30
@@ -676,6 +676,55 @@
index(bug_id),
index(creation_ts)';
+# 2001-05-05 myk@mozilla.org: Tables to support the Attachment Manager.
+# "attachstatuses" stores one record for each status on each attachment.
+# "attachstatusdefs" defines the statuses that can be set on attachments.
+# Note: These tables are only used if the parameter "useattachmentmanager"
+# is turned on via editparameters.cgi.
+
+$table{attachstatuses} =
+ '
+ attach_id MEDIUMINT NOT NULL ,
+ statusid SMALLINT NOT NULL ,
+ PRIMARY KEY(attach_id, statusid)
+ ';
+
+$table{attachstatusdefs} =
+ '
+ id SMALLINT NOT NULL PRIMARY KEY ,
+ name VARCHAR(50) NOT NULL ,
+ description MEDIUMTEXT NULL ,
+ sortkey SMALLINT NOT NULL DEFAULT 0
+ ';
+
+# 2001-05-18 myk@mozilla.org: Tables to support the Request Manager.
+# "requestdefs" defines the requests that can be made
+# "requests" stores one record for each request
+# Note: These tables are only used if the parameter "userequestmanager"
+# is turned on via editparameters.cgi.
+
+$table{requestdefs} =
+ '
+ id INT NOT NULL PRIMARY KEY ,
+ objecttype VARCHAR(64) NOT NULL ,
+ fieldname VARCHAR(64) NOT NULL ,
+ fieldvalue VARCHAR(255) NOT NULL ,
+ description TEXT NULL ,
+ cclist VARCHAR(255) NULL ,
+ sortkey INT NOT NULL DEFAULT 0
+ ';
+
+$table{requests} =
+ '
+ id INT NOT NULL PRIMARY KEY ,
+ defid INT NOT NULL ,
+ objectid INT NOT NULL ,
+ requesterid MEDIUMINT NOT NULL ,
+ requestdate DATETIME NOT NULL ,
+ fulfillerid MEDIUMINT NOT NULL ,
+ fulfilldate DATETIME NULL
+ ';
+
#
# Apostrophe's are not supportied in the enum types.
# See http://bugzilla.mozilla.org/show_bug.cgi?id=27309
Index: defparams.pl
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/defparams.pl,v
retrieving revision 1.51
diff -u -r1.51 defparams.pl
--- defparams.pl 2001/05/24 03:10:48 1.51
+++ defparams.pl 2001/06/06 18:14:33
@@ -657,4 +657,14 @@
"t",
'');
+DefParam("useattachmentmanager",
+ "Whether or not to use the attachment manager that adds additional features for managing bug attachments.",
+ "b",
+ 0);
+
+DefParam("userequestmanager",
+ "Whether or not to use the request manager that enables users to make requests of other users.",
+ "b",
+ 0);
+
1;
Index: query.cgi
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/query.cgi,v
retrieving revision 1.83
diff -u -r1.83 query.cgi
--- query.cgi 2001/05/29 20:30:51 1.83
+++ query.cgi 2001/06/06 18:14:43
@@ -773,6 +773,12 @@
push(@fields, [$name, $description]);
}
+# 2001-05-16 myk@mozilla.org: enable querying against attachment status
+# if this installation has enabled use of the attachment manager.
+if (Param('useattachmentmanager')) {
+ push(@fields, ['attachstatusdefs.name', 'Attachment status']);
+}
+
my @types = (
["noop", "---"],
["equals", "equal to"],