--- loncom/interface/lonmsgdisplay.pm 2009/06/16 16:49:11 1.127 +++ 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.127 2009/06/16 16:49:11 bisitz 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 @@ -558,7 +558,7 @@ sub discourse { $result .= '
' .&mt('Bcc: course members with future access') .'' - .'
'; + .''; $result .= $tmptext.'
'; if (ref($statushash) eq 'HASH') { $statushash->{'future'} = 1; @@ -1060,44 +1060,44 @@ 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"); my $suffix = &Apache::lonmsg::foldersuffix($folder); - my $count = 0; + my $count = $firstdis; for (my $n=$firstdis;$n<=$lastdis;$n++) { my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$origID, $description,$recv_name,$recv_domain)= @@ -1218,8 +1218,12 @@ sub blocked_in_folder { my $finishblock = &Apache::lonlocal::locallocaltime($endblock); my $output = '

'. &mt('[quant,_1,message is, messages are] not viewable because display of LON-CAPA messages sent to you by other students between [_2] and [_3] is currently being blocked because of online exams.',$numblocked,$beginblock,$finishblock); - $output .= &Apache::loncommon::build_block_table($startblock,$endblock, - $setters); + #$output .= &Apache::loncommon::build_block_table($startblock,$endblock, + # $setters); + + my ($blocked, $blocktext) = &Apache::loncommon::blocking_status("com"); + $output .="

".$blocktext; + return $output; } @@ -1264,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.').'
'); @@ -1781,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'}. @@ -1794,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 ''); @@ -1851,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') { @@ -1858,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 { @@ -1886,8 +1896,8 @@ sub facetoface { return; } my $crstype = &Apache::loncommon::course_type(); - my $leaders = ($crstype eq 'Group') ? 'coordinators and leaders' - : 'faculty and staff'; + my $leaders = ($crstype eq 'Community') ? 'coordinators and leaders' + : 'faculty and staff'; &printheader($r, '/adm/email?recordftf=query', "User Notes, Face-to-Face, Critical Messages, Broadcast Messages, Archived Messages"); @@ -1973,8 +1983,8 @@ sub examblock { $r->print('Not allowed'); return; } - my $usertype = (&Apache::loncommon::course_type() eq 'Group') ? 'members' - : 'students'; + my $usertype = (&Apache::loncommon::course_type() eq 'Community') ? 'members' + : 'students'; my %lt=&Apache::lonlocal::texthash( 'comb' => 'Communication Blocking', 'cbds' => 'Communication blocking during scheduled exams', @@ -2275,8 +2285,10 @@ sub displaymessage { my @messages=&sortedmessages(\%blocked,$startblock,$endblock,\$numblocked,$folder,$msgstatus); if ( $blocked{$msgid} eq 'ON' ) { &printheader($r,'/adm/email',&mt('Display a Message')); - $r->print(&mt('You attempted to display a message that is currently blocked because you are enrolled in one or more courses for which there is an ongoing online exam.')); - &build_block_table($r,$startblock,$endblock,\%setters); + #$r->print(&mt('You attempted to display a message that is currently blocked because you are enrolled in one or more courses for which there is an ongoing online exam.')); + #&build_block_table($r,$startblock,$endblock,\%setters); + my($blocked, $blocktext) = &Apache::loncommon::blocking_status("com"); + $r->print("
".$blocktext); return; } if ($msgstatus eq '') { @@ -3346,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') { @@ -3357,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') { @@ -3381,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); @@ -3407,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'}) { @@ -3506,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); @@ -3521,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); @@ -3534,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').'