--- loncom/interface/lonmsgdisplay.pm 2008/12/05 19:38:32 1.100 +++ loncom/interface/lonmsgdisplay.pm 2009/08/28 23:29:45 1.114.2.1 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging display # -# $Id: lonmsgdisplay.pm,v 1.100 2008/12/05 19:38:32 schafran Exp $ +# $Id: lonmsgdisplay.pm,v 1.114.2.1 2009/08/28 23:29:45 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -353,7 +353,7 @@ sub makefolder { } } else { $outcome = - &mt('Error - could not obtain lock on e-mail folders record.'); + &mt('Error - could not obtain lock on message folders record.'); } return ($outcome,$warning); } @@ -544,7 +544,7 @@ sub discourse { \%defaultUsers, 1, "selectedusers",0,'email') ) { - $result .= '
' + .'' + ); } } + my ($tonum,$tolist,$cclist,$bcclist,$groupcclist,%recipients); if ($content{'recipid'}) { $tonum = &retrieve_recips('display',\%content,\%recipients); @@ -2334,7 +2394,16 @@ sub displaymessage { $bcclist = join(', ',@{$recipients{'bcc'}}); } } - if (!$tolist && ref($content{'recuser'}) eq 'ARRAY') { + + my $broadcast_link; + if (($content{'courseid'}) && ($content{'recipid'} && + (ref($recipients{'course_broadcast'}) eq 'ARRAY') || + (ref($recipients{'group_cc_broadcast'}) eq 'ARRAY') || + (ref($recipients{'group_bcc_broadcast'}) eq 'ARRAY'))) { + $broadcast_link = &recipients_link($r,\%content,\%recipients); + } + + if (((!$tolist) && (!$broadcast_link)) && ref($content{'recuser'}) eq 'ARRAY') { my @recipients; for (my $i=0; $i<@{$content{'recuser'}}; $i++) { $recipients[$i] = &Apache::loncommon::aboutmewrapper( @@ -2356,21 +2425,14 @@ sub displaymessage { if (defined($content{'baseurl'})) { $baseurl = &Apache::lonenc::check_encrypt($content{'baseurl'}); } + $r->print(' ' .&Apache::lonhtmlcommon::start_pick_box() .&Apache::lonhtmlcommon::row_title(&mt('Subject')) .$content{'subject'} @@ -2378,10 +2440,12 @@ sub displaymessage { ); if ($folder eq 'sent') { # To - $r->print(&Apache::lonhtmlcommon::row_title(&mt('To')) - .$tolist - .&Apache::lonhtmlcommon::row_closure() - ); + if ($tolist) { + $r->print(&Apache::lonhtmlcommon::row_title(&mt('To')) + .$tolist + .&Apache::lonhtmlcommon::row_closure() + ); + } if ($cclist) { $r->print(&Apache::lonhtmlcommon::row_title(&mt('Cc')) .$cclist @@ -2635,13 +2699,13 @@ sub recipients_link { $nothing=&Apache::lonhtmlcommon::javascript_nothing(); $height = 400; $width = 600; - my $start_page = - &Apache::loncommon::start_page('Broadcast List', undef, - {only_body => 1, - js_ready => 1,}); - my $end_page = &Apache::loncommon::end_page({js_ready => 1,}); - my $body = '