--- loncom/interface/lonmsgdisplay.pm 2009/08/28 23:27:32 1.133 +++ loncom/interface/lonmsgdisplay.pm 2009/10/12 08:01:08 1.136 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging display # -# $Id: lonmsgdisplay.pm,v 1.133 2009/08/28 23:27:32 raeburn Exp $ +# $Id: lonmsgdisplay.pm,v 1.136 2009/10/12 08:01:08 amueller Exp $ # # Copyright Michigan State University Board of Trustees # @@ -113,8 +113,8 @@ use lib '/home/httpd/lib/perl/'; use LONCAPA; # Querystring component with sorting type -my $sqs; -my $startdis; +my $sqs=''; +my $startdis=''; # ============================================================ List all folders @@ -1060,39 +1060,39 @@ ENDDISHEADER $r->print('
'. ''); + $r->print(''.&mt('Date').''); } else { - $r->print(''.&mt('Date').''); + $r->print(''.&mt('Date').''); } $r->print(''); + $r->print(''.&mt('Status').''); } else { - $r->print(''.&mt('Status').''); + $r->print(''.&mt('Status').''); } $r->print("\n"); @@ -1268,8 +1268,9 @@ sub compout { &printheader($r,'/adm/email?compose=multiforward', 'Forwarding Multiple Messages'); if ($multiforward > 1) { - $r->print(&mt('Each of the [quant,_1,message] you checked' - .' will be forwarded to the recipient(s) you select below.',$multiforward) + $r->print(&mt('Each of the [quant,_1,message] you checked' + .' will be forwarded to the recipient(s) you select below.' + ,''.$multiforward.'') .'
'); } else { $r->print(&mt('The message you checked will be forwarded to the recipient(s) you select below.').'
'); @@ -1785,8 +1786,10 @@ sub retrieve_instructor_comments { } sub disfacetoface { - my ($r,$user,$domain)=@_; - my $target=$env{'form.grade_target'}; + my ($r,$user,$domain,$target)=@_; + if ($target eq '') { + my $target=$env{'form.grade_target'}; + } unless ($env{'request.course.id'}) { return; } if (!&Apache::lonnet::allowed('dff',$env{'request.course.id'}) && ! &Apache::lonnet::allowed('dff',$env{'request.course.id'}. @@ -1798,7 +1801,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 ''); @@ -1855,6 +1858,7 @@ $content{'sendername'}.':'. ''; } # Check to see if there were any messages. + &Apache::lonnet::logthis("lonmsgdisplay ..later ... target -- $target"); if ($result eq '') { my $lctype = &mt(lc(&Apache::loncommon::course_type())); if ($target ne 'tex') { @@ -1862,9 +1866,11 @@ $content{'sendername'}.':'. } else { $r->print('\textbf{'.&mt('No notes, face-to-face discussion records, critical messages or broadcast messages in this [_1].',$lctype).'}\\\\'); } + } elsif ($target ne 'tex') { + $r->print($result.'
'); } else { - $r->print($result); - } + $r->print(&Apache::lonxml::xmlparse($r, 'tex', $result)); + } } sub general_message { @@ -3352,7 +3358,7 @@ sub handler { $total ++; } &printheader($r,'','Marked Messages Read'); - $r->print(&mt('Marked [_1] message(s) read',$total).'

'); + $r->print(&mt('Marked [quant,_1,message] read',$total).'

'); &Apache::loncommunicate::menu($r); &disall($r,($folder?$folder:$dismode),$msgstatus); } elsif ($env{'form.markedaction'} eq 'markedunread') { @@ -3363,7 +3369,7 @@ sub handler { $total ++; } &printheader($r,'','Marked Messages Unread'); - $r->print(&mt('Marked [_1] message(s) unread',$total).'

'); + $r->print(&mt('Marked [quant,_1,message] unread',$total).'

'); &Apache::loncommunicate::menu($r); &disall($r,($folder?$folder:$dismode),$msgstatus); } elsif ($env{'form.markedaction'} eq 'markedmove') { @@ -3387,14 +3393,17 @@ sub handler { } } if ($failed) { - $r->print('

- '.&mt('Failed to move [_1] message(s)',$failed). - '

'); + $r->print('

' + .&mt('Failed to move [quant,_1,message]',$failed) + .'

'); $r->print('

'. join("

\n

",@failed_msg). "

\n"); } - $r->print(&mt('Moved [_1] message(s)',$total).'

'); + $r->print('

' + .&mt('Moved [quant,_1,message]',$total) + .'

' + .'

'); } &Apache::loncommunicate::menu($r); &disall($r,($folder?$folder:$dismode),$msgstatus); @@ -3413,14 +3422,17 @@ sub handler { } &printheader($r,'','Deleted Messages'); if ($failed) { - $r->print('

- '.&mt('Failed to delete [_1] message(s)',$failed). - '

'); + $r->print('

' + .&mt('Failed to delete [quant,_1,message]',$failed) + .'

'); $r->print('

'. join("

\n

",@failed_msg). "

\n"); } - $r->print(&mt('Deleted [_1] message(s)',$total).'

'); + $r->print('

' + .&mt('Deleted [quant,_1,message]',$total) + .'

' + .'

'); &Apache::loncommunicate::menu($r); &disall($r,($folder?$folder:$dismode),$msgstatus); } elsif ($env{'form.markunread'}) { @@ -3512,10 +3524,14 @@ sub handler { my $showfolder = $env{'form.newfolder'}; my ($makeresult,$warning) = &makefolder($env{'form.newfolder'}); if ($makeresult eq 'ok') { - $r->print(&mt('Folder "[_1]" created.',$showfolder).'
'); + $r->print('

' + .&mt('Folder "[_1]" created.',$showfolder) + .'

'); } else { - $r->print(&mt('Creation failed.').' '.$makeresult.'
'. - $warning); + $r->print('

' + .&mt('Creation failed.').' '.$makeresult.'
' + .$warning + .'

'); $showfolder = $folder; } &Apache::loncommunicate::menu($r); @@ -3527,10 +3543,14 @@ sub handler { my $showfolder = ''; my $delresult = &deletefolder($folder); if ($delresult eq 'ok') { - $r->print(&mt('Folder "[_1]" deleted.',$folder).'
'); + $r->print('

' + .&mt('Folder "[_1]" deleted.',$folder) + .'

'); $env{'form.folder'} = ''; } else { - $r->print(&mt('Deletion failed.').' '.$delresult.'
'); + $r->print('

' + .&mt('Deletion failed.').' '.$delresult + .'

'); $showfolder = $folder; } &Apache::loncommunicate::menu($r); @@ -3540,9 +3560,13 @@ sub handler { my $showfolder = $env{'form.renamed'}; my $renresult = &renamefolder($folder); if ($renresult eq 'ok') { - $r->print(&mt('Folder "[_1]" renamed to "[_2]".',$folder,$showfolder).'
'); + $r->print('

' + .&mt('Folder "[_1]" renamed to "[_2]".',$folder,$showfolder) + .'

'); } else { - $r->print(&mt('Renaming failed.').' '.$renresult.'
'); + $r->print('

' + .&mt('Renaming failed.').' '.$renresult + .'

'); $showfolder = $folder; } &Apache::loncommunicate::menu($r);
 '); if ($env{'form.sortedby'} eq "revdate") { - $r->print(''.&mt('Date').''); if ($env{'form.sortedby'} eq "revuser") { - $r->print(''.&mt('Username').''); + $r->print(''.&mt('Username').''); } else { - $r->print(''.&mt('Username').''); + $r->print(''.&mt('Username').''); } $r->print(''); if ($env{'form.sortedby'} eq "revdomain") { - $r->print(''.&mt('Domain').''); + $r->print(''.&mt('Domain').''); } else { - $r->print(''.&mt('Domain').''); + $r->print(''.&mt('Domain').''); } $r->print(''); if ($env{'form.sortedby'} eq "revsubject") { - $r->print(''.&mt('Subject').''); + $r->print(''.&mt('Subject').''); } else { - $r->print(''.&mt('Subject').''); + $r->print(''.&mt('Subject').''); } $r->print(''); if ($env{'form.sortedby'} eq "revcourse") { - $r->print(''.&mt('Course').''); + $r->print(''.&mt('Course').''); } else { - $r->print(''.&mt('Course').''); + $r->print(''.&mt('Course').''); } $r->print(''); if ($env{'form.sortedby'} eq "revstatus") { - $r->print(''.&mt('Status').'