diff options
author | terry%netscape.com <> | 1999-04-08 23:40:45 +0200 |
---|---|---|
committer | terry%netscape.com <> | 1999-04-08 23:40:45 +0200 |
commit | 09a62e442b2d5665434ad87ff1f5198aad36d648 (patch) | |
tree | 67fe21aa9a995d3c2750e19c6f2d751923249406 /bug_form.pl | |
parent | ef5afae9ef7289847b53f9e4791e6e6dfd5d6039 (diff) | |
download | bugzilla-09a62e442b2d5665434ad87ff1f5198aad36d648.tar.gz bugzilla-09a62e442b2d5665434ad87ff1f5198aad36d648.tar.xz |
Bugzilla now has the ability to store patches and other attachments with bugs.
Diffstat (limited to 'bug_form.pl')
-rw-r--r-- | bug_form.pl | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/bug_form.pl b/bug_form.pl index 7398dae9f..40b96ecc7 100644 --- a/bug_form.pl +++ b/bug_form.pl @@ -22,6 +22,8 @@ use diagnostics; use strict; +my %knownattachments; + # This routine quoteUrls contains inspirations from the HTML::FromText CPAN # module by Gareth Rees <garethr@cre.canon.co.uk>. It has been heavily hacked, # all that is really recognizable from the original is bits of the regular @@ -73,6 +75,14 @@ sub quoteUrls { $item = qq{<A HREF="${base}show_bug.cgi?id=$num">$item</A>}; $things[$count++] = $item; } + while ($text =~ s/Created an attachment \(id=(\d+)\)/"##$count##"/e) { + my $item = $&; + my $num = $1; + if (exists $knownattachments{$num}) { + $item = qq{<A HREF="showattachment.cgi?attach_id=$num">$item</A>}; + } + $things[$count++] = $item; + } $text = value_quote($text); @@ -277,6 +287,20 @@ if (Param("usestatuswhiteboard")) { </TR>"; } +print "<tr><td align=right><B>Attachments:</b></td>\n"; +SendSQL("select attach_id, creation_ts, description from attachments where bug_id = $::FORM{'id'}"); +while (MoreSQLData()) { + my ($id, $date, $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=$id"; + $desc = value_quote($desc); + print qq{<td><a href="$link">$date</a></td><td colspan=4>$desc</td></tr><tr><td></td>}; + $knownattachments{$id} = 1; +} +print "<td colspan=6><a href=createattachment.cgi?id=$::FORM{'id'}>Create a new attachment</a> (proposed patch, testcase, etc.)</td></tr>\n"; + print " </TABLE> |