--- loncom/interface/lonmsgdisplay.pm 2012/11/30 14:57:17 1.162 +++ loncom/interface/lonmsgdisplay.pm 2014/05/21 17:36:58 1.175 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging display # -# $Id: lonmsgdisplay.pm,v 1.162 2012/11/30 14:57:17 bisitz Exp $ +# $Id: lonmsgdisplay.pm,v 1.175 2014/05/21 17:36:58 musolffc Exp $ # # Copyright Michigan State University Board of Trustees # @@ -128,11 +128,8 @@ sub folderlist { go => 'Go', nnff => 'New Name for Folder', newn => 'New Name', - thfm => 'The folder may not be renamed', - fmnb => 'folder may not be renamed as it is a folder provided by the system.', - asth => 'as this name is already in use for a system-provided or user-defined folder.', - the => 'The', - tnfm => 'The new folder may not be named', + fmnb => 'Folder may not be renamed as it is a folder provided by the system.', + asth => 'Requested name already in use for a system-provided or user-defined folder.', ); @@ -182,7 +179,7 @@ function folder_choice(targetform,caller if (targetform.folderaction.options[targetform.folderaction.selectedIndex].value == 'rename') { for (var i=0; i'.$lt{'status'}.'
'."\n". &Apache::loncommon::select_form($msgstatus,'msgstatus',\%statushash).' - '.$lt{'actn'}.'
'."\n".' + + '.$lt{'actn'}.'
'."\n".' '. &Apache::loncommon::select_form('view','folderaction',\%actions). ' - - - '.&mt('New Folder').'
'."\n".' + + '.&mt('New Folder').'
'."\n".' ' - .'
'; + .''; $result .= $tmptext.'

'; if (ref($statushash) eq 'HASH') { $statushash->{'active'} = 1; @@ -569,7 +566,7 @@ sub discourse { $result .= '
' .$bcc_prev_hdr .'' - .'
'; + .''; $result .= $tmptext.'

'; if (ref($statushash) eq 'HASH') { $statushash->{'previous'} = 1; @@ -592,7 +589,7 @@ sub discourse { $result .= '
' .$bcc_future_hdr .'' - .'
'; + .''; $result .= $tmptext.'
'; if (ref($statushash) eq 'HASH') { $statushash->{'future'} = 1; @@ -667,7 +664,7 @@ sub disgroup { } $r->print('
'. ''.$lt{$status}.''. - '
'. + ''. ''. ''. @@ -816,7 +813,9 @@ sub discrit { .''; my %what=&Apache::lonnet::dump('critical'); my $result = ''; - foreach my $key (sort(keys(%what))) { + # 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; @@ -1026,6 +1025,13 @@ sub disall { &Apache::loncommon::store_settings('user','mail',\%saveable); &Apache::loncommon::restore_settings('user','mail',\%saveable); $folder ||= $env{'form.folder'}; + # Always show critical messages if present + my @what=&Apache::lonnet::dump('critical',$env{'user.domain'},$env{'user.name'}); + if ($what[0]) { + if (($what[0] ne 'con_lost') && ($what[0]!~/^error\:/)) { + $folder = 'critical'; + } + } $msgstatus ||= $env{'form.msgstatus'}; $env{'form.interdis'} ||= 20; @@ -1207,7 +1213,7 @@ ENDDISHEADER foreach my $item ($localsenttime,$dis_name,$dis_domain,$shortsubj) { $r->print(''.(($status eq 'new')?'':''). ''. - $item.(($status eq 'new')?'':'').''); + $item.''.(($status eq 'new')?'':'').''); } # Description and Status my $showstatus; @@ -1257,7 +1263,7 @@ ENDDISHEADER $r->print(' '."\n"); } if ($msgstatus ne 'read') { - $r->print(' ."\n"'); + $r->print(' '."\n"); } if ($msgstatus ne 'unread') { $r->print(' '."\n"); @@ -1665,8 +1671,8 @@ ENDREPSCRIPT $r->print(&additional_rec_row(\%lt)); $r->print(''. &mt('Unless you choose otherwise:').'
  • '. - &mt("The subject in each forwarded message will be 'Forwarding:' followed by the original subject.").'
  • '. - &mt("The message itself will begin with a first line: 'Forwarded message from' followed by the original sender's name.").'
'); + &mt("The subject in each forwarded message will be [_1]'Forwarding:'[_2] followed by the original subject.",'','').'
  • '. + &mt("The message itself will begin with a first line: [_1]'Forwarded message from'[_2] followed by the original sender's name.",'','').'
  • '); $func1='Forward'; # do not translate here! $dissub = &mt('Forwarding').': '; $subj_size = '10'; @@ -1741,7 +1747,7 @@ ENDBLOCK '

    -'.&mt('The messages will be assembled from all lines with the respective'."\n".'username:domain, and appended to the general message text.')); +'.&mt('The messages will be assembled from all lines with the respective [_1][_2]username:domain[_3], and appended to the general message text.','
    ','','')); $r->print(<

    @@ -1927,8 +1933,7 @@ sub disfacetoface { } else { %content=&Apache::lonmsg::unpackagemsg($content{'message'}); $content{'message'} = - ''.&mt('Subject').': '.$content{'subject'}.'
    '.&mt('Subject').': '.$content{'subject'}.'
    '. $content{'message'}; } } else { @@ -1957,9 +1962,9 @@ $content{'sendername'}.':'. if ($result eq '') { my $lctype = &mt(lc(&Apache::loncommon::course_type())); if ($target ne 'tex') { - $r->print("

    ".&mt('No notes, face-to-face discussion records, critical messages, or broadcast messages in this [_1].',$lctype)."

    "); + $r->print("

    ".&mt('No notes, face-to-face discussion records, critical messages or broadcast messages in this '.$lctype.'.')."

    "); } else { - $r->print('\textbf{'.&mt('No notes, face-to-face discussion records, critical messages or broadcast messages in this [_1].',$lctype).'}\\\\'); + $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.''); @@ -2166,7 +2171,7 @@ sub displaymessage { if (&Apache::lonnet::allowed('vgr',$env{'request.course.id'})) { push(@actionlist,&Apache::loncommon::track_student_link( - &mt('View recent activity') + 'View recent activity' ,$content{'sendername'} ,$content{'senderdomain'} ,'check'));