--- loncom/interface/lonmsgdisplay.pm 2009/08/13 16:58:36 1.124.4.1 +++ loncom/interface/lonmsgdisplay.pm 2013/07/15 16:13:21 1.163 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging display # -# $Id: lonmsgdisplay.pm,v 1.124.4.1 2009/08/13 16:58:36 raeburn Exp $ +# $Id: lonmsgdisplay.pm,v 1.163 2013/07/15 16:13:21 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -110,11 +110,11 @@ use Apache::lonfeedback; use Apache::lonrss(); use Apache::lonselstudent(); use lib '/home/httpd/lib/perl/'; -use LONCAPA; +use LONCAPA qw(:DEFAULT :match); # Querystring component with sorting type -my $sqs; -my $startdis; +my $sqs=''; +my $startdis=''; # ============================================================ List all folders @@ -146,7 +146,7 @@ sub folderlist { ); $actions{'select_form_order'} = ['view','rename','delete']; - my %statushash = &get_msgstatus_types(); + my %statushash = &Apache::lonlocal::texthash(&get_msgstatus_types()); $statushash{'select_form_order'} = ['','new','read','replied','forwarded']; @@ -219,43 +219,43 @@ function folder_choice(targetform,caller |; my %show = ('select_form_order' => [10,20,50,100,200], map {$_=>$_} (10,20,50,100,200)); - - + $output .= '
- - - - - -
- +
+ '.&mt('Folder Actions').' +
- - - - + + +
'.$lt{'fold'}.'
'."\n". - &Apache::loncommon::select_form($folder,'folder',%formhash).' +
'.$lt{'fold'}.'
'."\n". + &Apache::loncommon::select_form($folder,'folder',\%formhash).'
'.$lt{'show'}.'
'."\n". +
'.$lt{'show'}.'
'."\n". &Apache::loncommon::select_form($env{'form.interdis'},'interdis', - %show).' + \%show).'
'.$lt{'status'}.'
'."\n". - &Apache::loncommon::select_form($msgstatus,'msgstatus',%statushash).' +
'.$lt{'status'}.'
'."\n". + &Apache::loncommon::select_form($msgstatus,'msgstatus',\%statushash).'
'.$lt{'actn'}.'
'. - &Apache::loncommon::select_form('view','folderaction',%actions).' -

'. - ' +
'.$lt{'actn'}.'
'."\n".' + '. + &Apache::loncommon::select_form('view','folderaction',\%actions). + ' + +
'.&mt('New Folder').'
'."\n".' + + + +
-
     - '. - '

-
'.&mt('Name').'
'. - ' -
-
'."\n". + +'."\n". ''. ''. ($folder=~/^critical/?'
':''); @@ -273,12 +273,13 @@ sub get_permanent_folders { } sub get_msgstatus_types { - my %statushash = &Apache::lonlocal::texthash( - '' => 'Any', - new => 'Unread', - read => 'Read', - replied => 'Replied to', - forwarded => 'Forwarded', + # Don't translate here! + my %statushash = ( + '' => 'Any', + 'new' => 'Unread', + 'read' => 'Read', + 'replied' => 'Replied to', + 'forwarded' => 'Forwarded', ); return %statushash; } @@ -291,18 +292,31 @@ sub scrollbuttons { my %statushash = &get_msgstatus_types(); my $status; if ($msgstatus eq '') { - $status = &mt('All'); + $status = 'All'; # Don't translate here! } 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 @@ -369,7 +383,7 @@ sub deletefolder { my ($folder)=@_; my %permfolders = &get_permanent_folders(); if (defined($permfolders{$folder})) { - return &mt('The folder "[_1]" may not be deleted',$folder); + return &mt('The folder "[_1]" may not be deleted.',$folder); } my %userfolders = &Apache::lonmsg::get_user_folders(); if (!defined($userfolders{$folder})) { @@ -509,6 +523,7 @@ sub movemsg { sub discourse { my ($statushash) = @_; my ($result,$active,$previous,$future); + my $crstype = &Apache::loncommon::course_type(); my ($course_personnel, $current_members, $expired_members, @@ -524,7 +539,16 @@ sub discourse { \%defaultUsers, 1,"selectedusers",1,'email') ) { - $result .= '
'.&mt('Bcc: course members with current access').'
'; + 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 .= '
' + .$bcc_curr_hdr + .'' + .''; $result .= $tmptext.'

'; if (ref($statushash) eq 'HASH') { $statushash->{'active'} = 1; @@ -536,7 +560,16 @@ sub discourse { \%defaultUsers, 1, "selectedusers",0,'email') ) { - $result .= '
'.&mt('Bcc: course members with expired access').'
'; + my $bcc_prev_hdr; + if ($crstype eq 'Community') { + $bcc_prev_hdr = &mt('Bcc: community participants with expired access'); + } else { + $bcc_prev_hdr = &mt('Bcc: course members with expired access'); + } + $result .= '
' + .$bcc_prev_hdr + .'' + .''; $result .= $tmptext.'

'; if (ref($statushash) eq 'HASH') { $statushash->{'previous'} = 1; @@ -549,7 +582,17 @@ sub discourse { \%defaultUsers, 1, "selectedusers",0,'email') ) { - $result .= '
'.&mt('Bcc: course members with future access').'
'; + my $bcc_future_hdr; + if ($crstype eq 'Community') { + $bcc_future_hdr = &mt('Bcc: community participants with future access'); + } else { + $bcc_future_hdr = &mt('Bcc: course members with future access'); + } + + $result .= '
' + .$bcc_future_hdr + .'' + .''; $result .= $tmptext.'
'; if (ref($statushash) eq 'HASH') { $statushash->{'future'} = 1; @@ -588,9 +631,7 @@ sub disgroup { return; } else { $hasfloat = 1; - unless($env{'environment.wysiwygeditor'} eq 'on') { - $r->print('
'); - } + $r->print('
'); my %Sortby = ( active => {}, previous => {}, @@ -624,8 +665,9 @@ sub disgroup { if (ref($access_status) eq 'HASH') { $access_status->{$status} = $$numitems{$status}; } - $r->print('
'.$lt{$status}. - '
'. + $r->print('
'. + ''.$lt{$status}.''. + ''. ''. ''. @@ -662,9 +704,7 @@ sub disgroup { } } } - unless($env{'environment.wysiwygeditor'} eq 'on') { - $r->print('
'); - } + $r->print('
'); } return $hasfloat; } @@ -672,7 +712,7 @@ sub disgroup { sub group_check_uncheck { my $output = qq|