--- loncom/interface/lonmsg.pm 2004/06/02 20:40:07 1.102 +++ loncom/interface/lonmsg.pm 2004/07/15 21:08:45 1.104 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging # -# $Id: lonmsg.pm,v 1.102 2004/06/02 20:40:07 raeburn Exp $ +# $Id: lonmsg.pm,v 1.104 2004/07/15 21:08:45 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -219,10 +219,14 @@ sub sendemail { my $msg = new Mail::Send; $msg->to($to); $msg->subject('[LON-CAPA] '.$subject); + my %oldENV=%ENV; + undef(%ENV); if (my $fh = $msg->open()) { print $fh $body; $fh->close; } + %ENV=%oldENV; + undef(%oldENV); } # ==================================================== Send notification emails @@ -945,6 +949,31 @@ ENDUPLOAD # ---------------------------------------------------- Display all face to face +sub retrieve_instructor_comments { + my ($user,$domain)=@_; + my $target=$ENV{'form.grade_target'}; + if (! $ENV{'request.course.id'}) { return; } + if (! &Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) { + return; + } + my %records=&Apache::lonnet::dump('nohist_email', + $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, + $ENV{'course.'.$ENV{'request.course.id'}.'.num'}, + '%255b'.$user.'%253a'.$domain.'%255d'); + my $result=''; + foreach (sort(keys(%records))) { + my %content=&unpackagemsg($records{$_}); + next if ($content{'senderdomain'} eq ''); + next if ($content{'subject'} !~ /^Record/); + # $content{'message'}=~s/\n/\/g; + $result.='Recorded by '. + $content{'sendername'}.'@'.$content{'senderdomain'}."\n"; + $result.= + &Apache::lontexconvert::msgtexconverted($content{'message'})."\n"; + } + return $result; +} + sub disfacetoface { my ($r,$user,$domain)=@_; my $target=$ENV{'form.grade_target'};