--- loncom/interface/lonmsgdisplay.pm 2010/01/25 21:08:48 1.124.4.7 +++ loncom/interface/lonmsgdisplay.pm 2009/09/08 22:08:20 1.134 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging display # -# $Id: lonmsgdisplay.pm,v 1.124.4.7 2010/01/25 21:08:48 raeburn Exp $ +# $Id: lonmsgdisplay.pm,v 1.134 2009/09/08 22:08:20 raeburn 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 @@ -146,7 +146,7 @@ sub folderlist { ); $actions{'select_form_order'} = ['view','rename','delete']; - my %statushash = &Apache::lonlocal::texthash(&get_msgstatus_types()); + my %statushash = &get_msgstatus_types(); $statushash{'select_form_order'} = ['','new','read','replied','forwarded']; @@ -219,7 +219,8 @@ function folder_choice(targetform,caller |; my %show = ('select_form_order' => [10,20,50,100,200], map {$_=>$_} (10,20,50,100,200)); - + + $output .= '
@@ -272,13 +273,12 @@ sub get_permanent_folders { } sub get_msgstatus_types { - # Don't translate here! - my %statushash = ( - '' => 'Any', - 'new' => 'Unread', - 'read' => 'Read', - 'replied' => 'Replied to', - 'forwarded' => 'Forwarded', + my %statushash = &Apache::lonlocal::texthash( + '' => 'Any', + new => 'Unread', + read => 'Read', + replied => 'Replied to', + forwarded => 'Forwarded', ); return %statushash; } @@ -291,7 +291,7 @@ sub scrollbuttons { my %statushash = &get_msgstatus_types(); my $status; if ($msgstatus eq '') { - $status = 'All'; # Don't translate here! + $status = &mt('All'); } else { $status = $statushash{$msgstatus}; } @@ -299,7 +299,7 @@ sub scrollbuttons { ''.&mt('Page').': '. ''. ''. - ' of '.$maxdis. + ' / '.$maxdis.' '. ''. '
'. &mt('[_1] messages: showing messages [_2] through [_3] of [_4].',$status,$first,$finish,$total).''; @@ -509,7 +509,6 @@ sub movemsg { sub discourse { my ($statushash) = @_; my ($result,$active,$previous,$future); - my $crstype = &Apache::loncommon::course_type(); my ($course_personnel, $current_members, $expired_members, @@ -525,20 +524,14 @@ 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 .= '
' - .''.$bcc_curr_hdr.'' - .'' - .'
'; - $result .= $tmptext.'

'; - if (ref($statushash) eq 'HASH') { - $statushash->{'active'} = 1; - } + $result .= '
' + .&mt('Bcc: course members with current access') + .'' + .'
'; + $result .= $tmptext.'

'; + if (ref($statushash) eq 'HASH') { + $statushash->{'active'} = 1; + } } if ($tmptext = &Apache::lonselstudent::render_student_list($expired_members, "previoususers", @@ -546,20 +539,15 @@ sub discourse { \%defaultUsers, 1, "selectedusers",0,'email') ) { - 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 .= '
' + .&mt('Bcc: course members with expired access') + .'' + .''; $result .= $tmptext.'

'; if (ref($statushash) eq 'HASH') { $statushash->{'previous'} = 1; } + } if ($tmptext = &Apache::lonselstudent::render_student_list($future_members, "futureusers", @@ -567,20 +555,15 @@ sub discourse { \%defaultUsers, 1, "selectedusers",0,'email') ) { - 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 .= '
' + .&mt('Bcc: course members with future access') + .'' + .''; $result .= $tmptext.'
'; if (ref($statushash) eq 'HASH') { $statushash->{'future'} = 1; } + } return $result; } @@ -650,8 +633,9 @@ sub disgroup { if (ref($access_status) eq 'HASH') { $access_status->{$status} = $$numitems{$status}; } - $r->print('
'.$lt{$status}. - '
'. + $r->print('
'. + ''.$lt{$status}.''. + ''. ''. ''. @@ -698,7 +682,7 @@ sub disgroup { sub group_check_uncheck { my $output = qq|