--- loncom/interface/lonmsgdisplay.pm 2010/02/12 15:21:37 1.148 +++ loncom/interface/lonmsgdisplay.pm 2011/05/12 21:56:13 1.157 @@ -1,7 +1,7 @@ -# The LearningOnline Network with CAPA +# $textareaclass The LearningOnline Network with CAPA # Routines for messaging display # -# $Id: lonmsgdisplay.pm,v 1.148 2010/02/12 15:21:37 bisitz Exp $ +# $Id: lonmsgdisplay.pm,v 1.157 2011/05/12 21:56:13 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -110,7 +110,7 @@ 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=''; @@ -225,18 +225,18 @@ function folder_choice(targetform,caller
'.$lt{'fold'}.' '."\n". - &Apache::loncommon::select_form($folder,'folder',%formhash).' + &Apache::loncommon::select_form($folder,'folder',\%formhash).' |
'.$lt{'show'}.' '."\n". &Apache::loncommon::select_form($env{'form.interdis'},'interdis', - %show).' + \%show).' |
'.$lt{'status'}.' '."\n". - &Apache::loncommon::select_form($msgstatus,'msgstatus',%statushash).' + &Apache::loncommon::select_form($msgstatus,'msgstatus',\%statushash).' |
'.$lt{'actn'}.' '."\n".' '. - &Apache::loncommon::select_form('view','folderaction',%actions). + &Apache::loncommon::select_form('view','folderaction',\%actions). ' @@ -626,9 +626,7 @@ sub disgroup { return; } else { $hasfloat = 1; - unless($env{'environment.wysiwygeditor'} eq 'on') { - $r->print(' ');
- }
+ $r->print(' ');
}
return $hasfloat;
}
@@ -818,6 +814,15 @@ sub discrit {
foreach my $key (sort(keys(%what))) {
my %content=&Apache::lonmsg::unpackagemsg($what{$key});
next if ($content{'senderdomain'} eq '');
+ my $description;
+ if ($content{'courseid'} ne '') {
+ if ($content{'courseid'} =~ m{/^$match_domain\_$match_courseid$}) {
+ my %courseinfo=&Apache::lonnet::coursedescription($content{'courseid'},{'one_time' => 1});
+ if ($courseinfo{'description'} ne '') {
+ $description = $courseinfo{'description'};
+ }
+ }
+ }
$result .= &Apache::lonhtmlcommon::start_pick_box()
.&Apache::lonhtmlcommon::row_title(&mt('From'),undef,'LC_oddrow_value')
.''.&Apache::loncommon::aboutmewrapper(
@@ -829,8 +834,13 @@ sub discrit {
.&Apache::lonhtmlcommon::row_closure(1)
.&Apache::lonhtmlcommon::row_title(&mt('Subject'),undef,'LC_oddrow_value')
.$content{'subject'}
- .&Apache::lonhtmlcommon::row_closure(1)
- .&Apache::lonhtmlcommon::row_title(&mt('Message'),undef,'LC_evenrow_value')
+ .&Apache::lonhtmlcommon::row_closure(1);
+ if ($description ne '') {
+ $result .= &Apache::lonhtmlcommon::row_title(&mt('Course'),undef,'LC_oddrow_value')
+ .$description
+ .&Apache::lonhtmlcommon::row_closure(1);
+ }
+ $result .= &Apache::lonhtmlcommon::row_title(&mt('Message'),undef,'LC_evenrow_value')
.'');
my %Sortby = (
active => {},
previous => {},
@@ -701,9 +699,7 @@ sub disgroup {
}
}
}
- unless($env{'environment.wysiwygeditor'} eq 'on') {
- $r->print(' ');
- }
+ $r->print(''.&Apache::lontexconvert::msgtexconverted($content{'message'}).'' .&Apache::lonhtmlcommon::row_closure() .&Apache::lonhtmlcommon::row_title('',undef,'LC_oddrow_value') @@ -985,10 +995,15 @@ sub get_course_desc { if (defined($env{'course.'.$fromcid.'.description'})) { $description = $env{'course.'.$fromcid.'.description'}; } else { - my %courseinfo=&Apache::lonnet::coursedescription($fromcid); - $description = $courseinfo{'description'}; + if ($fromcid =~ m{/^$match_domain\_$match_courseid$}) { + my %courseinfo=&Apache::lonnet::coursedescription($fromcid, + {'one_time' => 1}); + $description = $courseinfo{'description'}; + } + } + if ($description ne '') { + $$descriptions{$fromcid} = $description; } - $$descriptions{$fromcid} = $description; } return $description; } @@ -1098,7 +1113,9 @@ ENDDISHEADER if ($lastdis>$#temp) { $lastdis=$#temp; } $r->print(&scrollbuttons($startdis,$number,$firstdis,$lastdis,$totalnumber,$msgstatus)); $r->print(''); if ($hasfloat) { - unless($env{'environment.wysiwygeditor'} eq 'on') { - $r->print(''); - } + $r->print(''); } $r->print(&generate_preview_form); } @@ -1995,6 +2018,7 @@ sub facetoface { .&Apache::lonhtmlcommon::end_pick_box() .' ' .'' + .'' ); if (($stage ne 'query') && @@ -2397,7 +2421,6 @@ sub displaymessage { my $number_of_messages = scalar(@messages); #subtract 1 for last index # start output &printheader($r,'/adm/email?display='.&escape($msgid),'Display a Message','',$content{'baseurl'}); - my %courseinfo=&Apache::lonnet::coursedescription($content{'courseid'}); # Prepare available functions my @functionlist; @@ -2641,12 +2664,14 @@ sub displaymessage { } if ($content{'group'} ne '') { if (&check_group_priv($content{'group'})) { - $groupcclist = join(', ',@{$recipients{'group_cc_broadcast'}}); - if ($groupcclist) { - $r->print(&Apache::lonhtmlcommon::row_title(&mt('Group Cc')) - .$groupcclist - .&Apache::lonhtmlcommon::row_closure() - ); + if (ref($recipients{'group_cc_broadcast'}) eq 'ARRAY') { + $groupcclist = join(', ',@{$recipients{'group_cc_broadcast'}}); + if ($groupcclist) { + $r->print(&Apache::lonhtmlcommon::row_title(&mt('Group Cc')) + .$groupcclist + .&Apache::lonhtmlcommon::row_closure() + ); + } } } } @@ -2654,14 +2679,22 @@ sub displaymessage { } # Course - if ($content{'courseid'}) { - $r->print(&Apache::lonhtmlcommon::row_title(&mt($crstype)) - .$courseinfo{'description'} - ); - if ($content{'coursesec'}) { - $r->print(' ('.&mt('Section').': '.$content{'coursesec'}.')'); + if ($content{'courseid'} ne '') { + if ($content{'courseid'} =~ m{^$match_domain\_$match_courseid$}) { + my %courseinfo; + %courseinfo=&Apache::lonnet::coursedescription($content{'courseid'}, + {'one_time' => 1}); + my $description = $courseinfo{'description'}; + if ($description ne '') { + $r->print(&Apache::lonhtmlcommon::row_title(&mt($crstype)) + .$description + ); + if ($content{'coursesec'}) { + $r->print(' ('.&mt('Section').': '.$content{'coursesec'}.')'); + } + $r->print(&Apache::lonhtmlcommon::row_closure()); + } } - $r->print(&Apache::lonhtmlcommon::row_closure()); } $r->print(&Apache::lonhtmlcommon::row_title(&mt('Time')) .$content{'time'} @@ -3170,7 +3203,7 @@ sub sendoffmail { my ($recuname,$recdomain)=split(/\:/,$address); my $msgtxt = $savemsg; if ($toaddr{$address}) { - $msgtxt.=' '.$toaddr{$address}; + $msgtxt.="\n".' '."\n".$toaddr{$address}; } my @thismsg; if ($msgtype eq 'critical') { @@ -3295,6 +3328,9 @@ sub sendoffmail { $r->print($message); } } + } else { + &printheader($r,'','Messages cancelled.'); + return 'cancelled'; } return $sendstatus; } |