--- loncom/interface/lonsupportreq.pm 2017/01/23 17:23:03 1.87
+++ loncom/interface/lonsupportreq.pm 2017/01/23 18:30:30 1.88
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Helpdesk request form
#
-# $Id: lonsupportreq.pm,v 1.87 2017/01/23 17:23:03 raeburn Exp $
+# $Id: lonsupportreq.pm,v 1.88 2017/01/23 18:30:30 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -961,11 +961,12 @@ END
my $fname;
my $attachmentpath = '';
- my $attachmentsize = '';
+ my $showsize = '';
+
if ((defined($env{'user.name'})) && (!$public)) {
if ($homeserver && $env{'form.screenshot.filename'}) {
unless ($helpform{'screenshot'} eq 'no') {
- $attachmentsize = length($env{'form.screenshot'});
+ my $attachmentsize = length($env{'form.screenshot'});
my $max = 1048576;
my $showmax = 1.00;
if ($helpform{'maxsize'} =~ /^\d+\.\d*$/) {
@@ -973,9 +974,9 @@ END
$showmax = $helpform{'maxsize'};
}
$showmax = '('.sprintf("%.2f",$showmax).' MB)';
+ $showsize = $attachmentsize/1048576;
+ $showsize = '('.sprintf("%.2f",$showsize).' MB)';
if ($attachmentsize > $max) {
- my $showsize = $attachmentsize/1048576;
- $showsize = '('.sprintf("%.2f",$showsize).' MB)';
$displaymsg .= '
'.
&mt('The uploaded screenshot file [_1] included with your request exceeded the maximum allowed size [_2], and has therefore been discarded.',$showsize,$showmax).'';
} else {
@@ -994,9 +995,8 @@ END
if ($attachmentpath =~ m-/([^/]+)$-) {
$fname = $1;
$displaymsg .= '
'
- .&mt('An uploaded screenshot file [_1] ([_2] bytes) was included in the request sent by [_3].'
- ,''.$fname.''
- ,$attachmentsize
+ .&mt('An uploaded screenshot file [_1] was included in the request sent by [_2].'
+ ,''.$fname.' '.$showsize,
,$env{'user.name'}.':'.$env{'user.domain'}
);
$supportmsg .= "\n";