--- loncom/interface/lonmsgdisplay.pm 2014/05/21 17:36:58 1.175 +++ loncom/interface/lonmsgdisplay.pm 2015/02/12 21:22:07 1.180 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging display # -# $Id: lonmsgdisplay.pm,v 1.175 2014/05/21 17:36:58 musolffc Exp $ +# $Id: lonmsgdisplay.pm,v 1.180 2015/02/12 21:22:07 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -815,7 +815,6 @@ sub discrit { my $result = ''; # Sort by date in descending order foreach my $key (sort{$b <=> $a}(keys(%what))) { - print STDERR "key = ||$key||\n"; my %content=&Apache::lonmsg::unpackagemsg($what{$key}); next if ($content{'senderdomain'} eq ''); my $description; @@ -1901,7 +1900,7 @@ sub disfacetoface { $env{'course.'.$env{'request.course.id'}.'.domain'}, $env{'course.'.$env{'request.course.id'}.'.num'}, '%255b'.$user.'%253a'.$domain.'%255d'); - my $result='
'; + my $result=''; foreach my $key (sort(keys(%records))) { my %content=&Apache::lonmsg::unpackagemsg($records{$key}); next if ($content{'senderdomain'} eq ''); @@ -1966,11 +1965,11 @@ $content{'sendername'}.':'. } else { $r->print('\textbf{'.&mt('No notes, face-to-face discussion records, critical messages or broadcast messages in this '.$lctype.'.').'}\\\\'); } - } elsif ($target ne 'tex') { - $r->print($result.'
'); + } elsif ($target eq 'tex') { + $r->print(&Apache::lonxml::xmlparse($r,$target,$result)); } else { - $r->print(&Apache::lonxml::xmlparse($r, 'tex', $result)); - } + $r->print('
'.$result.'
'); + } } sub general_message { @@ -2699,7 +2698,7 @@ sub storedcommentlisting { '^'.&escape(&escape($env{'form.showcommentbaseurl'}))); $r->print(&Apache::loncommon::start_page('Saved Comment Listing',undef, {'onlybody' => 1})); - if ((keys %msgs)[0]=~/^error\:/) { + if ((keys(%msgs))[0]=~/^error\:/) { $r->print(&mt('No saved comments yet.')); } else { my $found=0; @@ -2914,6 +2913,7 @@ sub sendoffmail { } my @recusers; my @recudoms; + my %permresults; foreach my $address (sort(keys(%toaddr))) { my ($recuname,$recdomain)=split(/\:/,$address); my $msgtxt = $savemsg; @@ -2930,7 +2930,8 @@ sub sendoffmail { $env{'form.sendbck'}, $env{'form.permanent'}, \$sentmessage{$address}, - $nosentstore,$recipid); + $nosentstore,$recipid, + $attachmenturl,\%permresults); } else { $r->print(&mt('Sending').' '.$recuname.':'.$recdomain.': '); @thismsg= @@ -2941,13 +2942,20 @@ sub sendoffmail { $env{'form.permanent'}, \$sentmessage{$address}, undef,undef,undef, - $nosentstore,$recipid); + $nosentstore,$recipid, + \%permresults); } $msg_status{$recuname.':'.$recdomain}=join(' ',@thismsg); if ($msg_status{$recuname.':'.$recdomain} =~ /(ok|con_delayed)/) { $numsent++; push(@recusers,$recuname); push(@recudoms,$recdomain); + if ($1 eq 'ok') { + $r->print('ok '); + } + if ($permresults{$recuname.':'.$recdomain}) { + $r->print(' (email) '); + } } $sendstatus.=' '.join(' ',@thismsg); }