Index: CGI.pl
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/CGI.pl,v
retrieving revision 1.99
diff -u -r1.99 CGI.pl
--- CGI.pl 2001/08/20 20:36:10 1.99
+++ CGI.pl 2001/08/25 02:36:09
@@ -1192,6 +1192,7 @@
}
my $query = "
SELECT IFNULL(fielddefs.name, bugs_activity.fieldid),
+ bugs_activity.attach_id ,
bugs_activity.bug_when,
bugs_activity.removed, bugs_activity.added,
profiles.login_name
@@ -1216,7 +1217,7 @@
my @row;
my $incomplete_data = 0;
while (@row = FetchSQLData()) {
- my ($field,$when,$removed,$added,$who) = (@row);
+ my ($field,$attachid,$when,$removed,$added,$who) = (@row);
$removed = html_quote($removed);
$added = html_quote($added);
$removed = " " if $removed eq "";
@@ -1226,7 +1227,11 @@
}
$html .= "
\n";
$html .= "$who | \n";
- $html .= "$field | \n";
+ $html .= "$field";
+ if ( Param("useattachmentmanager") && $attachid ) {
+ $html .= qq| ($attachid)|;
+ }
+ $html .= " | \n";
$html .= "$removed | \n";
$html .= "$added | \n";
$html .= "$when | \n";
Index: bug_form.pl
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/bug_form.pl,v
retrieving revision 1.70
diff -u -r1.70 bug_form.pl
--- bug_form.pl 2001/08/17 11:15:04 1.70
+++ bug_form.pl 2001/08/25 02:36:10
@@ -283,18 +283,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.139
diff -u -r1.139 buglist.cgi
--- buglist.cgi 2001/08/24 17:32:24 1.139
+++ buglist.cgi 2001/08/25 02:36:11
@@ -415,6 +415,22 @@
}
$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, "attachments $attachtable");
+ push(@supptables, "attachstatuses $statustable");
+ push(@supptables, "attachstatusdefs $statusdefstable");
+ push(@wherepart, "bugs.bug_id = $attachtable.bug_id");
+ push(@wherepart, "$attachtable.attach_id = $statustable.attach_id");
+ push(@wherepart, "$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.99
diff -u -r1.99 checksetup.pl
--- checksetup.pl 2001/08/19 18:26:21 1.99
+++ checksetup.pl 2001/08/25 02:36:14
@@ -838,6 +838,7 @@
$table{bugs_activity} =
'bug_id mediumint not null,
+ attach_id mediumint null,
who mediumint not null,
bug_when datetime not null,
fieldid mediumint not null,
@@ -859,10 +860,33 @@
filename mediumtext not null,
thedata longblob not null,
submitter_id mediumint not null,
+ isobsolete tinyint not null default 0,
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 ,
+ product VARCHAR(64) NOT NULL
+ ';
+
#
# Apostrophe's are not supportied in the enum types.
# See http://bugzilla.mozilla.org/show_bug.cgi?id=27309
@@ -1294,6 +1318,8 @@
AddFDef("attachments.thedata", "Attachment data", 0);
AddFDef("attachments.mimetype", "Attachment mime type", 0);
AddFDef("attachments.ispatch", "Attachment is patch", 0);
+AddFDef("attachments.isobsolete", "Attachment is obsolete", 0);
+AddFDef("attachstatusdefs.name", "Attachment Status", 0);
AddFDef("target_milestone", "Target Milestone", 0);
AddFDef("delta_ts", "Last changed date", 0);
AddFDef("(to_days(now()) - to_days(bugs.delta_ts))", "Days since bug changed",
@@ -2322,6 +2348,12 @@
#
AddField('groups', 'isactive', 'tinyint not null default 1');
+#
+# 2001-06-15 myk@mozilla.org:
+# isobsolete determines whether or not an attachment is pertinent/relevant/valid.
+#
+AddField('attachments', 'isobsolete', 'tinyint not null default 0');
+
# 2001-04-29 jake@acutex.net - Remove oldemailtech
# http://bugzilla.mozilla.org/show_bugs.cgi?id=71552
if (-d 'shadow') {
@@ -2469,6 +2501,11 @@
AddField("bugs", "assignee_accessible", "tinyint not null default 1");
AddField("bugs", "qacontact_accessible", "tinyint not null default 1");
AddField("bugs", "cclist_accessible", "tinyint not null default 1");
+
+# 2001-08-21 myk@mozilla.org bug84338:
+# Add a field for the attachment ID to the bugs_activity table, so installations
+# using the attachment manager can record changes to attachments.
+AddField("bugs_activity", "attach_id", "mediumint null");
# If you had to change the --TABLE-- definition in any way, then add your
# differential change code *** A B O V E *** this comment.
Index: defparams.pl
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/defparams.pl,v
retrieving revision 1.56
diff -u -r1.56 defparams.pl
--- defparams.pl 2001/08/25 00:12:12 1.56
+++ defparams.pl 2001/08/25 02:36:15
@@ -669,4 +669,9 @@
"t",
'');
+DefParam("useattachmenttracker",
+ "Whether or not to use the attachment tracker that adds additional features for tracking bug attachments.",
+ "b",
+ 0);
+
1;