summaryrefslogtreecommitdiffstats
path: root/attachment.cgi
diff options
context:
space:
mode:
authormyk%mozilla.org <>2004-02-06 03:14:01 +0100
committermyk%mozilla.org <>2004-02-06 03:14:01 +0100
commit0b01a89cc8901ad0217455563c58b26c10f6dad7 (patch)
treecfe49edaeff34420a1f8f1747002d16ed6baf550 /attachment.cgi
parent038bb59e90b8e253e8b61a219c606638f63855c6 (diff)
downloadbugzilla-0b01a89cc8901ad0217455563c58b26c10f6dad7.tar.gz
bugzilla-0b01a89cc8901ad0217455563c58b26c10f6dad7.tar.xz
Fix for bug 127995: shows the size of attachments in the show bug and attachment interfaces.
Patch by Dave Swegen <dswegen@software.plasmon.com> r=myk a=myk
Diffstat (limited to 'attachment.cgi')
-rwxr-xr-xattachment.cgi12
1 files changed, 7 insertions, 5 deletions
diff --git a/attachment.cgi b/attachment.cgi
index fd9983841..8df562120 100755
--- a/attachment.cgi
+++ b/attachment.cgi
@@ -746,7 +746,8 @@ sub viewall
$privacy = "AND isprivate < 1 ";
}
SendSQL("SELECT attach_id, DATE_FORMAT(creation_ts, '%Y.%m.%d %H:%i'),
- mimetype, description, ispatch, isobsolete, isprivate
+ mimetype, description, ispatch, isobsolete, isprivate,
+ LENGTH(thedata)
FROM attachments WHERE bug_id = $::FORM{'bugid'} $privacy
ORDER BY attach_id");
my @attachments; # the attachments array
@@ -754,8 +755,8 @@ sub viewall
{
my %a; # the attachment hash
($a{'attachid'}, $a{'date'}, $a{'contenttype'},
- $a{'description'}, $a{'ispatch'}, $a{'isobsolete'}, $a{'isprivate'})
- = FetchSQLData();
+ $a{'description'}, $a{'ispatch'}, $a{'isobsolete'}, $a{'isprivate'},
+ $a{'datasize'}) = FetchSQLData();
$a{'isviewable'} = isViewable($a{'contenttype'});
# Add the hash representing the attachment to the array of attachments.
@@ -943,9 +944,9 @@ sub edit
# Users cannot edit the content of the attachment itself.
# Retrieve the attachment from the database.
- SendSQL("SELECT description, mimetype, filename, bug_id, ispatch, isobsolete, isprivate
+ SendSQL("SELECT description, mimetype, filename, bug_id, ispatch, isobsolete, isprivate, LENGTH(thedata)
FROM attachments WHERE attach_id = $::FORM{'id'}");
- my ($description, $contenttype, $filename, $bugid, $ispatch, $isobsolete, $isprivate) = FetchSQLData();
+ my ($description, $contenttype, $filename, $bugid, $ispatch, $isobsolete, $isprivate, $datasize) = FetchSQLData();
my $isviewable = isViewable($contenttype);
@@ -980,6 +981,7 @@ sub edit
$vars->{'ispatch'} = $ispatch;
$vars->{'isobsolete'} = $isobsolete;
$vars->{'isprivate'} = $isprivate;
+ $vars->{'datasize'} = $datasize;
$vars->{'isviewable'} = $isviewable;
$vars->{'attachments'} = \@bugattachments;
$vars->{'GetBugLink'} = \&GetBugLink;