--- loncom/interface/lonmsgdisplay.pm 2006/04/22 17:10:07 1.4 +++ loncom/interface/lonmsgdisplay.pm 2006/04/23 03:00:34 1.6 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging display # -# $Id: lonmsgdisplay.pm,v 1.4 2006/04/22 17:10:07 albertel Exp $ +# $Id: lonmsgdisplay.pm,v 1.6 2006/04/23 03:00:34 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -313,7 +313,7 @@ ENDDISHEADER sub discrit { my $r=shift; - my $header = '

'.&mt('Critical Messages').'

'. + my $header = '

'.&mt('Critical Messages').'

'. '
'. ''; my %what=&Apache::lonnet::dump('critical'); @@ -624,6 +624,8 @@ ENDDISHEADER $r->print(''.&mt('Status').''); } $r->print("\n"); + + my $suffix = &Apache::lonmsg::foldersuffix($folder); for (my $n=$firstdis;$n<=$lastdis;$n++) { my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$origID,$description)= @{$temp[$n]}; if (($status ne 'deleted') && defined($sendtime) && $sendtime!~/error/) { @@ -636,12 +638,21 @@ ENDDISHEADER } else { $r->print(''); } + my ($dis_name,$dis_domain) = ($fromname,$fromdomain); + if ($folder eq 'sent') { + my $msg_id = &Apache::lonnet::unescape($origID); + my %message=&Apache::lonnet::get('nohist_email'.$suffix, + [$msg_id]); + my %content=&Apache::lonmsg::unpackagemsg($message{$msg_id}); + $dis_name = join('
',@{$content{'recuser'}}); + $dis_domain = join('
',@{$content{'recdomain'}}); + } $r->print(''.&mt('Open').''. ($folder ne 'trash'?''.&mt('Delete'):' ').''. ''.&Apache::lonlocal::locallocaltime($sendtime).''. - $fromname.''.$fromdomain.''. + $dis_name.''.$dis_domain.''. &Apache::lonnet::unescape($shortsubj).''. $description.''.$status.''."\n"); } elsif ($status eq 'deleted') { @@ -1767,17 +1778,15 @@ sub sendoffmail { &printheader($r,'','No messages sent.'); } if ($sendstatus=~/^(\s*(?:ok|con_delayed)\s*)*$/) { - $r->print('
'.&mt('Completed.').''); + $r->print('
'.&mt('Completed.').''); if ($env{'form.displayedcrit'}) { &discrit($r); } else { &Apache::loncommunicate::menu($r); } } else { - $r->print( - '

'.&mt('Could not deliver message').'

'. - &mt('Please use the browser "Back" button and correct the recipient addresses') - ); + $r->print('

'.&mt('Could not deliver message').' '. + &mt('Please use the browser "Back" button and correct the recipient addresses').'

'); } }