--- loncom/interface/lonmsgdisplay.pm 2010/11/20 13:19:49 1.124.4.12 +++ loncom/interface/lonmsgdisplay.pm 2010/01/14 17:20:44 1.142 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging display # -# $Id: lonmsgdisplay.pm,v 1.124.4.12 2010/11/20 13:19:49 raeburn Exp $ +# $Id: lonmsgdisplay.pm,v 1.142 2010/01/14 17:20:44 bisitz 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 @@ -295,14 +295,26 @@ sub scrollbuttons { } else { $status = $statushash{$msgstatus}; } - return - ''.&mt('Page').': '. - ''. - ''. - ' of '.$maxdis. - ''. - ''. - &mt('[_1] messages: showing messages [_2] through [_3] of [_4].',$status,$first,$finish,$total).''; + my $output = ''.&mt('Page:').' '; + if ($maxdis == 1) { + # No buttons if only one page is displayed + $output .= '1/1'; + } else { + $output .= + ''. + ''. + ' / '.$maxdis.' '. + ''. + ''; + } + $output .= + '' + .''.&mt($status.' messages:').' ' + .&mt('showing messages [_1] through [_2] of [_3].', + $first,$finish,$total) + .''; + + return $output; } # =============================================================== Status Change @@ -525,20 +537,20 @@ sub discourse { \%defaultUsers, 1,"selectedusers",1,'email') ) { - my $bcc_curr_hdr; - if ($crstype eq 'Community') { - $bcc_curr_hdr = &mt('Bcc: community participants with current access'); - } else { - $bcc_curr_hdr = &mt('Bcc: course members with current access'); - } - $result .= '
'); if ($msgstatus eq '') { $r->print(&mt('There are no messages in this folder.')); } elsif ($msgstatus eq 'replied') { $r->print(&mt('You have not replied to any messages in this folder.')); - } else { + } else { $r->print(&mt('There are no '.lc($statushash{$msgstatus}).' messages in this folder.')); } $r->print('
'.&Apache::lonhtmlcommon::confirm_success(&mt('Could not deliver message'),1).' '. + &mt('Please use the browser "Back" button and correct the recipient addresses ([_1]).',$sendstatus).'
'.$msg.'
'. + &mt('Failed to delete the message.').'
'.$msg."
'); &Apache::loncommunicate::menu($r); &disall($r,($folder?$folder:$dismode),$msgstatus); } elsif ($env{'form.markedaction'} eq 'markedunread') { @@ -3434,9 +3440,7 @@ sub handler { $total ++; } &printheader($r,'','Marked Messages Unread'); - my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Marked [quant,_1,message] unread',$total)); - $message = &Apache::loncommon::confirmwrapper($message); - $r->print($message); + $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') { @@ -3459,16 +3463,18 @@ sub handler { push(@failed_msg,$msg); } } - my $message; - if ($failed) { - $message = &Apache::lonhtmlcommon::confirm_success(&mt('Failed to move [quant,_1,message]',$failed),1); - $message .= '
'. - join("
",@failed_msg). - "
' + .&mt('Failed to move [quant,_1,message]',$failed) + .'
'. + join("
",@failed_msg). + "
' + .&mt('Moved [quant,_1,message]',$total) + .'
'); } &Apache::loncommunicate::menu($r); &disall($r,($folder?$folder:$dismode),$msgstatus); @@ -3486,16 +3492,18 @@ sub handler { } } &printheader($r,'','Deleted Messages'); - my $message; if ($failed) { - $message = &Apache::lonhtmlcommon::confirm_success(&mt('Failed to delete [quant,_1,message]',$failed),1); - $message .= '
'. + $r->print('
' + .&mt('Failed to delete [quant,_1,message]',$failed) + .'
'. join("
' + .&mt('Deleted [quant,_1,message]',$total) + .'
'); &Apache::loncommunicate::menu($r); &disall($r,($folder?$folder:$dismode),$msgstatus); } elsif ($env{'form.markunread'}) { @@ -3551,19 +3559,19 @@ sub handler { } if (keys(%forwardok) > 0) { my $count = keys(%forwardok); - my $message = &Apache::lonhtmlcommon::confirm_success(&mt('[quant,_1,message] forwarded.',$count)); - $message = &Apache::loncommon::confirmwrapper($message); - $r->print($message); + $r->print(''. + &mt('[quant,_1,message] forwarded.',$count). + ''); } if (keys(%forwardfail) > 0) { my $count = keys(%forwardfail); - my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Could not forward [quant,_1,message].',$count),1); + $r->print('
'. + &mt('Could not forward [quant,_1,message].',$count). + ' '); foreach my $key (keys(%forwardfail)) { - $message .= ''.&mt('Could not deliver forwarded message.').' '. - &mt('The recipient addresses may need to be corrected').' ('.$forwardfail{$key}.')'; + $r->print(&mt('Could not deliver forwarded message.').' '. + &mt('The recipient addresses may need to be corrected').' ('.$forwardfail{$key}.').'); } - $message = &Apache::loncommon::confirmwrapper($message); - $r->print($message); } &Apache::loncommunicate::menu($r); } else { @@ -3587,13 +3595,14 @@ sub handler { my $showfolder = $env{'form.newfolder'}; my ($makeresult,$warning) = &makefolder($env{'form.newfolder'}); if ($makeresult eq 'ok') { - my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Folder "[_1]" created.',$showfolder)); - $message = &Apache::loncommon::confirmwrapper($message); - $r->print($message); + $r->print('
' + .&mt('Folder "[_1]" created.',$showfolder) + .'
' + .&mt('Creation failed.').' '.$makeresult.'' + .$warning + .'
' + .&mt('Folder "[_1]" deleted.',$folder) + .'
' + .&mt('Deletion failed.').' '.$delresult + .'
' + .&mt('Folder "[_1]" renamed to "[_2]".',$folder,$showfolder) + .'
' + .&mt('Renaming failed.').' '.$renresult + .'