Diff for /loncom/interface/lonsupportreq.pm between versions 1.87 and 1.88

version 1.87, 2017/01/23 17:23:03 version 1.88, 2017/01/23 18:30:30
Line 961  END Line 961  END
     my $fname;      my $fname;
   
     my $attachmentpath = '';      my $attachmentpath = '';
     my $attachmentsize = '';      my $showsize = '';
       
     if ((defined($env{'user.name'})) && (!$public)) {      if ((defined($env{'user.name'})) && (!$public)) {
         if ($homeserver && $env{'form.screenshot.filename'}) {          if ($homeserver && $env{'form.screenshot.filename'}) {
             unless ($helpform{'screenshot'} eq 'no') {              unless ($helpform{'screenshot'} eq 'no') {
                 $attachmentsize = length($env{'form.screenshot'});                  my $attachmentsize = length($env{'form.screenshot'});
                 my $max = 1048576;                  my $max = 1048576;
                 my $showmax = 1.00;                  my $showmax = 1.00;
                 if ($helpform{'maxsize'} =~ /^\d+\.\d*$/) {                  if ($helpform{'maxsize'} =~ /^\d+\.\d*$/) {
Line 973  END Line 974  END
                     $showmax = $helpform{'maxsize'};                      $showmax = $helpform{'maxsize'};
                 }                  }
                 $showmax = '('.sprintf("%.2f",$showmax).' MB)';                   $showmax = '('.sprintf("%.2f",$showmax).' MB)'; 
                   $showsize = $attachmentsize/1048576;
                   $showsize = '('.sprintf("%.2f",$showsize).' MB)';
                 if ($attachmentsize > $max) {                  if ($attachmentsize > $max) {
                     my $showsize = $attachmentsize/1048576;  
                     $showsize = '('.sprintf("%.2f",$showsize).' MB)';  
                     $displaymsg .= '<br /><span class="LC_warning">'.                      $displaymsg .= '<br /><span class="LC_warning">'.
                                    &mt('The uploaded screenshot file [_1] included with your request exceeded the maximum allowed size [_2], and has therefore been discarded.',$showsize,$showmax).'</span>';                                     &mt('The uploaded screenshot file [_1] included with your request exceeded the maximum allowed size [_2], and has therefore been discarded.',$showsize,$showmax).'</span>';
                 } else {                  } else {
Line 994  END Line 995  END
     if ($attachmentpath =~ m-/([^/]+)$-) {      if ($attachmentpath =~ m-/([^/]+)$-) {
         $fname = $1;          $fname = $1;
         $displaymsg .= '<br />'          $displaymsg .= '<br />'
                       .&mt('An uploaded screenshot file [_1] ([_2] bytes) was included in the request sent by [_3].'                        .&mt('An uploaded screenshot file [_1] was included in the request sent by [_2].'
                           ,'<span class="LC_filename">'.$fname.'</span>'                            ,'<span class="LC_filename">'.$fname.'</span>&nbsp;'.$showsize,
                           ,$attachmentsize  
                           ,$env{'user.name'}.':'.$env{'user.domain'}                            ,$env{'user.name'}.':'.$env{'user.domain'}
                        );                         );
         $supportmsg .= "\n";          $supportmsg .= "\n";

Removed from v.1.87  
changed lines
  Added in v.1.88


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>