diff options
Diffstat (limited to 'rt/share/html/Ticket/Elements/ShowAttachments')
-rwxr-xr-x | rt/share/html/Ticket/Elements/ShowAttachments | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/rt/share/html/Ticket/Elements/ShowAttachments b/rt/share/html/Ticket/Elements/ShowAttachments index 72298d79f..ab0d92112 100755 --- a/rt/share/html/Ticket/Elements/ShowAttachments +++ b/rt/share/html/Ticket/Elements/ShowAttachments @@ -61,11 +61,22 @@ my $size = $rev->ContentLength; if ($size) { - if ($size > 1024) { - $size = int($size/102.4)/10 . "k"; + my $kb = int($size/102.4) / 10; + my $units = RT->Config->Get('AttachmentUnits'); + + if (!defined($units)) { + if ($size > 1024) { + $size = $kb . "k"; + } + else { + $size = $size . "b"; + } + } + elsif ($units eq 'k') { + $size = $kb . "k"; } else { - $size = $size ."b"; + $size = $size . "b"; } </%PERL> |